Repository navigation
feat(immune): Evidence Pack increment 2 -- cited-task existence join (opt-in, inert) [D-146] - #1514
Conversation
…(opt-in, inert) [D-146] Extends the pure evidence-pack reducer with an OPT-IN task-existence cross-join: when the caller passes taskEvidence (the existing/done trinity_tasks id sets it resolved read-only), two new tripwires gate the pack -- cited_task_exists (every row citing trinity_tasks:<id> resolves to a real task row) and cited_task_verified_done (that task is done by the caller's bar). The reducer stays pure; omit taskEvidence and behaviour is unchanged (increment 1). Verified live [V 2026-11-04]: 656 rows cite 330 distinct tasks; all 330 exist, all 330 status='done' with a result and known-answer lineage -> both invariants hold, 0 missing / 0 not-done. (status='completed'=0 is a lifecycle-literal nuance: these are 'done', and the code's done-bar is result-not-null, not status.) 14/14 jest (increment 1 + 2). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Strix Security Review✅ No open security findings. PR summary: Increment 2 of the Evidence Pack adds an opt-in, caller-fed cross-join that verifies each `trinity_tasks:<id>` cited by an experimental row resolves to a real and done task, emitting two new tripwire invariants. The reducer stays pure and inert: omitting the new `taskEvidence` argument preserves increment-1 behaviour exactly. Review summaryI reviewed both changed files in full — the pure Review 1 on this PR · Reviewed by Strix |
There was a problem hiding this comment.
I reviewed both changed files in full — the pure evidencePack reducer and its jest suite. The change adds an optional taskEvidence parameter, a citedTaskId parser, and two conditional invariants to a function that performs no I/O, touches no database, reads no live state, and has no production caller anywhere in the repository (only its own tests reference it). Data flowing through it is caller-supplied rows and id sets, not request input, and nothing in the diff removed an authentication, authorization, or validation control. The regex /^trinity_tasks:(.+)$/ is linear with no backtracking risk, and no string from the diff reaches a query, shell, file path, redirect, or HTML sink. I found no security issue introduced by this PR.
Reviewed by Strix
Configure security review settings
…ck (inert signal) (#1515) Red-team of the merged increment-2 join (#1514) found a no-silent-failure gap: when rows cite trinity_tasks:<id> but the caller omits taskEvidence, the existence/done join never runs yet the pack still returns ok=true -- a skipped check reading as a pass (r10 / THE_ONE §10). All 656 live rows are task citations [V 2026-11-04], so it is 100% applicable. Fix (pure, inert, zero scoring-path callers): a NON-GATING signal 'task_existence_check_skipped' (detail {citing_rows, cited_tasks}) whenever rows cite tasks but no taskEvidence was supplied. ok is unchanged -- the opt-in is intentional; this is the tripwire for when a task-bearing caller forgets it, and it is distinct from the cited_task_exists invariant (check RAN and FAILED). 17/17 jest green. Grok co-signed (D-054 concur). Flagged-not-changed: binding deliverable_sha256 into the Lane A signed receipt (Sean MAJOR) and an opaque- evidence_id shape check (theoretical -- 0 live rows). Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
What
Increment 2 of the Evidence Pack (D-130 / D-141 #1510): cross-join each cited
trinity_tasks:<id>to real task state, so "656 experimental rows" is defensible as "656 deltas grounded in tasks that actually exist and were done" — not just that a task is cited.Opt-in, reducer stays pure.
evidencePack(rows, taskEvidence?)— the caller runs the read-onlytrinity_tasksquery and passes in the resolvedexisting/doneid sets, exactly as it passes the rows. Two new tripwires whentaskEvidenceis supplied:cited_task_exists— every row citingtrinity_tasks:<id>resolves to a real task row.cited_task_verified_done— that task is verified done by the caller's bar (doneBar).Omit
taskEvidence→ behaviour is identical to increment 1 (citedTasks: null, no new invariants). No live state touched; writes nothing.Verified live [V 2026-11-04, read-only]
656 rows cite 330 distinct tasks; all 330 exist, all 330 are
status='done'with a non-nullresultand known-answer lineage → both invariants hold,citedTasks = {cited:330, existing:330, done:330, missingRows:0, notDoneRows:0},ok:true.Done-bar nuance (enumerated, not assumed):
status='completed'is 0 for these — the lifecycle marks them'done', and the code's own done-bar isresult IS NOT NULL(loadKnownAnswerRowsfilters on that, never status). Astatus='completed'literal would false-alarm on all 330; the reducer records the caller's bar on the invariant.Tests
14/14 jest (increment 1 unchanged + 4 new increment-2 cases + the
citedTaskIdparser): happy join, a cited task that doesn't exist, a cited task that exists but isn't done, and back-compat (notaskEvidence⇒ null + no new invariants).🤖 Generated with Claude Code