Skip to content

docs(catalog): restore Next-Modules queue + add threat-detector Implementation Sketch (catalog #2)#1384

Merged
joelteply merged 1 commit into
canaryfrom
joel/docs-threat-detector-sketch
May 18, 2026
Merged

docs(catalog): restore Next-Modules queue + add threat-detector Implementation Sketch (catalog #2)#1384
joelteply merged 1 commit into
canaryfrom
joel/docs-threat-detector-sketch

Conversation

@joelteply
Copy link
Copy Markdown
Contributor

What

Two things in one PR (both doc-only, no code):

  1. Restores the Next-Modules-To-Build queue + audit-recorder Implementation Sketch that never made it into canary. The squash-merge of docs(architecture): MODULE-CATALOG — every Continuum concern as a focused module #1336 only captured the original 31-module catalog; my two follow-up commits adding the queue + sketch were on the branch but not in the squashed tree. The implementer picked up audit-recorder anyway via my broadcast, but the catalog itself was missing the work I'd added.

  2. Adds the threat-detector Implementation Sketch — catalog Feature: Add CI/CD Configuration #2, currently unclaimed + unblocked.

Queue State After This PR

# Module Status
1 audit-recorder ✅ MERGED via #1344
2 threat-detector Unclaimed; sketch below
3 working-set-manager ✅ MERGED via PR-2/3/4/5
4 demand-aligned-recall ✅ MERGED via PR-1 through PR-3f
5 substrate-governor ✅ MERGED via PR-1 through PR-3d
6 inference-llm Unclaimed; newly unblocked
7 composer Unclaimed; newly unblocked
8 speculator Unclaimed; newly unblocked
9 reprojection-service Unclaimed; independent
10 Lane D Unclaimed; structural

Four of five original ranked items shipped over Sat→Sun. The doc-spec → code-PR pipeline worked.

threat-detector Sketch Highlights

  • ~260 LoC total for PR-1. Trait + module + first detector (PromptInjectionDetector) + 4 tokio tests. One-session work.
  • Pluggable shape enforces P4 invariant structurally. The pluggable-detector-addition test asserts that dropping a new ThreatDetector implementation produces additional ThreatDetected outcomes with no change to the substrate module — that's the architectural answer to PERSONA-COGNITION-CONTRACT P4 (evolving threat coverage).
  • PR-1 ships stateless detectors only. Memory cells (the P4 "repeat exposure produces faster recognition") deferred to PR-2.
  • Unblocks the cognition Decline-AdversarialPattern path. Currently the audit-recorder has a dead subscription to ThreatDetected with no producer.

Closing Note

The audit-recorder sketch shipped its code as #1344 even though the sketch wasn't on canary — proving that the broadcast-as-coordination + the sketch-as-spec works end-to-end. With this PR, the threat-detector spec is on canary so the next implementer doesn't have to fish it out of session history.

…mentation Sketch

The 'Next Modules To Build' section + the audit-recorder Implementation
Sketch I added in two follow-up commits on the original MODULE-CATALOG
branch never made it to canary — the squash-merge of #1336 only
captured the first commit (the initial 31-module catalog). Confirmed
by checking the merged tree: catalog has Sections I-X but no
queue + no per-module Implementation Sketch.

This PR:

1. RESTORES the Next-Modules queue (now with checkmarks reflecting
   what's shipped):
   - #1 audit-recorder MERGED via #1344
   - #2 threat-detector unclaimed, ready (Implementation Sketch below)
   - #3 working-set-manager MERGED end-to-end via PR-2/3/4/5
   - #4 demand-aligned-recall MERGED end-to-end via PR-1 through PR-3f
   - #5 substrate-governor MERGED end-to-end via PR-1 through PR-3d
   plus newly unblocked next-tier: inference-llm, composer,
   speculator, reprojection-service, Lane D persona runtime frame.

2. INCLUDES the audit-recorder Implementation Sketch for reference
   (it's what the implementer copied from to produce #1344, even
   though it wasn't on canary at the time — they got it from the
   broadcast).

3. ADDS the threat-detector Implementation Sketch — catalog #2,
   next-up. ~260 LoC total for PR-1:
   - ThreatDetector trait (async inspect → Option<ThreatEvidence>)
   - ThreatDetectorModule that wakes on every RuntimeFrame and runs
     each registered detector
   - PromptInjectionDetector as the first ships-with-PR-1 detector
     (role-override patterns + length-attack heuristic)
   - 4 tokio tests covering: empty-list base case, role-override
     fires correctly, benign chat doesn't fire, pluggable-addition
     test that enforces P4 (evolving threat coverage) structurally
   - Memory cells deferred to PR-2; PR-1 ships stateless detectors

   This pluggable shape is the architectural answer to invariant P4
   from PERSONA-COGNITION-CONTRACT: new threat patterns land as
   follow-up PRs adding a single ~50 LoC detector implementation
   with no changes to the substrate module itself.

4. NAMES what threat-detector unblocks downstream:
   - P4 invariant test (currently has no producer)
   - The PersonaDecision::Decline { AdversarialPattern } cognition path
   - audit-recorder's ThreatDetected subscription (currently dead;
     no producer until threat-detector ships)

Doc-only change. No code touched. The Implementation Sketch is
copy-pastable as the starting point for the next implementer.
@joelteply joelteply merged commit 9174109 into canary May 18, 2026
2 checks passed
@joelteply joelteply deleted the joel/docs-threat-detector-sketch branch May 18, 2026 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant