Skip to content

FE-1187: Walkthrough remediation sweep 3 — impact ledger, ask hardening, legacy read retirement#331

Merged
lunelson merged 70 commits into
nextfrom
ln/fe-1187-remediation-3
Jul 16, 2026
Merged

FE-1187: Walkthrough remediation sweep 3 — impact ledger, ask hardening, legacy read retirement#331
lunelson merged 70 commits into
nextfrom
ln/fe-1187-remediation-3

Conversation

@lunelson

@lunelson lunelson commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Stack context

Third FE-1187 walkthrough-remediation sweep, stacked on FE-1196's Group 2 platform debt (#327). Its center of gravity is the ingest review-set Impact Ledger renderer plus ask/exchange hardening, and it retires the legacy question read paths deferred from #327.

What changed

  • Impact Ledger renderer (D131-L): absorbs the ~744-line review-set dev prototype into a real component (src/.pi/components/exchange-review-set-result.ts), backed by a differential oracle across result variants, a content-variant preview gallery, witnessed fixtures, and a wrap-tolerant render-honesty helper.
  • Atomic review-set settlement: converges the accept/settle path into src/session/review-set-settlement.ts with a settlement-convergence proof, slims rpc/methods/session.ts, and preserves graph diagnostics through settlement.
  • Ask/exchange hardening: unified ask param parsing; questionnaire submission parsing and its discriminator centralized in exchanges/schemas/questionnaire.ts; live asks now require AbortSignals; duplicate headless multi-select answers rejected; persisted questionnaire completion validated.
  • Cancellation UX: cancelled exchanges self-describe, standalone ask cancellation is guided, cancellation guidance is transient with a canonicalized terminal, and the continuation-picker pretext is elided.
  • Digest questionnaire lifecycle: capture tracer completes the lifecycle and recognizes/closes accepted and answered legacy digest reviews.
  • Workspace launch/population: requires complete workspace launch state and derives population from the complete cwd inventory (cwd-inventory.ts).
  • Diagnostics: sweep-debt tripwire probe (src/probes/sweep-debt-tripwire.ts) judging the latest closed sweep interval with strict option parsing and pinned malformed-JSONL diagnostics; /introspect output made deterministic and array-safe; physical JSONL source lines preserved in transcript handling.
  • Retirements: legacy question read paths (structured-exchange-loop/pending-exchange trimmed — the deferred leaf-5 retirement from FE-1196: Group 2 platform debt — spec posture, DB identity, headless asks, reconciliation derivation #327); over-broad public-RPC candidate proof assertions (~158 lines); proposal-audit identifier.
  • Docs/canonical: impact-ledger decision reassigned D127-L → D131-L (FE-1195 keeps D127-L) with all citations updated; ingest-review choreography settled in SPEC; docs/design/WEB_UI_ARCHITECTURE.md (part I, design-only) added; interactive-tui-driver frontier added to PLAN.

Verification

  • CI full gate (verify:full equivalent: full suite incl. slow tests + check + build) pending at time of writing; Graphite mergeability, Bugbot, dependency review, and title checks green.

🤖 Generated with Claude Code

@lunelson lunelson marked this pull request as ready for review July 14, 2026 10:46
Copilot AI review requested due to automatic review settings July 14, 2026 10:46
@cursor

cursor Bot commented Jul 14, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Touches structured-exchange answering, review-set graph commits, and session/RPC settlement—user-facing elicitation and persistence paths—plus new CI as the release gate; scope is large but aligned with an evidence-gated remediation frontier.

Overview
This sweep is the third FE-1187 walkthrough-remediation tranche: it lands the Impact Ledger review-set renderer (D131-L), one shared local/RPC review-set settlement path, and ask/exchange hardening (questionnaire parsing, live-ask abort handling, cancellation UX, continuation-picker deduplication). It also retires legacy question read paths deferred from platform debt and adds supporting probes (e.g. sweep-debt tripwire) plus walkthrough seed variants (advisory-pending, contradictory) for propose/project/review routing tests.

CI and verification: a new Test GitHub Actions workflow runs check, test:full (including slow tests), and build on every PR. AGENTS.md / CONTRIBUTING.md now treat local npm run verify as the fast default and CI as the authoritative full gate, with optional verify:full locally when slow-test seams change.

Docs and planning: docs/design/WEB_UI_ARCHITECTURE.md supersedes the older session-host notes; REVIEW_SETS and STRUCTURED_EXCHANGE_ANSWERING_PATHS document atomic settlement and mode-complete headless asks. PLAN is trimmed (Later items archived), adds interactive-tui-driver and graph-assurance-conduct frontiers, and records FE-1187 built vs remaining routes. ln-execute gains memory/REFACTOR.md execution semantics (commit items as serial cards, no ln-scope translation). Fixture seeds rename plan slice → scope/frontier vocabulary where needed.

Reviewed by Cursor Bugbot for commit e9d771b. Bugbot is set up for automated code reviews on this repo. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 9f6a59e. Configure here.

Comment thread src/probes/sweep-debt-tripwire.ts

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR makes “cancelled” structured exchanges self-describing and easier to interpret (for both humans and the agent), while also adding a CLI “tripwire” probe to detect capture-sweep debt in session JSONL and improving dev-mode /introspect legibility.

Changes:

  • Canonicalize cancellation rendering via a shared CANCELLED_TERMINAL string and update formatters/tests/snapshots accordingly.
  • Add a sweep-debt tripwire probe (src/probes/sweep-debt-tripwire.ts) with strict CLI argument parsing and comprehensive Vitest coverage.
  • Improve Pi dev-mode introspection output (top-level field summaries + actionable mirror pointer) and add standalone ask cancellation status guidance in the Pi exchange extension.

Reviewed changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/probes/sweep-debt-tripwire.ts New CLI/library probe to assess sweep debt from session JSONL.
src/probes/tests/sweep-debt-tripwire.test.ts Tests for sweep-debt assessment, JSONL parsing diagnostics, and CLI exit behavior.
src/probes/tests/structured-exchange-ordering-proof.test.ts Updates ordering proof to include the new ui:setStatus event.
src/agents/contexts/exchanges/request-response/review.ts Uses canonical cancellation terminal for request-review rendering.
src/agents/contexts/exchanges/request-response/choices.ts Uses canonical cancellation terminal for request-choices rendering.
src/agents/contexts/exchanges/request-response/choice.ts Uses canonical cancellation terminal for request-choice rendering.
src/agents/contexts/exchanges/request-response/answer.ts Uses canonical cancellation terminal for request-answer rendering.
src/agents/contexts/exchanges/option-echo.ts Introduces CANCELLED_TERMINAL shared cancellation terminal text.
src/agents/contexts/exchanges/ask.ts Renders ask cancellation via CANCELLED_TERMINAL and elides cancelled.message.
src/agents/contexts/exchanges/tests/request-response.test.ts Asserts all request-response cancellations render as the canonical terminal.
src/agents/contexts/exchanges/tests/ask.test.ts Asserts ask cancellation uses canonical terminal (and not trailing italic).
src/agents/contexts/exchanges/snapshots/review-set-tuples.md Snapshot updates reflecting canonical cancellation terminal text.
src/agents/contexts/exchanges/snapshots/question-tuples.md Snapshot updates reflecting canonical cancellation terminal text.
src/agents/contexts/exchanges/snapshots/digest-tuples.md Snapshot updates reflecting canonical cancellation terminal text.
src/agents/contexts/exchanges/snapshots/ask-tuples.md Snapshot updates reflecting canonical cancellation terminal text.
src/.pi/extensions/exchanges/TOPOLOGY.md Documents revised standalone cancellation guidance and lifecycle.
src/.pi/extensions/exchanges/ask.ts Sets/clears a brunch.ask status hint on standalone cancellation/answer.
src/.pi/extensions/dev-mode/introspection/TOPOLOGY.md Documents more actionable /introspect output (field-level + mirror pointer).
src/.pi/extensions/dev-mode/introspection/index.ts Implements top-level summarization + conditional mirror pointer output.
src/.pi/extensions/tests/exchanges-present-request.test.ts Verifies standalone cancellation sets status hint and clears on next answer.
src/.pi/extensions/tests/dev-mode-introspection.test.ts Tests new /introspect output shape and mirror pointer gating.
memory/PLAN.md Updates progress tracking and execution pointer for FE-1187 remediation tranche.
memory/cards/walkthrough-remediation-2--consolidated-outer-checkpoint.md Adds a human-gated consolidated checkpoint card for outer verification.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/probes/sweep-debt-tripwire.ts
Copilot AI review requested due to automatic review settings July 14, 2026 11:46
@lunelson lunelson force-pushed the ln/fe-1196-platform-debt branch from e72e030 to e6730fc Compare July 14, 2026 11:46
@lunelson lunelson force-pushed the ln/fe-1187-remediation-3 branch from 9f6a59e to 06cb306 Compare July 14, 2026 11:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 31 out of 38 changed files in this pull request and generated 4 comments.

Comment thread src/.pi/extensions/dev-mode/introspection/index.ts
Comment thread testing/walkthroughs/2026-07-14/remediations-3a.md Outdated
Comment thread testing/walkthroughs/2026-07-14/remediations-3a.md Outdated
Comment thread testing/walkthroughs/2026-07-14/remediations-3a.md Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 34 out of 42 changed files in this pull request and generated 4 comments.

Comment thread src/.pi/extensions/dev-mode/introspection/index.ts
Comment thread testing/walkthroughs/2026-07-14/remediations-3a.md Outdated
Comment thread testing/walkthroughs/2026-07-14/remediations-3a.md Outdated
Comment thread testing/walkthroughs/2026-07-14/remediations-3a.md Outdated
Copilot AI review requested due to automatic review settings July 14, 2026 16:30
@lunelson lunelson force-pushed the ln/fe-1196-platform-debt branch from 43e51fe to f6c38ac Compare July 14, 2026 16:30
@lunelson lunelson force-pushed the ln/fe-1187-remediation-3 branch from 9b78289 to c5c1508 Compare July 14, 2026 16:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 77 out of 85 changed files in this pull request and generated 4 comments.

Comments suppressed due to low confidence (1)

src/exchanges/schemas/shared.ts:84

  • zAskContinuationParams.options is now optional, but the schema still allows option-dependent flags (multiple, allowOther, allowNone, commentPrompt, topLabel, bottomLabel) to be set when options is absent. That makes invalid continuation declarations schema-valid and defers the failure to runtime collection/rendering.

Comment thread testing/walkthroughs/2026-07-14/remediations-3a.md Outdated
Comment thread testing/walkthroughs/2026-07-14/remediations-3a.md Outdated
Comment thread testing/walkthroughs/2026-07-14/remediations-3a.md Outdated
Comment thread testing/walkthroughs/2026-07-14/remediations-3a.md Outdated
Copilot AI review requested due to automatic review settings July 14, 2026 18:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 79 out of 87 changed files in this pull request and generated 3 comments.

Comment thread src/.pi/extensions/__tests__/exchanges-present-request.test.ts Outdated
Comment thread testing/walkthroughs/2026-07-14/remediations-3a.md Outdated
Comment thread testing/walkthroughs/2026-07-14/remediations-3a.md Outdated
Copilot AI review requested due to automatic review settings July 14, 2026 20:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 104 out of 112 changed files in this pull request and generated 3 comments.

Comment thread src/session/structured-exchange-loop/pending-exchange.ts
Comment thread src/exchanges/schemas/shared.ts Outdated
Comment thread src/.pi/components/exchange-questionnaire.ts Outdated
lunelson and others added 11 commits July 15, 2026 17:54
…ve ID collision

Two decisions allocated D127-L in parallel: FE-1195's bounded parallel
slice authority (landed on next first) and FE-1187's review/agent-facing
graph semantic grouping (this branch). Following the D111-L/D112-L and
D123-L/D126-L reassignment precedent, the later arrival becomes D131-L;
the FE-1195 decision keeps D127-L.

Updated all impact-ledger citations: the SPEC.md row, lexicon and
verification-design references, PLAN.md frontier definitions and KA
sketch, graph topology, and ONTOLOGY_REVIEW_PROTOCOL.md. A note on the
D131-L row records the reassignment; no content change to either
decision.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Lu Nelson <ln@hash.ai>
Signed-off-by: Lu Nelson <ln@hash.ai>
@lunelson lunelson force-pushed the ln/fe-1187-remediation-3 branch from ada7e30 to 3df1a4a Compare July 15, 2026 15:54
@graphite-app

graphite-app Bot commented Jul 15, 2026

Copy link
Copy Markdown

Merge activity

  • Jul 15, 3:55 PM UTC: Graphite rebased this pull request, because this pull request is set to merge when ready.

@lunelson lunelson force-pushed the ln/fe-1187-remediation-3 branch from 3df1a4a to 006e03b Compare July 15, 2026 16:12
Copilot AI review requested due to automatic review settings July 16, 2026 10:51
@lunelson lunelson changed the title FE-1187: Make cancelled exchanges self-describing FE-1187: Walkthrough remediation sweep 3 — impact ledger, ask hardening, legacy read retirement Jul 16, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 150 out of 163 changed files in this pull request and generated 2 comments.

Comment on lines +46 to +69
/** Whether cwd contains gitignore-visible product files beyond Brunch and inventory control state. */
export async function hasVisibleProductFiles(cwd: string): Promise<boolean> {
const resolvedCwd = resolve(cwd);
const shouldIgnore = await createGitignoreMatcher(resolvedCwd);
return (await countVisibleProductFiles(resolvedCwd, shouldIgnore)) > 0;
}

async function countVisibleProductFiles(
cwd: string,
shouldIgnore: (relativePath: string, isDirectory: boolean) => boolean,
): Promise<number> {
const entries = await readdir(cwd, { withFileTypes: true });
let fileCount = 0;

for (const entry of entries) {
if (entry.name === BRUNCH_DIR || entry.name === '.git' || entry.name === '.gitignore') continue;
const path = join(cwd, entry.name);
const relativePath = toRelativePath(cwd, path);
if (shouldIgnore(relativePath, entry.isDirectory())) continue;
fileCount += entry.isDirectory() ? await countVisibleFiles(path, cwd, shouldIgnore) : 1;
}

return fileCount;
}
Comment thread package.json
"release-it": "^20.2.0",
"remark-cli": "^12.0.1",
"remark-validate-links": "^13.1.0",
"table": "^6.9.0",
The unknown-run load-error test intentionally routes an error through the
route error boundary, which React logs to console.error. Scope a
console.error spy to that one test and assert the expected boundary log so
the suppression stays honest rather than muting all errors.

Co-authored-by: Cursor <cursoragent@cursor.com>
Copilot AI review requested due to automatic review settings July 16, 2026 11:34
@lunelson lunelson merged commit 13356f6 into next Jul 16, 2026
7 of 8 checks passed
@lunelson lunelson deleted the ln/fe-1187-remediation-3 branch July 16, 2026 11:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 151 out of 164 changed files in this pull request and generated 2 comments.

Comment thread package.json
Comment on lines +45 to +47
"test": "vitest --run --maxWorkers=4 --exclude='**/*.slow.test.ts'",
"test:full": "vitest --run --maxWorkers=4",
"test:slow": "vitest --run --maxWorkers=4 .slow.test.ts",
Comment on lines +63 to +70
export function projectDigestConfirmation(input: {
readonly exchangeId: string;
readonly acceptsDigest: string;
readonly acceptedAbstract: string;
readonly question: AskQuestionEcho & { readonly options: NonNullable<AskQuestionEcho['options']> };
readonly choice: SelectedChoice;
}): AskDigestConfirmationDetails {
return {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants