Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions plugins/pardes-pi/docs/MANAGER.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,16 @@ durable history remains intact. It fails closed on unrelated interruption, and
`/pardes stop` synchronously cancels every active report identity and invalidates
pre-read lifecycle permits before manager deactivation. Restart advances the
permit epoch, so a late pre-stop artifact read cannot create delivery or block a
fresh retrieval. After fixes, call
`verification_refresh({ verificationId })` so the same retained verifier checks
the latest clean HEAD. Verification is advisory and
fresh retrieval. A terminal writer report that advances the reviewed head may
carry a Pardes-derived stale-evidence context on that same inbox row; treat it as
the software-owned signal to refresh, not as a second missing notification. An
`audit repair pending` count is software-owned durable recovery state; leave its
blocked row unacknowledged and let restore/retry settle the exact audit identity.
If storage status reports event corruption, Pardes preserves the damaged bytes,
retains parseable audit records, and reports whether it repaired a trailing
fragment or interior line; inspect the preserved artifact only for operator
diagnosis. After fixes, call `verification_refresh({ verificationId })` so the
same retained verifier checks the latest clean HEAD. Verification is advisory and
separate from publication. Use it before publishing meaningful engineering
slices and when a concrete review question remains. Skip trivial documentation
or test-only maintenance unless risk justifies it. Do not recreate verification
Expand All @@ -111,6 +118,11 @@ For a completed worker slice:
intentionally never force-pushes;
7. leave merges under user control.

Acknowledged conflict attention stays generation-scoped to its audited head and
owner lifecycle. Transient `unknown` or one-off `mergeable` hosted projections do
not re-arm it. A newly audited head/lifecycle or conflict reappearance after
confirmed resolution does; inspect that new generation rather than polling.

Browser handoff is explicit: omit `browserMode` or use `'none'` for no opener,
use `'background'` for macOS `open -g` with a portable ordinary-opener fallback
elsewhere, and use `'foreground'` for the ordinary platform opener. The legacy
Expand Down
17 changes: 13 additions & 4 deletions plugins/pardes-pi/docs/NORTH_STAR.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,19 @@ append-only audit history
Pi presentation delivery scheduled for the manager conversation
```

Actionable events enter the durable inbox before presentation. Tokenized wake
records are presentation cursors, not workflow state. Only one delivered cursor
is active at a time; later durable rows remain queued as a suffix. User-judgment
handoffs are explicit and cursor-scoped.
Actionable events enter the durable inbox before presentation. Causally
derivative software context may be coalesced onto its triggering row: a terminal
worker report that invalidates advisory verification evidence carries that stale
context without a second attention row, while both facts remain externally
visible. Durable exact-event intents idempotently repair either audit append
across failure or manager restart before presentation refinement is released.
Malformed event-log bytes are preserved in a manager-scoped corruption artifact;
all parseable records are retained in a repaired active stream, and bounded
storage status distinguishes trailing fragments from interior corruption. Thus
both facts remain append-only audited. Tokenized wake records are presentation cursors,
not workflow state. Only one delivered cursor is active at a time; later durable
rows remain queued as a suffix. User-judgment handoffs are explicit and
cursor-scoped.

## Retained child model

Expand Down
51 changes: 51 additions & 0 deletions plugins/pardes-pi/extensions/pardes/manager/attention.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
pullRequestNeedsAttention,
} from './attention.ts';
import type { AgentRecord, PullRequestObservation, PullRequestRecord } from './domain.ts';
import { conflictAttentionTransition } from './review-gate-lifecycle.ts';

const createdAt = '2026-06-01T00:00:00.000Z';

Expand Down Expand Up @@ -152,6 +153,56 @@ describe('manager attention predicates', () => {
expect(pullRequestNeedsAttention(healthy)).toBe(false);
});

test('supersedes an older conflict key after complete mergeability and rearms on later conflict', () => {
const headA = 'a'.repeat(40);
const headB = 'b'.repeat(40);
for (const current of [
{ headSha: headB, lifecycleGeneration: 1 },
{ headSha: headA, lifecycleGeneration: 2 },
]) {
const owner = agent({ lifecycleGeneration: current.lifecycleGeneration });
const gate = pullRequest('open', {
conflictAttention: {
attentionObservedForKey: true,
auditedHeadSha: headA,
generation: 1,
ownerLifecycleGeneration: 1,
phase: 'conflicting',
},
lastPushedHeadSha: current.headSha,
});

const first = conflictAttentionTransition(gate, owner, observation(), true);
expect(first).toMatchObject({
attention: false,
next: {
attentionObservedForKey: false,
auditedHeadSha: current.headSha,
generation: 1,
ownerLifecycleGeneration: current.lifecycleGeneration,
phase: 'resolution_candidate',
},
});
const second = conflictAttentionTransition(
{ ...gate, conflictAttention: first.next },
owner,
observation(),
true,
);
expect(second).toMatchObject({ attention: false, next: { phase: 'resolved' } });
const reappeared = conflictAttentionTransition(
{ ...gate, conflictAttention: second.next },
owner,
observation({ mergeable: 'conflicting' }),
true,
);
expect(reappeared).toMatchObject({
attention: true,
next: { attentionObservedForKey: true, generation: 2, phase: 'conflicting' },
});
}
});

test('does not count terminal pull-request metadata warnings as open-review attention', () => {
for (const status of ['merged', 'closed'] as const) {
const terminal = pullRequest(status, { observation: observation({ ci: 'failing', status }) });
Expand Down
2 changes: 2 additions & 0 deletions plugins/pardes-pi/extensions/pardes/manager/attention.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ export function hasPullRequestWarningMetadata(pullRequest: PullRequestRecord): b
pullRequest.discussionPaginationGaps?.length ||
pullRequest.observation?.ci === 'failing' ||
pullRequest.observation?.mergeable === 'conflicting' ||
(pullRequest.conflictAttention !== undefined &&
pullRequest.conflictAttention.phase !== 'resolved') ||
pullRequest.observation?.reviewDecision === 'changes_requested',
);
}
Expand Down
Loading
Loading