Skip to content

feat(cognition): add threat detector contract - #1347

Merged
joelteply merged 1 commit into
canaryfrom
feat/threat-detector-pr1
May 16, 2026
Merged

joelteply merged 1 commit into
canaryfrom
feat/threat-detector-pr1

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Summary

  • add the Rust threat-detector contract for cognition frames, detector signals, reports, and adversarial decline records
  • add a pluggable detector registry that preserves all detector signals and ranks by severity/confidence without assigning a single runtime turn
  • export the generated TS wire types and repair the cognition barrel drift found by the sync test

Notes

  • MODULE-CATALOG threat-detector PR-1: pure contract/composition slice only; runtime subscriptions, audit recording, and activity wiring should land as follow-up PRs
  • invalid detector confidence is rejected, not clamped or normalized silently
  • clean reports cannot fabricate decline records

Test plan

  • cargo test --lib --features metal,accelerate cognition::threat_detector:: => 16 passed
  • cargo test --test generated_barrel_sync --features metal,accelerate => 8 passed
  • precommit: TypeScript clean; Rust clippy baseline held; browser tests skipped because local jtag/core socket prerequisites were not running
  • pre-push: TypeScript clean, ESLint ratchet held, Rust compile clean, Rust tests passed, native arm64 image push completed

@joelteply
joelteply merged commit 048ea24 into canary May 16, 2026
4 checks passed
@joelteply
joelteply deleted the feat/threat-detector-pr1 branch May 16, 2026 22:50
joelteply added a commit that referenced this pull request Sep 4, 2026
… not the repo CWD (#3697)

`continuum reboot` on current airc dies at boot with:

    airc: refusing to serve a socket this scope does not own.
      --home  <repo>/.airc
      --socket ~/.airc/runtime/airc-machine-*.sock

and the core comes up with "no transport: no rooms, no resident citizens".
Measured on the 5090 node 2026-09-04, first boot after the Windows build
unlock.

Root cause: `boot_plan.rs::step_airc_daemon` runs `airc daemon` with no home
and the CONTINUUM REPO as CWD. airc derives scope from the working directory,
so the daemon presents the repo-scope identity to the machine-account socket
— and airc's ownership guard (their #1347/#1352/#1353 family) rightly refuses
it: a daemon under a foreign identity hands every caller the wrong peer_id,
the wrong rooms, and the wrong advertised endpoint.

This is the THIRD spawn-site instance of that bug class. airc ended it
internally by making the owning-home a newtype the spawn API requires — a
compile error instead of a night of debugging. This call site lives outside
airc where the type cannot reach, so the rule is enforced the only way
available here: spawn with CWD = the OS home dir, which IS the home that owns
the socket.

When neither USERPROFILE nor HOME resolves, boot now refuses to spawn at all,
loudly — a daemon under the wrong identity is strictly worse than no daemon,
and the old behavior was to create exactly that on every fresh checkout.

Validated locally (first box able to): cargo check -p continuum-core --lib
clean; the failing reboot is the reproduction and the next reboot on this
node runs this fix.


Claude-Session: https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
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