[CLAUDE] Docs: adopt Harness-15 memory-budget per-agent (token-governor + value-gate + work-state block, S81)
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 5m0s

8/8 floor via engine section-G + budget.json (harness_floor/token_governor/value_protect) + session-start 2.1.5 + rules 6.6 + gate-script value-protect FLAG (runtime-fired test-specialist). Review wf_b7f3c8ac-b53 PASS/PASS/HONEST -> 2 CONCERN fixed (anchoring + tool-attribution) + refresh stale measured S71->S81. adap-report + email ai_infra body-hash bb8fb6e803ae. 0 production code, A7 217/217, detector 26-flag baseline.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
pqhuy1987
2026-06-20 22:46:17 +07:00
parent 447082fb03
commit 0bc2112952
11 changed files with 273 additions and 12 deletions

View File

@ -34,18 +34,40 @@
"autoinject_cap_bytes": 25600,
"low_watermark_ratio": 0.85,
"keep_floor_entries": 5,
"strike_threshold": 2
"strike_threshold": 2,
"value_protect": {
"_note": "Harness-15 B(b) value-gated archival (S81, 2026-06-20): keep_floor_entries protects NEWEST-n (recency/age axis); value_protect protects HIGH-VALUE entries regardless of age (value axis, orthogonal). Recurring-bug / anti-pattern / gotcha / root-cause entries STAY in L1-hot even when old -- archival cuts LOW-VALUE, NOT FIFO-by-date. This is mark RC-...10-29-11 (time/age=false-proxy) applied to the memory layer. Mechanism = CONVENTION (em-main judgement when condensing L1->L2); the patterns below are an advisory grep-hint for the DRY-RUN planner to FLAG protected entries, NOT an enforced auto-exclude (no overclaim: archive-gate stays DRY-RUN, em-main decides).",
"patterns": ["gotcha #", "anti-pattern", "recurring", "lost-update", "race", "bai hoc", "lesson", "guard", "root-cause", "silent-fail"]
}
},
"harness_floor": {
"_note": "Harness-15 A1/A3 (S81, 2026-06-20): SAN-harness = fixed per-spawn cost (NOT tunable) = tool-schema + framing + own persona/role file + lead-pasted base-doc slice + task prompt. SEPARATE HOUSE (A3 anti-double-count): persona + lead-pasted-docs belong HERE (floor), NOT counted in token_governor.l1_always (which = own agent-memory + archive index + work-state block only). MEASURED-ESTIMATE not exact (H15 honest-note b): persona = directly measured bytes (.claude/agents/<name>.md 4.3KB-13.3KB => ~1.3K-4.0K tok via /3.3); tool-schema + framing = harness-injected (cannot byte-count locally), estimated comparable to AI_INFRA same-toolset-family (Read/Write/Edit/Bash/Grep/Glob/Skill/RAG).",
"measured_token_estimate": 21000,
"rounded_up_tokens": 30000,
"components_note": "persona(measured 1.3K-4.0K, DIRECTLY via Get-ChildItem byte-count of .claude/agents/*.md, NOT via measure-agent-memory.ps1 which only sizes agent-memory tiers) + tool-schema(est ~5K) + framing(est ~2K) + lead-pasted base-slice(est ~5-9K; em-main injects CLAUDE.md/README-slice + task ctx) + prompt(est ~1K). README decision-tree corpus = 32704B but em-main pastes a SLICE, not whole. The ~21K sum is SE's OWN reasoning over SE's OWN agents (persona byte-measured + each harness-injected sub-component estimated independently); it lands NEAR AI_INFRA's ~21K because the toolset family is identical (Read/Write/Edit/Bash/Grep/Glob/Skill/RAG), NOT because borrowed. SE's governing cap = 30K (SE's own round-up), independent of AI_INFRA's figure."
},
"token_governor": {
"_note": "Harness-15 A2/B(a)/B(e) (S81, 2026-06-20): SECOND governor (token) ORTHOGONAL to the BYTE governor (tiers/archive_gate above). Keep BOTH (B(e)) -- byte measures file-size-on-disk, token measures context-loaded; independent (an agent can exceed byte-cap yet load FEWER tokens; VN text ~3.0-3.5 byte/tok so byte/4 = upper bound => real headroom LARGER). Numbers = LEAD-AUTHORITY hard-cap derived from SE byte-caps x workload (multi-module ERP => heavier budget); NO AI may re-optimize them down (B(a)). Budget = MINIMUM-to-USE floor, NOT a ceiling to dribble against: FILL L1 with real work-state up to budget; under-fill ONLY when high-value content exhausted; NEVER garbage-stuff (token-saving = forgetting work).",
"l1_always_tokens": 12000,
"l1_always_note": "own agent-memory (MEMORY.md ~8K @ 25600B/3.3) + archive _INDEX map (~2K) + work-state block (~2K). Always-loaded.",
"l2_ondemand_tokens": 6000,
"l2_ondemand_note": "archive verbatim/gist sections + skill sections. Pulled per-need, NOT always-loaded => no context-rot when unused.",
"l3_rag_tokens": 4000,
"l3_rag_note": "RAG search_memory/search_code result per query. On-demand.",
"headline_floor_plus_l1_tokens": 42000,
"headline_note": "always-present per spawn = SAN(30K) + L1(12K). L2/L3 expand only on-demand (no always-cost)."
},
"measured": {
"cicd-monitor": { "l1_hot": 23653, "l2_verbatim": 178856, "l2_index": 16779, "l2_gist": 29737, "rollout": "done" },
"investigator-codebase": { "l1_hot": 23187, "l2_verbatim": 68612, "l2_index": 9234, "l2_gist": 27297, "rollout": "done (re-curated S71: moved 3 oldest, gist gen:2)" },
"reviewer": { "l1_hot": 24844, "l2_verbatim": 54901, "l2_index": 7370, "l2_gist": 19114, "rollout": "done (re-curated S71: moved 10 oldest, gist gen:2)" },
"implementer-backend": { "l1_hot": 17692, "l2_verbatim": 59233, "l2_index": 10105, "l2_gist": 23079, "rollout": "done" },
"frontend-designer": { "l1_hot": 24004, "l2_verbatim": 0, "l2_index": 0, "l2_gist": 0, "rollout": "n/a (no archive; watch L1 near cap)" },
"test-specialist": { "l1_hot": 23919, "l2_verbatim": 0, "l2_index": 0, "l2_gist": 0, "rollout": "n/a (no archive; watch L1 near cap)" },
"_note": "S81 2026-06-20 FRESH re-measure (scripts/measure-agent-memory.ps1) post-S80 curate. Supersedes stale S71-seeded values. byte-governor snapshot (l1_hot = file-size-on-disk); cross-check token_governor for the orthogonal token-thread.",
"cicd-monitor": { "l1_hot": 12227, "l2_verbatim": 194964, "l2_index": 17626, "l2_gist": 29737, "rollout": "done (re-curated S80: keep-floor-hit manual condense, ~3 huge run-records -> archive)" },
"investigator-codebase": { "l1_hot": 10281, "l2_verbatim": 102446, "l2_index": 12308, "l2_gist": 27297, "rollout": "done (re-curated S80: 15 recon entries -> archive)" },
"reviewer": { "l1_hot": 10242, "l2_verbatim": 92316, "l2_index": 10067, "l2_gist": 19114, "rollout": "done (re-curated S80: 13 war-story entries -> archive)" },
"implementer-backend": { "l1_hot": 19394, "l2_verbatim": 59233, "l2_index": 10105, "l2_gist": 23079, "rollout": "done" },
"frontend-designer": { "l1_hot": 26129, "l2_verbatim": 0, "l2_index": 0, "l2_gist": 0, "rollout": "n/a (no archive); OVER autoinject-cap 25600 (under soft-cap 30720) -- WATCH strike-1, first-overflow needs _INDEX/gist build" },
"test-specialist": { "l1_hot": 27723, "l2_verbatim": 5546, "l2_index": 0, "l2_gist": 0, "rollout": "n/a (tiny archive, no _INDEX); OVER autoinject-cap 25600 (under soft-cap) -- WATCH strike-1; value-protect FLAG fired S81 (gotcha#/guard in move-set)" },
"harvest-curator": { "l1_hot": 18952, "l2_verbatim": 0, "l2_index": 0, "l2_gist": 0, "rollout": "n/a (no archive)" },
"tooling-auditor": { "l1_hot": 18431, "l2_verbatim": 0, "l2_index": 0, "l2_gist": 0, "rollout": "n/a (no archive)" },
"implementer-frontend": { "l1_hot": 12169, "l2_verbatim": 0, "l2_index": 0, "l2_gist": 0, "rollout": "n/a (empty archive)" },
"implementer-frontend": { "l1_hot": 17386, "l2_verbatim": 0, "l2_index": 0, "l2_gist": 0, "rollout": "n/a (empty archive)" },
"investigator-api": { "l1_hot": 8510, "l2_verbatim": 0, "l2_index": 0, "l2_gist": 0, "rollout": "n/a (empty archive)" },
"database-agent": { "l1_hot": 5917, "l2_verbatim": 0, "l2_index": 0, "l2_gist": 0, "rollout": "n/a (no archive)" }
}