Skip to content

fix(agent-execution): quarantine malformed bus history and fail fan-out baseline loudly (AGT-3487) - #718

Merged
unohee merged 3 commits into
mainfrom
heewonoh/agt-3487-artifact-failsafe
Sep 20, 2026
Merged

unohee merged 3 commits into
mainfrom
heewonoh/agt-3487-artifact-failsafe

Conversation

@unohee

@unohee unohee commented Sep 20, 2026

Copy link
Copy Markdown
Collaborator

Closes AGT-3487.

What

  • AgentBus history quarantine (src/agents/agentBus.ts): getAllMessages() now shape-checks each JSON file (id/timestamp/type/sender/executionId as strings). Malformed or corrupt files are moved into a sibling quarantine/ directory (recoverable, inspectable) instead of throwing — one corrupt payload can no longer wedge the whole retrieval pass, and valid history keeps flowing.
  • Auditor/Documenter non-string guard (src/agents/auditor.ts, src/agents/documenter.ts): parse functions now reject non-string outputs explicitly (transport defect) instead of feeding them into NDJSON splitting / JSON assumptions. parseAuditorOutput / parseDocumenterOutput are exported so the contract is testable.
  • Fan-out baseline capture is fail-loud (src/agents/workerFanout.ts): when captureBaselinePatch throws (git broken, index race, FS error), fan-out now returns an explicit fallbackReason: 'baseline capture failed: …' instead of silently falling back to an empty baseline — which would have made the winner's diff base+delta and double-applied the dirty state on promotion. A genuinely clean worktree still yields an empty patch normally.

DoD mapping

  • Malformed history files are quarantined without blocking valid history
  • Auditor and documenter parse only string result payloads
  • Fan-out captures a valid baseline or uses an explicit safe fallback/failure path
  • Shared-path configuration cannot imply unsupported isolation — the existing sharedPathModeFor maps undefined → 'copy' (safe default), true → 'link', false → 'off'; link mode still goes through linkSharedPaths which never silently degrades isolation (verified by existing tests, no change needed)

Verification

  • npm run typecheck — 0 errors
  • vitest: agentBus + auditor + documenter + workerFanout suites + new artifactValidation.test.ts163 passed
  • oxlint on touched files — 0 warnings

@unohee
unohee merged commit 24f8934 into main Sep 20, 2026
7 checks passed
@unohee
unohee deleted the heewonoh/agt-3487-artifact-failsafe branch September 20, 2026 06:14
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.

1 participant