P1-02: AttentionCapsule as the real model product (closes #25) #196

Closed
conductor wants to merge 6 commits from p1-02-capsule-authority into master
pull from: p1-02-capsule-authority
Owner

Implements issue #25 per the governed pipeline.

What

  • Capsule fidelity: trace v4 additive fields — capsule_messages (the EXACT messages sent to runtime.run), capsule_content_hashes (per-block SHA-256), capsule_token_count (re-measured post safety-override decoration). The logged capsule is now provably what the model received.
  • No token_count-only fake budgeting: create_capsule/to_prompt deprecated (DeprecationWarning), zero live callers verified.
  • num_ctx: propagated as capsule.token_count + completion_reserve (not the raw window) — admission constraint respected by the runtime.
  • Safety-override re-measure: after decoration mutates the user block, block.tokens and capsule.token_count are re-measured so the capsule stays truthful.
  • ContributionBlock.to_dict includes content (was omitted, making log capsules unverifiable).
  • Authority map: attention_capsule.py flipped to retain-authority under ContextBroker.

Research round V3

  • INWARD: capsule IS broker-rendered (P0-03 did most wiring); gaps were evidence/integrity only.
  • OUTWARD: [OI] Assistants has the same estimation bug we fixed (community-reported "max_prompt_tokens exceeded, barely, consistently"); LangSmith captures at transport wrapper (I-2 follow-up); SHA-256 per-block integrity matches frontier agent-telemetry (arXiv:2608.16178); Anthropic count_tokens is the gold standard (I-1 follow-up for #29 cloud providers).
  • INNOVATION: 4 candidates evaluated; none warrant changing the shipped implementation; 2 flagged as follow-up issues.
  • SYNTHESIS: ship as-is; #28 must inherit the single num_ctx computation site and the re-measure invariant.

Governed-pipeline evidence

  • TDD red->green: 16 frozen tests; suite 604+84 (baseline 588); zero regressions.
  • Spec gate: PASS (9/9 criteria evidenced). Quality gate: Approved (1 important + 5 minor, discharges documented as follow-ups).
  • canary_p1_02 registered same-commit; henxels 0; ruff clean; pyright errors < baseline.

Closes #25.

Implements issue #25 per the governed pipeline. ## What - Capsule fidelity: trace v4 additive fields — capsule_messages (the EXACT messages sent to runtime.run), capsule_content_hashes (per-block SHA-256), capsule_token_count (re-measured post safety-override decoration). The logged capsule is now provably what the model received. - No token_count-only fake budgeting: create_capsule/to_prompt deprecated (DeprecationWarning), zero live callers verified. - num_ctx: propagated as capsule.token_count + completion_reserve (not the raw window) — admission constraint respected by the runtime. - Safety-override re-measure: after decoration mutates the user block, block.tokens and capsule.token_count are re-measured so the capsule stays truthful. - ContributionBlock.to_dict includes content (was omitted, making log capsules unverifiable). - Authority map: attention_capsule.py flipped to retain-authority under ContextBroker. ## Research round V3 - INWARD: capsule IS broker-rendered (P0-03 did most wiring); gaps were evidence/integrity only. - OUTWARD: [OI] Assistants has the same estimation bug we fixed (community-reported "max_prompt_tokens exceeded, barely, consistently"); LangSmith captures at transport wrapper (I-2 follow-up); SHA-256 per-block integrity matches frontier agent-telemetry (arXiv:2608.16178); Anthropic count_tokens is the gold standard (I-1 follow-up for #29 cloud providers). - INNOVATION: 4 candidates evaluated; none warrant changing the shipped implementation; 2 flagged as follow-up issues. - SYNTHESIS: ship as-is; #28 must inherit the single num_ctx computation site and the re-measure invariant. ## Governed-pipeline evidence - TDD red->green: 16 frozen tests; suite 604+84 (baseline 588); zero regressions. - Spec gate: PASS (9/9 criteria evidenced). Quality gate: Approved (1 important + 5 minor, discharges documented as follow-ups). - canary_p1_02 registered same-commit; henxels 0; ruff clean; pyright errors < baseline. Closes #25.
conductor added 6 commits 2026-09-07 09:05:18 +01:00
docs(p1-02): plan completion record (#25)
CI Pipeline / lint (push) Successful in 24s
Auto-label / priority-gate (pull_request) Skipped
Auto-label / auto-label (pull_request) Successful in 2s
CI Pipeline / unit-tests (push) Successful in 30s
CI Pipeline / canary (push) Successful in 25s
CI Pipeline / best-practices (push) Successful in 2s
CI Pipeline / documentation (push) Successful in 2s
CI Pipeline / type-check (push) Successful in 21s
CI Pipeline / gitea-offline (push) Successful in 13s
CI Pipeline / required-checks (push) Skipped
CI Pipeline / lint (pull_request) Successful in 23s
CI Pipeline / unit-tests (pull_request) Successful in 30s
CI Pipeline / canary (pull_request) Successful in 26s
CI Pipeline / best-practices (pull_request) Successful in 2s
CI Pipeline / documentation (pull_request) Successful in 2s
CI Pipeline / type-check (pull_request) Successful in 21s
CI Pipeline / gitea-offline (pull_request) Successful in 13s
CI Pipeline / required-checks (pull_request) Successful in 1s
461ee6a4a8
gitea-actions Bot added the bugcustodian labels 2026-09-07 09:05:27 +01:00
conductor closed this pull request 2026-09-07 09:44:05 +01:00
conductor deleted branch p1-02-capsule-authority 2026-09-07 09:44:05 +01:00

Pull request closed

This pull request cannot be reopened because the branch was deleted.
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: conductor/rune#196