All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 5m25s
Ap spec-apply-hub-s145-v2 (5 axis, governance-only: 0 prod-code, 0 migration). Workflow S145 chet giua chung -> /tiep §4 relaunch-cat-gon wf_3d803740-41d 3/3 DONE. Owner-decision @S146: - session_ctx_kb = 64 TUONG-MINH (giu nguyen caveat ghost-wire: 0 reader) - session-model: scaffold IDEMPOTENT (tach cap-SO vs tao-THU-MUC) · closed.md WIRE (session-end §6.3-bis) · V2 AUTO (go cong NGUOI, GIU cong NHIP 6/15/3) Landed: C7 §N.8 predicate 4-ve · hook wal-flush.ps1 4 path (+.claude/sessions/) · San-3 tin-hieu ⑤ + ORPHAN-L · D2 KIEM end-only · §L.c completeness-gate co RANG. LIVE-VERIFY hook 4-path PASS repo THAT (da7ee8a). Session-model chay TRON VONG dau tien: pause-S146 -> resume-S146 -> ORPHAN-L can so. H24 force-fire (P=8 pause >= 1, luat auto moi): 2 vai + h24-audit -> 7 FLAG, va het: - sweep-consent sot 6 site (h24-audit.md:4 = frontmatter description) - closed.md wired-but-declared-unwired (ghost-wire CHIEU NGUOC) - owner-decision [7] BI GHI DE do tai-dung slot-index -> mat uy-quyen push 3/3 vai lane-H24 garble #53: ghi-dia-SOM cuu tron, ghi-MUON mat trang. So: orphan run-folder 3->0 · carry 14->20 (co tag [carry:*]) · +E-013 +E-014 error-ledger · +memory feedback_absence_looks_like_clean · .gitignore +lock file. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
180 lines
37 KiB
JSON
180 lines
37 KiB
JSON
{
|
|
"_note": "Harness-9 (S70, 2026-06-17) memory budget. Caps SEEDED BY MEASUREMENT (scripts/measure-agent-memory.ps1), NOT imagined headroom. Budget-audit @session-start (session-start.md §2.1.2): if curate-to-fit is dropping important markers, BUMP the relevant cap rather than cut markers. Re-measure with the script; never hand-edit measured_bytes.",
|
|
"seeded_date": "2026-06-18 (S71 re-measure after G1 curate — reviewer 36.7KB + investigator 29.8KB over-cap from S71 same-role race, curated L1->L2 back under auto-inject cap)",
|
|
"last_sleep_at": "2026-07-18",
|
|
"_last_sleep_at_note": "Harness-10b sleep-recovery (S72): timestamp lan cuoi chay /sleep-recovery-memory-l2. null = chua tung. session-start §2.1.2 + session-end §L.b(c) doc field nay -> INFORM goi-y nen L2 neu null hoac today-last_sleep_at>=7 ngay. Lead=single-writer (chi command sleep set field nay).",
|
|
"session_ctx_kb": 64,
|
|
"_session_ctx_kb_owner_set": "🔴 OWNER-SET TUONG-MINH @S146 2026-07-22 — anh chot '1 -> tuong minh' sau khi lead surface DAY DU 2 ly-do phan-bien (K6.2 muon-so-chua-do + H18 ghost-wire). Quyet-dinh cua owner co concern trong tam nhin => THUC THI, khong hoi lai. Don vi = KB; code doc PHAI nhan 1024 (khop manifest hub 101e69d6 'session_ctx_kb: 64'). Nguon so 64 = manifest hub, KHONG phai SE tu do.",
|
|
"_session_ctx_kb_honest_caveat": "🔴 KHAI THAT, DUNG doc thanh 'da wire': tinh den S146 van la GHOST-WIRE (H18 class-2 defined-but-unread) — do @S146: 0 script doc khoa nay; hit duy-nhat trong scripts/ la COMMENT o nhip-no-probe.ps1:42. Doi chung song: pull_warn_days CO reader that (nhip-no-probe.ps1:190). => Dat so nay KHONG tu-dong tao hanh-vi nao; no la CHOT-SO-TRUOC cho phan wire session-model sau. Ai wire sau PHAI: (a) doc key nay thay vi hardcode 64, (b) nhan 1024, (c) go dong nay khi da co reader that. CAM claim 'session_ctx_kb da hieu-luc' khi chua co reader.",
|
|
"distill_trigger": {
|
|
"_note": "C11 (adap dot-11, S144 2026-07-22). Owner chot O-6 = DOI trigger tu NGAY-LICH sang DEM VAT THAT (so shard chua co ban gist). Nguon: broadcast auto-toan-vong:21-27 'trigger la dem-vat-that deterministic, KHONG phai ngay-lich (lich/tuoi = proxy gia)'. Khop luon mark Active-High RC-pqhuy1987-20-06-2026-10-29-11 cua chinh SE (age/recency = FALSE-PROXY, cam kien-truc dua tren cu/lau-chua-dung/auto-decay).",
|
|
"mode": "shard_count",
|
|
"_unit_note": "🔴 HAI so duoi dem SO FILE archive/<period>.md CHUA co ban .gist.md cap doi — KHONG phai so con agent. Hub tu khai da doc nham cap so nay 1 lan NGAY TAI noi ra ban thiet-ke (3-khoan:47-53) => ten bien BAT BUOC mang don-vi '_shards', cam rut gon thanh 'min'/'bulk' tran.",
|
|
"min_pending_shards": 15,
|
|
"bulk_note_shards": 30,
|
|
"_bulk_note": "🔴 bulk_note_shards = 30 — OWNER-SET initial-anchor @S145 2026-07-22 (hub-answer adap dot-11), THAY null. Cong-thuc = 2 x min_pending_shards (2 x 15 = 30); owner chot CONG-THUC '2x' chu KHONG chot so tran, nen 30 la DAN-XUAT tu min-SE, tu-dong deo theo neu owner doi min sau nay. reference-not-copy: hub AI_INFRA co bulk RIENG = 10; SE KHONG copy 10 do (KHUNG federated = tham-khao CO-CHE tang-2, KHONG bung SO cua hub) — SE neo 30 vao CHINH nguong SE (2 x min-SE), khong vao con so 10 xa-la. 🔴 KHONG-DOI-HANH-VI-NEN: tang-2 (BAO-TO) la lop CANH-BAO THUAN-TUY nam TREN tang-1 — KHONG gate, KHONG block, KHONG doi exit-code (probe luon exit 0), KHONG doi thoi-diem tang-1 KEU (van n > min = 15). Truoc (null): khoi BAO-TO bi skip han boi guard `$null -ne $bulkShards` (distill-shard-probe.ps1:63). Sau (30): CHI THEM suffix 'BAO-TO: backlog N > 30 (van nen het, chi canh bao)' khi n > 30 — baseline 'khi nao de-xuat distill' GIU Y NGUYEN. Rang-buoc thu-tu: bulk (30) PHAI > min (15), tang-2 luon nam TREN tang-1. Toan-tu `-gt` @ distill-shard-probe.ps1:63 (KHONG phai dong 63 cua file NAY — v1 line-ref mo): boundary n=30 => tang-2 IM (30 -gt 30 = false), n=31 => 'BAO-TO 31 > 30' — cap 30/31 chung DONG-THOI `-gt` khong off-by-one VA tang-2 doc-lap tren tang-1 (tai n=30 tang-1 DA KEU tu 16, tang-2 van IM toi 31). Owner-authority (nhu min, xem _owner_set): so la quyen OWNER; 'tang dan' = owner tu nang thu-cong khi backlog thuc su lon hon; CAM AI tu-tang / auto-tune. Acceptance hanh-vi: {30 shard chua-gist, bulk=30} -> tang-2 IM (chi tang-1 KEU); {31 shard chua-gist} -> 'BAO-TO: backlog 31 > 30'.",
|
|
"_owner_set": "min_pending_shards = 15 — OWNER CHOT LAN 2 @S144 2026-07-22, THAY so 7. 🔴 Lich su day du (giu ca 2 nac, khong xoa nac 1): (a) anh noi 'lay 7 ngay di' -> lead HOI LAI vi lech don-vi -> anh chot '7 = SO SHARD'. (b) Sau do trio-memory chay: refine (E4) + audit (F3/F7, tu mo 5 file gist) chung minh 14/15 shard DA co ban nen duoi TEN GOP, 1/15 thoat bang co-che khac => 0/15 file THUC SU can nen => con so 15 la DUONG-GIA, ma nac (a) lai chot 7 DUA TREN chinh con so 15 do. (c) Anh chot lai: 'lay 15, tang dan neu them vao'. Y nghia: nguong neo VAO trang-thai hien tai (15 shard da phu) => probe IM bay gio, chi KEU khi co shard MOI that su chua phu (16+). 🔴 'Tang dan' = OWNER tu nang thu cong khi them shard da-phu; CAM AI tu-tang (so la quyen owner).",
|
|
"_residual_khai_that": "🔴 Nguong-neo-baseline co MOT diem mu KHONG duoc quen: no chi bat TANG SO LUONG, khong bat MAT DO TUOI. Audit W3 (F4) do duoc 6 cap gist stale (impl-be 2026-06 +25,7 ngay · inv-cb 2026-06 +13,2 · impl-fe 2026-H1 +12,0 · cicd 2026-06 +8,5 · reviewer 2026-07 +4,1 · reviewer 2026-06 +2,0). Cac cap nay co du twin nen probe dem chung la DA-PHU, du noi dung gist da lac hau so voi verbatim. => Truc 'tuoi' hien VAN chua co may nao do. Khai dang DU-DINH theo dung luat cua-duyet-loi-hua-may (goi-chot:52): CHUA CO MAY.",
|
|
"_dinh_nghia_shard": "🔴 SHARD = file `archive/<period>.md` CHUA co file `.gist.md` cap doi. LOAI TRU tuong minh: `_INDEX.md` (muc-luc, KHONG phai noi-dung) va moi file `*.gist.md`. Vi sao ghi ro: bo dem dau tien cua lead ra 20, trong do 5 la `_INDEX.md` => 25% duong-gia; so THAT = 15. Day la ca thu 4 cung lop 'bo loc chuoi nuot nham doi tuong' trong CUNG mot phien (Snapshot-nuot-migration · row-in-dam-bi-truot · 'bắt buộc'-bi-'bắt'-nuot · _INDEX-tinh-thanh-shard).",
|
|
"_lineage": "GIU VET, KHONG XOA (khuon auto-toan-vong:35 'dao co chu dich, chu-ky, ngay, ly do'). BAN CU = trigger ngay-lich '>= 7 ngay' o session-start.md:135 + sleep-recovery-memory-l2.md:52 ('7-ngay GIU — quyen owner cuc-bo, B1 §3.4'). DAO @S144 2026-07-22, chu-ky = anh (owner), qua HAI cua tuong minh: O-6 chon co-che (dem-shard) + tra loi thu hai chot SO (7 shard). Quyen owner o :52 KHONG bi AI dong vao — chinh owner go. KHAC BIET KY THUAT so ban cu: trigger = dem-vat-that deterministic (so file tren dia) thay vi hieu-so-ngay => khong con proxy-tuoi, khop mark Active-High RC-pqhuy1987-20-06-2026-10-29-11. Dong 7-ngay ha xuong GHI-CHU PHU (khong xoa) tai 2 file tren.",
|
|
"_acceptance": "Do HANH VI, KHONG do CHU (R3 bat ban dau dung grep 'ngay'=0 => Goodhart thuan: doi 'ngay'->'chu-ky' la xanh ma hanh vi y nguyen). Hai ca bat buoc: (1) {0 shard chua-gist, 30 ngay troi qua} -> trigger PHAI IM; (2) {3 shard chua-gist, 0 ngay} -> trigger PHAI KEU."
|
|
},
|
|
"tiers": {
|
|
"l1_hot": {
|
|
"file": "MEMORY.md",
|
|
"injected": "auto (harness injects ~first 200 lines / 25KB on spawn)",
|
|
"autoinject_cap_bytes": 25600,
|
|
"soft_cap_bytes": 30720,
|
|
"rule": "keep MEMORY.md < autoinject_cap so the WHOLE hot file injects; over soft_cap => curate L1->L2"
|
|
},
|
|
"l2_index": {
|
|
"file": "archive/_INDEX.md",
|
|
"injected": "read-on-demand map (inject the map, not the territory)",
|
|
"cap_bytes": 20480,
|
|
"seeded_from": "max measured _INDEX = cicd-monitor 16779B (+ ~22% headroom). cicd-monitor at ~82% = WATCH-agent (grows with each run); when it nears cap -> gist-of-index or split, do NOT drop markers",
|
|
"pointer_style": "substring (git-sha / Run#NNN / unique-phrase keyed), fallback Ctrl-F. NO line-hints (additive appends shift lines)"
|
|
},
|
|
"l2_verbatim": {
|
|
"file": "archive/<period>.md",
|
|
"injected": "read-on-demand content (frozen, additive-only). NO inject cap",
|
|
"rule": "NEVER rewrite existing bytes; curated L1 entries APPEND to end only"
|
|
},
|
|
"l2_gist": {
|
|
"file": "archive/<period>.gist.md",
|
|
"injected": "read-on-demand 4-field distill (distill-gen counter guards re-distill). NO inject cap",
|
|
"rule": "coverage-diff GATE: every surprise/guard/file:line/root-cause/gotcha# in verbatim must survive in gist (or marked N/A)"
|
|
}
|
|
},
|
|
"archive_gate": {
|
|
"_note": "Harness-11 PART-A (S73, 2026-06-18) params for scripts/memory-archive-gate.ps1 (DRY-RUN planner, NO-API, grep+measure only). ADDITIVE — does not touch measured/tiers/last_sleep_at. A4 hysteresis = drain to BELOW low_watermark (not just to the line). A5 = never auto-drain below keep_floor newest entries (WARN instead). A6 = only PROPOSE archive after strike_threshold consecutive over-cap runs (stateless script persists strikes in .claude/agent-memory/.archive-strikes.json).",
|
|
"autoinject_cap_bytes": 25600,
|
|
"low_watermark_ratio": 0.85,
|
|
"keep_floor_entries": 5,
|
|
"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 (D3 REC-3 2026-07-13): the planner now HARD-SKIPS value-protected LOGICAL entries (heading-only spans) from the drain-candidate pool BEFORE the size-drain, accumulating INDIVIDUAL non-contiguous low-value bytes -- value is PRIMARY, position is only a within-low-value tiebreak; a value-floor WARN fires when every drainable entry is protected. So the printed PROPOSAL is value-gated by construction, NOT FIFO-by-date (was: advisory post-hoc flag on an oldest-first prefix-cut). HONEST (no overclaim): the patterns are a 9-token grep = LOWER-BOUND signal -- paraphrase/spine entries lacking a literal token still leak, so em-main MUST value-scan the WHOLE proposed set; the hard-skip is defense-in-depth codify, NOT leak-closure. Archive-gate stays DRY-RUN (em-main = final decision).",
|
|
"patterns": ["gotcha #", "anti-pattern", "recurring", "lost-update", "race", "bai hoc", "lesson", "guard", "root-cause", "silent-fail"]
|
|
}
|
|
},
|
|
"mfe": {
|
|
"_note": "Harness-16 Memory-Fidelity-EVAL (MFE) config (S93, 2026-06-29). Read by scripts/mfe-eval.ps1 (deterministic NO-API analyzer). DISTINCT from H6.7 'memoryDelta-routing-fidelity' -- THIS = COVERAGE/RETENTION eval (does the hot-feed actually retain the must-remember set). Single-source config so the analyzer never hardcodes (B1 derived-tro-canonical). MFE READS token_governor caps (live), NEVER writes them (owner-authority floor, role_boundary_note). Branch-A judge layer = SCAFFOLD-only (numbers meaningless until sample-questions mature AND an independent cross-session judge runs).",
|
|
"denominator_sources": {
|
|
"marks": ".claude/governance/ACTIVE-MARKS.md (table rows whose Status = Active-High / Active; skip Medium / Disabled)",
|
|
"guards": "docs/governance/error-ledger.md (Active-Guards index rows Verified=check + Net not-negative; AS-table AS-N = recurring-error CLASS registry)",
|
|
"recurring_gotchas": "docs/gotchas.md (### N. headings whose heading+body carries a recurrence-token)"
|
|
},
|
|
"merge_guard_to_as": true,
|
|
"_merge_note": "true = a recurring-gotcha or guard whose AS-row references its #N (or AS-N) collapses INTO that AS class (AS = canonical class registry, deterministic by cross-reference). false = count each source separately (upper bound).",
|
|
"recurrence_tokens": ["tai phat","tai dien","tai-dien","recurrence","recurring","bug-class","bug class","extend #","cung ho","cung-ho","whack-a-mole","class s"],
|
|
"sub_denominator": {
|
|
"role_file_glob": ".claude/agents/*.md",
|
|
"diary_path_pattern": ".claude/agent-memory/<role>/MEMORY.md",
|
|
"_diary_trap_note": "READ the agent DIARY agent-memory/<role>/MEMORY.md -- NOT project CLAUDE.md NOR user memory/MEMORY.md (Harness-15-v3 duplicate-filename trap = false-positive).",
|
|
"denom_header_anchors": ["anti-pattern","split boundary","auto-refuse","boundary","NEVER"],
|
|
"content_word_min": 2,
|
|
"_match_note": "numerator = denom item present in diary by EXACT item-id OR >=2 distinct CONTENT-words (after NFD-strip-diacritics + lowercase + drop stop_list). Leading-verb-only match = false-max (broadcast: a verb-only memory scored 9/9) -- the stop_list defeats it.",
|
|
"stop_list": ["do","not","never","dont","avoid","skip","use","always","ensure","make","keep","the","a","an","of","to","and","or","is","be","when","if","khong","luon","phai","dung","cac","mot","la","va","khi","neu","read","write","edit","commit","push"]
|
|
},
|
|
"sample_questions": "eval/mfe/sample-questions.json",
|
|
"state_file": ".claude/agent-memory/.mfe-state.json",
|
|
"honest_caveats": {
|
|
"token_estimate": "char/4 is NOT real tokenization; VN-diacritic hot-memory ~3.0-3.5 byte/tok (convention -- chua do tokenizer that tai SE; dinh-chinh 58f5afd8; khi can so that: notice cat-ngan cua Read = CAN-TREN bao-toan (heuristic ky-tu/2, dem-thua ~1.4-2x KHONG co-dinh -- KHONG phai real-N/da-do) -> bao DAI [san char/4 -- tran notice], token that nam trong dai; per ban published 2026-07-15-Governance-phuong-phap-dem-token-tien-de-vong4 (content_sha256 e0bb5bbf)); report a RANGE [bytes/4 .. bytes/3.0]; FIT verdict uses bytes/3.0 (worst-case). Real tokenizer count lies inside the band -- never a single false-precise number.",
|
|
"judge_layer": "Branch-A recall/apply scorer is SCAFFOLD-only (empty). Self-grade same-session = meaningless (just read the answers). Numbers meaningful ONLY after (a) sample-questions mature in age AND (b) an independent cross-session/different-model judge scores.",
|
|
"age_band": "age is a FLAG, never a cut (mark RC-...10-29-11 age=false-proxy). An item drops only on status-change (mark->Disabled, guard->retired, AS row deleted), NOT by age.",
|
|
"read_only_scope": "MFE WRITES exactly one file: .claude/agent-memory/.mfe-state.json (its own strikes-state for cross-run Goodhart compare). 'READ-ONLY' is scoped to token_governor / the budget caps (owner-authority) which it NEVER writes -- it is NOT the claim 'writes nothing'."
|
|
}
|
|
},
|
|
"crystallized_backfill": {
|
|
"_note": "Harness-20-era (S103, 2026-07-06) crystallized-backfill = 'measure-then-fill'. Read by scripts/crystallized-backfill.ps1 (deterministic NO-API DRY planner). Adapts AI_INFRA broadcast 2026-07-04 F4 + session-cmd-budget-display Upgrade-1. DISTINCT from CRYSTALLIZATION (engine §I distill = compress-TOWARD-source, keep time-invariant): backfill goes the OPPOSITE direction = FILL the empty hot-feed budget with already-crystallized cold-tier data so the cap is not wasted. PRECONDITION: expected_backfill opens ONLY when target>0 AND measured_headroom>0. Default target=0=OFF. NOT-for-sub (sub packs are lead-curated per-task; blind-pour dilutes relevance).",
|
|
"target": 210000,
|
|
"_target_note": "OWNER-AUTHORITY static number (mirror token_governor.role_boundary_note + mark RC-...21-06...01-58-01). Default 0 = OFF/disabled. Owner raises >0 ONLY after judging a POSITIVE upper-bound (heuristic-notice) headroom exists on the stable hot-load floor. The AI (em-main) NEVER sets/auto-tunes this; the script is READ-ONLY on it. S115 (2026-07-13) OWNER-DIRECTED: target 0 -> 210000 (backfill ON). em-main executed per role_boundary_note (owner sets the number, em-main executes+reports, does NOT auto-tune down). HONEST CAVEAT surfaced to owner: measured_headroom ~253.7K tok is over the STABLE FILE-FLOOR only (UPPER BOUND); the real peak ALSO loads session-variable task-context approaching the ~368K read-set, so file-floor ~126K + 210K backfill = ~336K always-on leaves only ~44K for task-context => heavy sessions risk exceeding the 380K cap + higher context-rot (owner previously accepted near-full hot-feed, mark RC-pqhuy1987-29-06-2026-23-25-50 v4). Backfill stays DRY-PLANNER: target>0 makes crystallized-backfill.ps1 PRINT expected_backfill + source-order; it performs NO auto-pour -- actual hot-feed fill is em-main manual per-session from source_order (gist -> value-marked-archive -> curated-RAG, dedup vs hot-load).",
|
|
"hotload_sources": [
|
|
"docs/STATUS.md",
|
|
"docs/HANDOFF.md",
|
|
".claude/governance/ACTIVE-MARKS.md",
|
|
"docs/changelog/migration-todos.md",
|
|
"docs/gotchas.md",
|
|
".claude/agents/README.md"
|
|
],
|
|
"_hotload_note": "STABLE always-on FILE-FLOOR only (reproducible session-to-session). measured_headroom over this list = an UPPER BOUND on real headroom: the PEAK hot-feed ALSO loads session-VARIABLE lead-pasted task-context (task-relevant docs / code / gotcha-slices / engine-slices) that is NOT a fixed file-list, so the real peak approaches the ~368K lead read-set (token_governor.lead_note) and real headroom is SMALLER than this floor-measure shows. This is exactly broadcast F4's warning: byte/4 undercount + partial-source-list = 'illusion of room'. Hence target stays 0 until the owner judges stable room exists.",
|
|
"source_order": ["gist", "value-marked-archive", "curated-RAG"],
|
|
"_source_order_note": "value-gated, dedup vs hot-load, only TIME-INVARIANT crystallized content (NOT raw-episodic / volatile): (1) archive/<period>.gist.md 4-field distill; (2) archive lines carrying value_protect markers (gotcha# / anti-pattern / root-cause / lesson); (3) curated RAG search_memory. The PLANNER prints this order; it performs NO pull (DRY, like memory-archive-gate.ps1) - zero context change."
|
|
},
|
|
"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).",
|
|
"rounded_up_tokens": 100000,
|
|
"_owner_override_note": "S112 (2026-07-12) owner-directive: rounded_up_tokens raised 30000->100000 = OWNER-SET RESERVE (project-owner authority per token_governor.role_boundary_note + mark RC-pqhuy1987-21-06-2026-01-58-01), NOT a re-measurement (100K != a measured floor). Rationale: reserve headroom for the grown fixed per-spawn overhead (roster 11->12 agents, +office-document, +2 monitor, more MCP tool-schemas, richer lead-pasted slices at the 380K read-set). S129 (2026-07-16) owner-directive 'bo luon cac tran, chi giu tran cao nhat, thong nhat 1 cach voi hub': the parallel field measured_token_estimate RETIRED -- ONE floor number only, mirroring hub shape (hub _floor_reserve_tok = single 100000 + lineage-in-note, no stored parallel estimate; hub lineage ~21K measured -> anh-round 30K -> 60K s78 -> 100K s90). Retired-field history (verbatim archived at runs/2026-07-16-S127-adap-dot-16-07/owner-gated-proposals-dot-16-07.md disposition): S81 ~21K UNDER-COUNT -> S112 re-measure 55000 honest mid-estimate (~19K byte-measured disk-inject 57,595B + ~30-50K harness-injected est; full session-start floor band ~45-70K tok, fleet-parity ~60-71K). WHY retired: a stored 'measured/estimate' number invites the mislabel class (san-su-that 190c11ba; SE dinh-chinh 58f5afd8) -- when a real figure is needed, lay DAI TUOI [san char/4 -- tran notice-cat-ngan (can-tren ~1.4-2x khong co-dinh)] per ban published 2026-07-15-Governance-phuong-phap-dem-token-tien-de-vong4 (e0bb5bbf); CAM dan nhan real/da-do cho mot dau dai, do NOT store-and-trust. CAVEAT (honest, unchanged): harness_floor is an ACCOUNTING/AWARENESS figure (separate house, A3 anti-double-count); it is NOT actively subtracted by the current scripts (mfe-eval.ps1 / crystallized-backfill.ps1 govern via token_governor caps, not this floor). If owner wants 100K wired as an ACTIVE reserve subtracted from headroom, that is a separate change. 0 script consumers of the retired field (grep-verified S127 + S129).",
|
|
"components_note": "floor COMPONENT LIST (what the fixed per-spawn cost consists of): persona (directly byte-measurable via Get-ChildItem .claude/agents/<name>.md 4.3KB-13.3KB => ~1.3K-4.0K tok; NOT via measure-agent-memory.ps1 which only sizes agent-memory tiers) + tool-schema + framing + lead-pasted base-slice (README decision-tree corpus = 32704B but em-main pastes a SLICE, not whole) + prompt -- the harness-injected parts are NOT byte-countable locally. Per-component S81 estimates and their ~21K sum = RETIRED history with the estimate field (owner 2026-07-16, see _owner_override_note). SE's governing number = rounded_up_tokens 100K (owner-set reserve S112), independent of AI_INFRA's figure (hub's 100K = their own measure+round, toolset family identical Read/Write/Edit/Bash/Grep/Glob/Skill/RAG)."
|
|
},
|
|
"token_governor": {
|
|
"_note": "Harness-15-v2 (S82, 2026-06-21): UPDATED by delta broadcast 2026-06-20-Governance-harness-15-v2-hot-feed-update (supersedes_scope = tier-1-sizing + L2/L3-caps ONLY; rest of H15 unchanged). TWO CHANGES vs S81: (1) Tier-1 = HOT-FEED LARGE per-role (was flat 12K -- too thin, caused lead to forget work across sessions); (2) L2/L3 caps REMOVED (on-demand, no artificial tier-limit, bounded only by model context window). Still the 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; VN text ~3.0-3.5 byte/tok so byte/4 = upper bound => real headroom LARGER. Budget = MINIMUM-to-USE floor (FILL Tier-1 with real work-state up to the number; under-fill ONLY when high-value content exhausted; NEVER garbage-stuff -- token-saving = forgetting work).",
|
|
"role_boundary_note": "v2 §6 ROLE BOUNDARY (🔴): the budget numbers (Tier-1 per-role cap + per-bucket allocation) are ANH's (project-owner / chu-du-an) RIGHT to set -- NOT the AI-lead's. em-main's job is exactly two parts: (1) EXECUTE the config faithfully (load Tier-1 to the number, no-truncate, pull each bucket to target) + (2) REPORT %-composition at session-start (§2.1.6) and session-end (§L.b(c)) so anh decides. em-main self-measures + proposes numbers; em-main does NOT auto-tune them down. This corrects the S81 'LEAD-AUTHORITY' framing which conflated AI-lead with project-owner.",
|
|
"tier1_hotfeed_tokens": {
|
|
"_note": "Tier-1 always-loaded HOT-FEED, PER-ROLE (v3 S83 2026-06-22: FULL AI_INFRA parity, owner-set). FILL with the 4 work buckets: (1) WIP work-state, (2) recurring-bugs/anti-patterns/gotcha (value_protect, kept regardless of age), (3) backlog, (4) pending-decisions. anh-set: lead 380K (S94 2026-06-29 owner-override, SE-SPECIFIC -- diverged from AI_INFRA-parity to fit the full ~368K read-set) / mem-sub 60K / wf-sub 50K (subs STILL AI_INFRA parity). This SUPERSEDES the S82 'SE numbers are SMALLER (lead 60K; subs stay 20K/16K because the byte-cap binds first)' self-justification -- that was the AI under-shrinking, forbidden by role_boundary_note + mark RC-...01-58-01 (token-saving = forgetting work). KEY CORRECTION on subs: the sub MEMORY.md byte-cap (30720B ~9.3K tok) is ONLY ONE SLICE of a sub's Tier-1 -- the SPAWN PROMPT (relevant gotchas + state + full task-context + related docs/memory, written by em-main) fills the REST up to the token budget. So 60K/50K is NOT 'unusable headroom'; it is the target em-main fills via a RICH spawn prompt (see spawn_fill_directive). %-print at the two session ends shows the REAL composition.",
|
|
"lead_tokens": 380000,
|
|
"lead_note": "ANH-SET 380K (S94 2026-06-29 owner-directive RC-pqhuy1987-29-06-2026-23-25-50 -- raised 220K->380K so the FULL canonical read-set ~368K fits; SE-SPECIFIC override, NO LONGER AI_INFRA-parity for lead, sub caps unchanged). History: 220K (S83 full-parity) <- 200K interim <- 60K S82 self-shrink. DO NOT auto-reduce (role_boundary_note + mark RC-...01-58-01). Hot-feed = STATUS full current-state + 4-bucket work-state block + ACTIVE-MARKS + recent-3-session HANDOFF + active roadmap (migration-todos) + roster-slice + task-relevant gotchas + active-task files + task-relevant docs/code -- read GENEROUSLY ('dau phien nap them tier1_lead cho du'), NOT 'on-demand-deferred', but HIGHEST-VALUE distilled only, NEVER garbage-stuff. Opus 4.8 1M window => 380K is ~38% of window. CAVEAT: at ~368K loaded the hot-feed is ~97% full => near-zero headroom + HIGHER context-rot (honest_caveat trade-off accepted by owner). TOOLING NOTE: the 380K BUDGET cap is ORTHOGONAL to the harness Read-tool 25K/call cap -- STATUS/HANDOFF mega-lines STILL cannot be fully Read until re-tiered (mega-line not line-paginatable); cap raise alone does NOT unblock the Read. anh-adjustable (owner authority).",
|
|
"memory_sub_tokens": 60000,
|
|
"memory_sub_note": "memory-bearing sub (agent-chinh), anh-set 60K (S83 full parity): own MEMORY.md (<=30720B ~9.3K tok auto-inject) + archive _INDEX map + work-state slice + THE RICH SPAWN PROMPT em-main writes (relevant gotchas + current state + full task-context + related docs/memory) = fills toward 60K. The byte-cap on MEMORY.md is NOT the binding limit on the sub's Tier-1; the spawn prompt is. em-main MUST write a context-rich brief, NOT a thin 8K brief (that old anti-truncation heuristic guarded RETURN-truncation #53, mitigated by lean memoryDelta RETURN -- not by starving INPUT).",
|
|
"workflow_sub_tokens": 50000,
|
|
"workflow_sub_note": "agent-in-workflow, anh-set 50K (S83 full parity): MEMORY-PACK slice (hmw.js:124 args inject) + RICH task context (relevant gotchas + state + full task-context + related docs/memory passed via the workflow agent() prompt). Same rule: fill to budget with high-value content, lean structured return."
|
|
},
|
|
"spawn_fill_directive": {
|
|
"_note": "Harness-15-v3 (S83 2026-06-22 owner-directive): when em-main SPAWNS any sub-agent or workflow-agent, FILL its context toward its token budget (mem-sub 60K / wf-sub 50K) via a RICH prompt -- relevant gotchas + current state + full task-context + related docs/memory. The sub's MEMORY.md byte-cap is only one slice; the spawn prompt supplies the rest. RULE: highest-value distilled content ONLY (the hot-load tokens must be the most valuable, filtered through many stages), never garbage-stuff to hit the number. RECONCILES the agents/README anti-truncation '<=8K brief' heuristic: that guarded against RETURN-truncation (#53), now mitigated by return-delta-only (memoryDelta) + em-main recover-disk -- so the INPUT prompt is no longer starved; it is filled rich.",
|
|
"applies_to": ["Agent tool spawn", "Workflow hmw.js agent() calls"],
|
|
"quality_gate": "highest-value distilled, NOT padding"
|
|
},
|
|
"l2_ondemand": "NO-CAP (v2: removed the 6K cap). On-demand: archive verbatim/gist sections + skill sections; pulled per-need, no artificial tier-limit; bounded only by model context window. On-demand => no permanent context-cost when unused.",
|
|
"l3_rag": "NO-CAP (v2: removed the 4K cap). On-demand: RAG search_memory/search_code per query; bounded only by model context window.",
|
|
"pct_print": {
|
|
"_note": "v2 §6: %-print Tier-1 composition at TWO session ends so anh sees what Tier-1 holds, which bucket is thin, headroom left. Estimate-by-ratio is enough (no exact measure). Headroom > 0 WHILE high-value content still unloaded = under-fill (WRONG) -> load more; chua headroom ONLY when high-value content truly exhausted. Headroom = a FLAG, NOT a saving target.",
|
|
"session_start": "session-start.md §2.1.6 (composition by % per bucket)",
|
|
"session_end": "session-end.md §L.b(c) (% after load + Headroom remaining)"
|
|
},
|
|
"honest_caveat": "v2 §5: large Tier-1 = HIGHER context-rot on the always-loaded part -- an accepted, deliberate trade-off (forgetting-work judged worse than rot), NOT 'rot disappears'. Small-context-window / light-workload projects may optimally pick a SMALLER Tier-1 -- the FLOOR is the ARCHITECTURE (hot-feed large + L2/L3 on-demand no-cap), not the numbers. 'No-cap' L2/L3 = no artificial tier-limit, still within the model context window."
|
|
},
|
|
"h24_cadence": {
|
|
"_note": "Harness-24 (S121, 2026-07-15, wave adap-6-broadcast W2) lead-self-audit cadence. SINGLE-SOURCE per H24 §2(3): every cadence number is READ FROM HERE; docs/persona POINT TO THIS KEY and must NOT copy the digits. Consumer: scripts/governance-detectors.ps1 detector H24-2 carry-age (reads light_every as M). MISSING KEY => the consumer FAILS LOUD and measures nothing -- it must NEVER assume a default, because a hardcoded cadence would silently re-create the very drift single-source exists to prevent.",
|
|
"_owner_ratified": "owner-decisions-15-07-2026 Q2 (anh chot 6/15/3 cho SE) + hub H0-LEAD-AUDIT-DECISION-CAPTURE-2026-07-14.md:105 (6/15/3/3, 'doi = anh', 2026-07-14); ratified = anh mark cong reply 2026-07-16-ai_infra-to-se-reply-adap-dot-16-07 (e50a4bd0), ngay 2026-07-17. 6/15/3 = moc khoi-dau CO Y anh chon -- KHONG phai muon so song cua hub: hub-counter DA GO per 85bf89ca, khong con moc so song. Re-tune sau chu-ky-2 CUA SE (deep-audit lan 2, xem .session-counter.json last_audit); chua ai duoc ban cau 'da chung minh hieu qua' (delta hub tu run-2 khong bao gio co -- hub go counter truoc run-2).",
|
|
"light_every": 6,
|
|
"deep_every": 15,
|
|
"jump_on_class_repeat": 3
|
|
},
|
|
"lead_self_audit": {
|
|
"_note": "Harness-24 (S121, 2026-07-15, wave adap-6-broadcast W2) CLOSED enum of flag classes for the 2 monitor roles lead-view-auditor + lead-omission-auditor. CLOSED = a monitor may NOT invent a class; an unclassifiable finding is reported verbatim + escalated to the owner to extend this list. Rationale (spec v2 M4): v1 required 'class in a CLOSED enum' but never listed the enum nor named the config key, so the enum lived only in one lane's head -- workers never see it, invent their own classes, and the statistics dilute. That is exactly what H24 §2(1) forbids. ORIGINAL SHAPE (S121): five view-* classes and five gap-* classes, mirroring the ten signals in H24 §2(1). S143 EXTENSION (2026-07-22, owner-approved): +1 class 'gap-incident-unrecorded' => now 5 view-* + 6 gap-*. Trigger that earned it: 3/3 subagents garbled (#53) in one session and the event left 0 trace on WAL/HANDOFF/STATUS/error-ledger while those surfaces were advertising '0-garble' (true, but about the PRIOR session); the running tally in .claude/auto-memory/feedback_agent_return_garble_recover.md had also been frozen at 'x20 through S118' for 8 session labels. lead-omission-auditor correctly REFUSED to invent the class and escalated verbatim per the CLOSED-enum rule above -- this entry is the owner extending the list, which is exactly the escape hatch that rule prescribes. Scope: an operational incident that happened and was verifiably not written to any durable ledger; NOT for a stale number (view-*) and NOT for a dropped carry (gap-carry-dropped).",
|
|
"_vocab_guard": "'view' / 'omission' chosen DELIBERATELY to avoid collisions: scripts/governance-detectors.ps1:15 already owns 'derived-staleness' (so no class may be named *-stale-role or vai-STALE), and the bare word 'GAP' is overloaded elsewhere (session-end.md 'build-gap vs floor-rot'; scripts/memory-selfimprove-audit.ps1 'CRITERIA+GAP'). A colliding name would make two different detectors answer to the same word.",
|
|
"flag_classes": [
|
|
"view-stale-count",
|
|
"view-stale-status",
|
|
"view-stale-header",
|
|
"view-stale-role-desc",
|
|
"view-residual-asym",
|
|
"gap-carry-dropped",
|
|
"gap-carry-aged",
|
|
"gap-owner-specifics",
|
|
"gap-decision-sunk",
|
|
"gap-underfill",
|
|
"gap-incident-unrecorded"
|
|
]
|
|
},
|
|
"measured": {
|
|
"_note": "S107 2026-07-10 FRESH re-measure (scripts/measure-agent-memory.ps1) post +office-document 12th sub (roster 11->12). Supersedes S98 snapshot (deltas S99-S107 transcribed: cicd +#489 run-record, tooling S106 self-compact 19.7->16.9KB L1 + 30.3KB archive, harvest 18.1KB over self-target 17.1K [self-compact next session], inv-cb/reviewer archive growth). byte-governor snapshot (l1_hot = file-size-on-disk); cross-check token_governor for the orthogonal token-thread. WATCH: cicd l2_index 18774/20480 (~92% cap) -> when nears cap, gist-of-index or split, do NOT drop markers. S138 ADDENDUM (2026-07-17, closeout-S137 tra INFORM view-audit 'measured-block thieu 2 row H24'): +2 row H24 do TUOI (roster 12->14); cac row KHAC van la snapshot S107 va MOT SO DA TROI (do S138 vd: cicd l1 20180->22607, inv-cb 17229->23420, reviewer 20071->17506) -- KHONG hand-edit tung so le (rule dau file), full re-sync bang script @monthly drift-audit 2026-08-01. S141 ADDENDUM (2026-07-22, adap dot-9/10 lane W-A): +3 row trio-memory (harness-eval/refine/audit) do TUOI bang script SAU khi 3 seed MEMORY.md ton tai (roster tang tu 14 len 17) -- KHONG uoc-luong, KHONG hand-edit; cung tien-le S138 addendum. 3 row nay = SEED-STATE (vai chua chay lan nao: first-run cho restart Claude Code + consent anh @session-start §2.1.9 / session-end §L.b(k)) nen l1_hot ~1.5KB va l2_* = 0 la DUNG, khong phai under-fill. Cac row KHAC van la snapshot S107/S138 va MOT SO DA TROI tiep (do S141 vd: cicd 22607, inv-cb 26624, reviewer 24024, harvest 14899, impl-be 19449, impl-fe 15951, test-spec 22140, tooling 15884, lead-view 4920, lead-omission 6665) -- van CHO full re-sync bang script @drift-audit 2026-08-01, KHONG va le tung so. KHONG them cadence-key va KHONG them block harness_trio: nhip bo-ba song o nghi-thuc (session-start §2.1.9 + session-end §L.b(k)) + persona, KHONG o file config nay (tron voi h24_cadence = 2 dong-ho lech nhau).",
|
|
"cicd-monitor": { "l1_hot": 20180, "l2_verbatim": 209666, "l2_index": 18774, "l2_gist": 29737, "rollout": "done (S107 +Run#489 record + #69 two-mode amend; L1 20.2KB — curate candidate next closeout)" },
|
|
"investigator-codebase": { "l1_hot": 17229, "l2_verbatim": 125118, "l2_index": 12384, "l2_gist": 27297, "rollout": "done (gist 2026-06 distill-gen:2 -- double-distill guard target)" },
|
|
"reviewer": { "l1_hot": 20071, "l2_verbatim": 100078, "l2_index": 11442, "l2_gist": 19114, "rollout": "done (S98: +4 diary entries V1/V3/Fidelity-gate spawns)" },
|
|
"implementer-backend": { "l1_hot": 23955, "l2_verbatim": 59233, "l2_index": 10105, "l2_gist": 23079, "rollout": "done (WATCH: gần autoinject-cap nhất 23955/25600)" },
|
|
"frontend-designer": { "l1_hot": 21492, "l2_verbatim": 6624, "l2_index": 1531, "l2_gist": 3231, "rollout": "done (S96 first-overflow curate; H17 strike-1 CLEARED)" },
|
|
"test-specialist": { "l1_hot": 8844, "l2_verbatim": 18065, "l2_index": 0, "l2_gist": 5374, "rollout": "done (RESOLVED pre-S94: L1 27.7->8.8KB; archive activity-s51-s52 + gist + baseline-history reference-file [skip sleep: da distilled-form])" },
|
|
"harvest-curator": { "l1_hot": 18082, "l2_verbatim": 17072, "l2_index": 0, "l2_gist": 0, "rollout": "has-archive (S107: L1 over self-target 17.1K -> self-compact planned next session)" },
|
|
"tooling-auditor": { "l1_hot": 16923, "l2_verbatim": 30344, "l2_index": 0, "l2_gist": 0, "rollout": "has-archive (S106 self-compact 19.7->14.9KB moved-not-cut md5-verified; S107 @start/@end entries)" },
|
|
"implementer-frontend": { "l1_hot": 14252, "l2_verbatim": 14537, "l2_index": 0, "l2_gist": 11125, "rollout": "done (S97 hook-compaction -> 2026-H1.md; S98 sleep-compress -> 2026-H1.gist.md distill-gen:1, coverage 100%, no _INDEX yet [P2 event, not sleep-scope])" },
|
|
"investigator-api": { "l1_hot": 8510, "l2_verbatim": 0, "l2_index": 0, "l2_gist": 0, "rollout": "n/a (empty archive)" },
|
|
"database-agent": { "l1_hot": 7388, "l2_verbatim": 0, "l2_index": 0, "l2_gist": 0, "rollout": "n/a (no archive; +S97 on-behalf record S98)" },
|
|
"office-document": { "l1_hot": 3323, "l2_verbatim": 0, "l2_index": 0, "l2_gist": 0, "rollout": "n/a (S107 seed + first spawn-test entry — VERIFIED-RUNTIME same-session; no archive yet)" },
|
|
"lead-view-auditor": { "l1_hot": 3332, "l2_verbatim": 0, "l2_index": 0, "l2_gist": 0, "rollout": "n/a (S138 add — closeout-S137 tra INFORM view-audit; diary seed S132 retro-harvest, light-audit #1 S124 + #2 S137; do tuoi measure-agent-memory.ps1; no archive)" },
|
|
"lead-omission-auditor": { "l1_hot": 3691, "l2_verbatim": 0, "l2_index": 0, "l2_gist": 0, "rollout": "n/a (S138 add — closeout-S137 tra INFORM view-audit; diary seed S132 retro-harvest, light-audit #1 S124 + #2 S137; do tuoi measure-agent-memory.ps1; no archive)" },
|
|
"harness-eval": { "l1_hot": 1547, "l2_verbatim": 0, "l2_index": 0, "l2_gist": 0, "rollout": "S141 seed - first-run pending restart+consent; re-measure @drift-audit 2026-08-01 (do TUOI measure-agent-memory.ps1 sau khi seed MEMORY.md ton tai; no archive)" },
|
|
"harness-refine": { "l1_hot": 1616, "l2_verbatim": 0, "l2_index": 0, "l2_gist": 0, "rollout": "S141 seed - first-run pending restart+consent; re-measure @drift-audit 2026-08-01 (do TUOI measure-agent-memory.ps1 sau khi seed MEMORY.md ton tai; no archive)" },
|
|
"harness-audit": { "l1_hot": 1513, "l2_verbatim": 0, "l2_index": 0, "l2_gist": 0, "rollout": "S141 seed - first-run pending restart+consent; re-measure @drift-audit 2026-08-01 (do TUOI measure-agent-memory.ps1 sau khi seed MEMORY.md ton tai; no archive)" }
|
|
}
|
|
}
|