Commit Graph
2 Commits
Author SHA1 Message Date
james.maesandClaude Opus 4.7 5120a27b05 refactor(08-reviews): fold cross-AI suggestions into hardening substrate
Seven targeted fixes from the gemini / qwen3 / gemma4 cross-AI reviews of
Phase 8. Risk LOW per all three reviewers; these were ranked as 1.x
candidates rather than ship-blockers, so each is a forward-compatible
extension of an existing surface, not a behavioural change.

  1. Corpora/injection/manifest.json — add manifest_version=1; loader
     surfaces it via loadFromBundleWithVersion(); jarvis-eval prints
     "manifest_version=N" alongside the corpus count so each gate run
     records which corpus was exercised. (Gemma4 #3)

  2. MCPCrashRunner.swift — inline comments on each FD-whitelist pattern
     explaining why it persists across helper restarts (PIPE / FIFO /
     systm / KQUEUE / unix / /tmp/jarvis- / -wal / -shm). Future
     contributors won't accidentally tighten the whitelist. (Gemma4 #4)

  3. DriftReport.swift / DriftClassifier.swift — DriftItem now carries a
     `reason` string ("alwaysExcluded membership",
     "nondeterministicUnderSampling@temperature=0.7", etc.) so growth of
     the exclusion set is visible at every gate run. (Gemma4 #5)

  4. .planning/phases/03-hud/checklist.yaml — new P3-09 grep_positive
     guard asserting JarvisHUDPanel.swift sets `self.level` to one of
     statusBar/mainMenu/screenSaver/popUpMenu (occlusion regression
     guard). (Gemini #6)

  5. scripts/check-corpus-secrets.sh — extends the D-07 pre-commit hook
     to scan .replay / .evaluation / .sqlite session files. Uses
     `sqlite3` when available (queries events.tool_* rows directly) and
     falls back to plain grep on the binary blob otherwise. (Gemini #7)

  6. WakeHysteresisRunner.swift / main.swift — splits the single
     "passed" verdict into `pipelineStatus` (ok / notWired) and
     `performanceStatus` (pending / pass / warn / fail). Synthetic-only
     corpora always report PERFORMANCE: PENDING so an operator never
     mistakes a TTS-seed pass for a real-voice pass.
     (Gemini + Gemma4 #2)

  7. ReplayMCPAdapter.swift — substrate for side-effect-marker
     verification. Recorded `tool_result_full` envelopes may now carry
     an optional `side_effects: [String]` array; new public APIs
     `recordedSideEffects(toolUseId:)` and `sideEffectDelta(toolUseId:
     liveMarkers:)` let callers compare live vs recorded markers,
     mitigating the byte-equal false-green risk. Helper-side emission
     remains a follow-up. (Gemini #1, MEDIUM)

Tests: 63/63 across 9 Harness suites (3 new — manifest version exposure,
sampling-reason carries temperature, synthetic-corpus detection).
Build: clean.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-01 05:35:17 -05:00
james.maesandClaude Opus 4.7 268878b29d feat(08-04): shipping-gate + promote-replay + secret guard + R4-L7 integration test (Task 3)
Ships the four shell scripts the sweep manifest references plus the R4-L7
contract test that 08-01's threat model deferred (T-08-05).

Scripts:
- scripts/shipping-gate.sh: invokes the debug-built jarvis-eval all
  binary; --live requires JARVIS_LIVE_EVAL=1 (D-04 dual-gate). Debug
  configuration is intentional: MCPCrashRunner consumes #if DEBUG-gated
  test seams on MCPClient/MCPServerHandle, so a release build of
  jarvis-eval would not compile.
- scripts/promote-replay-session.sh: D-09 operator helper; copies
  recorded SQLite + writes sidecar JSON with temperature / model /
  replaySchemaVersion so DriftClassifier knows whether
  nondeterministicUnderSampling exclusions apply.
- scripts/check-corpus-secrets.sh: D-07 pre-commit guard greps Corpora/
  for sk-ant-, AKIA, ghp_, sk- patterns. Verified on positive
  (planted-secret) + negative (clean Corpora) inputs.
- scripts/precommit-template.sh: committed template the operator
  symlinks to .git/hooks/pre-commit; updates flow through
  automatically. Worktree's pre-commit hook also installed at
  .git/hooks/pre-commit.

ReplaySuppressionIntegrationTests (R4-L7):
- 9 tests asserting the TurnSource suppression contract:
  .replay(sessionId:) and .evaluation(scenarioId:) both have
  dispatchesToHUD=false / speaks=false; .text and .voice (controls)
  have both true; .memoryExtraction shares the suppressed policy.
- Asserted as a contract test (not a behavioral spy) because
  CONTEXT 5.1 forbids modifying production AgentOrchestrator/bus/TTS
  to inject spies. The properties are the architectural seam the
  first consumer reads; the test locks the policy table.

jarvis-eval `all` cross-subcommand dispatch refactored from direct
.init()+property assignment to .parse(argv) — the property-wrapper
backing storage of @Flag/@Option requires the parser path; direct init
trips the "Can't read a value from a parsable argument definition"
guard.

Shipping-gate.sh end-to-end smoke (recorded for SUMMARY):
- checklist: PASS (with manual coverage on 06-voice + 1 on 01-foundations)
- corpus-injection: PASS
- corpus-sse: PASS
- corpus-ndjson: PASS
- cap-recovery: PASS
- audio-rebuild: PASS (4/4 triggers automated)
- wake-corpus: FAIL (empty corpus — operator-recorded WAVs deferred)
- mcp-crash: FAIL (MockHelper fixture path resolution; pre-existing
  08-03 issue with packages/packages/ duplication)
- corpus-ndjson-live: SKIPPED (--live not set)
- 8-hardening checklist: PASS (15/15 items)

The infrastructure-failure-free run is the success criterion; the two
downstream failures (wake-corpus + mcp-crash) trace back to 08-02 and
08-03 respectively and are not Task 3 bugs.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-30 10:34:27 -05:00