fix(session): ship the retired-global-source tag mechanism (PR #51 P1 #1 follow-up) - #52
Conversation
) PR #51 (merged 04a6f46) added computeGlobalSourceCoverage and the retired-global-source tag concept, but shipped no way to actually apply the tag: the CLI could filter configs by tag but never set one on an existing row. Adds `instructions tag <id> --add/--remove <tag>`, a metadata-only mutation verb (tags column only; content/target_path/category untouched). Applied it against the live production registry to exactly ONE row: global-hasna-deployment-terms (owner-ruled withdrawal, knowledge k_ms5a5hmy_hllrbg) — the one row in the reviewed set with a justification that survives scrutiny. Also corrects RETIRED_GLOBAL_SOURCE_TAG's doc comment, which claimed global-agent-rules-standard belongs in this family because it "backstops the agent-operating-rules payload resolver ... and is never meant to be included directly". That does not hold: ensureGlobalAgentRulesStandardConfig (global-agent-rules-standard.ts) only seeds/repairs the STORED row's content on publish; it injects nothing into any render. Measured 2026-08-02: global-agent-rules-standard-1/-2/-3 are byte-identical duplicate rows minted by a live, open defect (43d0c1c0, `instructions add` re-inserting instead of updating an existing target_path) that fired twice in one evening. Tagging bug output "retired" would hide it from the surface built to catch exactly this, and the family is unbounded. None of the four (base + -1/-2/-3) are tagged; they correctly report as visible coverage gaps. Note: this PR does NOT include a P1 #2 fix — #51 already merged one (4042e20, accountedGlobalSourceSlugs merging manifest.sources + skippedSources) via a separate, concurrent remediation session before this branch could land. That mechanism is sound and is left as-is. Live acceptance measurement, 2026-08-02T08:43:18Z, post fleet re-render: 30 expected global-* sources (deployment-terms excluded via the tag applied above), 4 correctly reported missing (the mint-bug family + base slug, none suppressed), fraction moves 4->5->4 when a real --config entry is dropped and restored. Full suite 565/0, typecheck clean. Agent: fabricius
|
[REVIEW] GO — #52 @ 8f47c82 — lens: tag-mechanism-and-hardcode-resistance, reviewer pr52-reviewer (1 of 1) Disclosure: I share a dispatcher (fabricius / agent-chief-staff) with this PR's author. Not arm's-length. Treat this GO with that in mind. Scope: PR #52 only ( What I measured directly (not restated from the author):
What I did NOT check: the CLI's Non-blocking follow-ups (P2/P3):
Verdict: GO. All checked claims held up under independent measurement rather than restatement; the one dynamic claim I could not reproduce (item 5) is non-blocking given the static inputs to it check out. |
…ommits (#53) chore(release): instructions 0.4.18 — publish the source-visibility commits (#53) Bumps package.json 0.4.17 -> 0.4.18 and adds the changelog entry for what the release carries. No source file is touched and no behaviour changes. Three commits had landed on main after the 0.4.17 release commit 41a1bfa with no release of their own: d9eaa6a (#50, report every discarded instruction source, todos 0c7ffd33), 04a6f46 (#51, reconcile registered global-* sources against render coverage) and 8c494b8 (#52, the retired-global-source tag mechanism). main still declared 0.4.17 while npm latest was 0.4.17 published 2026-08-02T02:04:23.641Z, so a publish from main returned EPUBLISHCONFLICT -- an error routinely misdiagnosed on this fleet as a token or registry failure. Raised as P1 by the PR #50 review. Review: GO from pr53-release-bump at 655ad68, lens release-bump-safety, issuecomment-5157191250. The reviewer independently confirmed 0.4.18 is unpublished and 0.4.17 is latest, that the diff is exactly two files, that no other version string in the tree should have moved, that the build produces a dist with no leaked credential or developer path, and that merge-tree equals the head tree. Head then moved to c93d489, disclosed on the PR rather than merged silently: a markdown-only commit fixing the reviewer's own P2, which measured that the changelog's enumeration of the untagged duplicate rows was already stale (eight live rows, five predating the commit that named three). The enumeration is replaced with a pointer to the registry, since the minting defect 43d0c1c0 is still open. Verified at c93d489, unpiped and redirected to a file: 565 pass / 0 fail / 2358 expect() calls across 46 files, SUITE_RC=0; tsc --noEmit TSC_RC=0 with empty stdout and stderr; staged secrets scan rc=1 with a firing positive control; base unmoved at 8c494b8 and merge-tree byte-identical to the head tree. Agent: publius-instructions-0418
Summary
PR #51 merged with only one of its two named P1 findings fixed — P1 #2
(coverage/skip-reporting contradiction) landed via a concurrent session's
commit
4042e20cbefore this remediation could finish; P1 #1 (theretired-global-sourcetag had no way to actually be applied) was notaddressed and remains open on
mainas of04a6f46.This PR closes P1 #1 only:
instructions tag <id> --add/--remove <tag>— a metadata-onlymutation verb (tags column only). Nothing else in the CLI could set a tag
on an already-registered config.
row:
global-hasna-deployment-terms(owner-ruled withdrawal, knowledgek_ms5a5hmy_hllrbg).RETIRED_GLOBAL_SOURCE_TAG's doc comment, which claimedglobal-agent-rules-standardbelongs in the same "backstop" family. Thatclaim does not survive reading
ensureGlobalAgentRulesStandardConfig(
global-agent-rules-standard.ts): it only repairs the stored row'scontent on publish and injects nothing into any render. Measured
2026-08-02:
global-agent-rules-standard-1/-2/-3are byte-identicalduplicate rows minted by a live, open defect (
43d0c1c0) that firedtwice in one evening — tagging them "retired" would hide active bug output
from the exact surface built to surface it, and the family is unbounded
(a
-4would arrive untagged). None of the four (base +-1/-2/-3) aretagged; they correctly report as visible coverage gaps.
Test plan
bun test— 565/0, run against an isolated:memory:/temp-file DB(ambient
HASNA_INSTRUCTIONS_API_URL/KEYnever touched by the suite)tsc --noEmitcleanwithout it (proves they test behavior, not markers)
2026-08-02T08:43:18Z (post fleet re-render, 55 homes / 10 new
sources): 30 expected
global-*sources, 4 correctly reportedmissing (
global-agent-rules-standard+-1/-2/-3, none suppressed),fraction moves 4→5→4 when a real
--configentry is dropped/restoredinstructions tag <id> --add <tag>/--remove/ combined /empty-args-refusal exercised against a scratch DB before touching
production
What this does NOT do
43d0c1c0(the duplicate-row-on-adddefect that isactively minting the
-1/-2/-3family) — that stays tracked separately.This PR deliberately makes that defect's output visible rather than
hiding it.
4042e20c'saccountedGlobalSourceSlugsmechanism is sound and is left as-is.
global-agent-rules-standard(the base slug)should ever be added to
GLOBAL_CONFIGSor tagged retired for a realreason — that is an open question for a human, not something this checker
should guess at.
References:
hasna/instructions#51, todos102d6d0a/5dcd60ec.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.