Skip to content

feat(immune): Evidence Pack increment 2 -- cited-task existence join (opt-in, inert) [D-146] - #1514

Merged
DealAppSeo merged 1 commit into
mainfrom
claude/2026-11-04-evidence-pack-task-join
Nov 4, 2026
Merged

DealAppSeo merged 1 commit into
mainfrom
claude/2026-11-04-evidence-pack-task-join

Conversation

@DealAppSeo

Copy link
Copy Markdown
Owner

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-only trinity_tasks query and passes in the resolved existing / done id sets, exactly as it passes the rows. Two new tripwires when taskEvidence is supplied:

  • cited_task_exists — every row citing trinity_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-null result and 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 is result IS NOT NULL (loadKnownAnswerRows filters on that, never status). A status='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 citedTaskId parser): happy join, a cited task that doesn't exist, a cited task that exists but isn't done, and back-compat (no taskEvidence ⇒ null + no new invariants).

🤖 Generated with Claude Code

…(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

strix-security Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

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 summary

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.

Review 1 on this PR · cca6ea7 · requested Nov 4 23:21 UTC when the PR was opened


Reviewed by Strix
Re-run review · Configure security review settings

@DealAppSeo
DealAppSeo enabled auto-merge (squash) November 4, 2026 23:22

@strix-security strix-security 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.

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

@DealAppSeo
DealAppSeo merged commit 325900e into main Nov 4, 2026
18 checks passed
@DealAppSeo
DealAppSeo deleted the claude/2026-11-04-evidence-pack-task-join branch November 4, 2026 23:26
DealAppSeo added a commit that referenced this pull request Nov 5, 2026
…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>
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