Task — engineering-spec@1

"BRAIN Phase 0 consent completion"

doneTASK-IMP-061
module improvement · class product · priority p0 · created 2026-07-08 · shipped null
depends on none · blocks none

TASK-IMP-061: BRAIN Phase 0 consent completion

Summary

Layer-1 BRAIN already declares consent on personnel memories (PERSON template, gateguard checklist, audit consent_event_id, fixture 21), but the protocol has no normative consent section, no consent-record store path, no walker invariant, and the install payload can vendor the thin root AGENTS.md into .cyberos/memory/AGENTS.md instead of the dense Layer-1 protocol. This task completes Phase 0 for the agent BRAIN (markdown store): protocol §19, meta/consent/ scaffolding, personnel-requires-consent invariant + tests, and a build fix so the protocol (including §19) actually ships.

Problem

Deep-audit Stage 5 and the brain-evaluation plan both order governance before capture. For the product BRAIN/EVAL path that means TASK-EVAL-001 notice + acknowledgment (and counsel clearance of docs/legal/data-monitoring-and-evaluation-notice.md). That product path is not this task: Track C (IMP-066) is closed won't-do for 1.x, and EVAL-001 remains on_hold.

For the Layer-1 agent BRAIN the gap is smaller and already named in-tree: fixture 21 says "validator currently doesn't enforce consent". PERSON writes require a consent event id, but there is no CONSENT template, no meta/consent/ home, no cyberos doctor check, and no AGENTS.md clause. Agents can invent has_consent: true with a null event and stay doctor-green. Separately, build.sh materialises root thin AGENTS.md into the payload memory tree, so even a correct protocol update may not reach consumer installs.

Proposed Solution

  1. Add AGENTS.md §19 (Phase 0 consent) — personnel-classified / person-kind memories MUST carry consent.has_consent: true and a non-null consent.consent_event that resolves to meta/consent/<id>.md (or a matching audit row id).
  2. Scaffold consent records under meta/consent/ (starter README + CONSENT.md template); install creates the directory on fresh BRAIN scaffold.
  3. Add walker invariant personnel-requires-consent (error level) + pytest coverage for pass/fail/resolve paths.
  4. Flip fixture 21's expected critical code to personnel-requires-consent (forward-compat corpus + generator comment).
  5. Fix build.sh to materialise modules/memory/cyberos/data/AGENTS.md into $out/memory/AGENTS.md (IMP-138 Branch A normative home).
  6. Document explicit non-goals: counsel clearance of the employment monitoring notice; EVAL-001 / capture activation; Track C rollout.

Alternatives Considered

Success Metrics

Scope

In scope: Layer-1 protocol AGENTS.md §19; consent templates + starter/install scaffolding; invariant + tests; fixture 21 expectation; build.sh AGENTS vendor path; task lifecycle + batch evidence.

Out of scope / Non-Goals:

Dependencies

None blocking. Related: EVAL-001 (product gate, separate), IMP-138 (Branch A already decided; this task finishes the build vendor path for the protocol file), IMP-066 (closed; depended on this task for Track C which will not ship in 1.x).

AI Authorship Disclosure

1. Description (BCP-14 normative)

Acceptance criteria

Verification

  1. cd modules/memory && PYTHONPATH=cyberos:../.. pytest tests/test_personnel_consent.py -q
  2. bash tools/install/build.sh (or repo equivalent) and grep -n '§19' dist/cyberos/memory/AGENTS.md
  3. Manual: construct temp store with personnel md lacking consent → python -c 'from cyberos.core.invariants import check_personnel_requires_consent; ...' returns failed.

Edge cases

CaseExpected
No memories/ yetPass (nothing to gate)
Operational classification, no consent blockPass
has_consent: true, consent_event: nullFail
has_consent: false on personnelFail
Event id file missingFail
Event id matches meta/consent/<id>.mdPass
README.md under meta/consent/Ignored as a consent event
Product notice still DRAFTOut of scope — documented, not blocked

Failure modes

FailureDetectionMitigation
Protocol edited but thin AGENTS still vendoredAC6 grepbuild.sh path fix
Invariant yaml drift between two copiesbyte-identical check in reviewedit both / cp
Agents set has_consent without eventAC3invariant

Implementation notes