@dall337/lore 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/License.md +21 -0
  2. package/README.md +210 -2
  3. package/bin/lore.mjs +187 -0
  4. package/hud/dist/client/assets/index-BA5GHj6l.css +1 -0
  5. package/hud/dist/client/assets/index-C1P2dBAT.js +7 -0
  6. package/hud/dist/client/assets/jetbrains-mono-cyrillic-400-normal-BEIGL1Tu.woff2 +0 -0
  7. package/hud/dist/client/assets/jetbrains-mono-cyrillic-400-normal-ugxPyKxw.woff +0 -0
  8. package/hud/dist/client/assets/jetbrains-mono-cyrillic-600-normal-8K4wrrwR.woff +0 -0
  9. package/hud/dist/client/assets/jetbrains-mono-cyrillic-600-normal-EVf6-Yzo.woff2 +0 -0
  10. package/hud/dist/client/assets/jetbrains-mono-greek-400-normal-B9oWc5Lo.woff +0 -0
  11. package/hud/dist/client/assets/jetbrains-mono-greek-400-normal-C190GLew.woff2 +0 -0
  12. package/hud/dist/client/assets/jetbrains-mono-greek-600-normal-H7WoG9Et.woff2 +0 -0
  13. package/hud/dist/client/assets/jetbrains-mono-greek-600-normal-mc2nkWzM.woff +0 -0
  14. package/hud/dist/client/assets/jetbrains-mono-latin-400-normal-6-qcROiO.woff +0 -0
  15. package/hud/dist/client/assets/jetbrains-mono-latin-400-normal-V6pRDFza.woff2 +0 -0
  16. package/hud/dist/client/assets/jetbrains-mono-latin-600-normal-BfsvjouI.woff +0 -0
  17. package/hud/dist/client/assets/jetbrains-mono-latin-600-normal-C8RAYTDA.woff2 +0 -0
  18. package/hud/dist/client/assets/jetbrains-mono-latin-ext-400-normal-Bc8Ftmh3.woff2 +0 -0
  19. package/hud/dist/client/assets/jetbrains-mono-latin-ext-400-normal-fXTG6kC5.woff +0 -0
  20. package/hud/dist/client/assets/jetbrains-mono-latin-ext-600-normal-BfB_LPfz.woff2 +0 -0
  21. package/hud/dist/client/assets/jetbrains-mono-latin-ext-600-normal-DObL3zCW.woff +0 -0
  22. package/hud/dist/client/assets/jetbrains-mono-vietnamese-400-normal-CqNFfHCs.woff +0 -0
  23. package/hud/dist/client/assets/jetbrains-mono-vietnamese-600-normal-OWROknRo.woff +0 -0
  24. package/hud/dist/client/index.html +17 -0
  25. package/hud/dist/client/licenses/JetBrainsMono-OFL.txt +93 -0
  26. package/hud/dist/server/main.js +1287 -0
  27. package/package.json +52 -4
  28. package/suite/AGENTS.md +228 -0
  29. package/suite/CLAUDE.md +19 -0
  30. package/suite/claude-settings-additions.json +16 -0
  31. package/suite/gitignore-additions.txt +17 -0
  32. package/suite/memory/INDEX.md +41 -0
  33. package/suite/policies/adversarial-check.md +169 -0
  34. package/suite/policies/board.md +103 -0
  35. package/suite/policies/creative.md +92 -0
  36. package/suite/policies/documentation.md +100 -0
  37. package/suite/policies/git.md +105 -0
  38. package/suite/policies/implementation.md +100 -0
  39. package/suite/policies/memory.md +453 -0
  40. package/suite/policies/orchestration.md +184 -0
  41. package/suite/policies/release.md +56 -0
  42. package/suite/policies/research.md +133 -0
  43. package/suite/policies/reserved/failure-and-recovery.md +6 -0
  44. package/suite/policies/reserved/migration.md +6 -0
  45. package/suite/policies/reserved/planning.md +6 -0
  46. package/suite/policies/reserved/review.md +6 -0
  47. package/suite/policies/reserved/test-authoring.md +6 -0
  48. package/suite/policies/security.md +85 -0
  49. package/suite/policies/tooling.md +153 -0
  50. package/suite/policies/verification.md +60 -0
  51. package/suite/scripts/agents-md-budget.mjs +71 -0
  52. package/suite/scripts/memory-lint.mjs +117 -0
  53. package/suite/scripts/provider-memory.mjs +298 -0
@@ -0,0 +1,56 @@
1
+ # Release Policy
2
+
3
+ Scoped agent-governance procedure (AGENTS.md §1/§2). Load for release
4
+ work: version bumps, bundling, release builds.
5
+
6
+ ## Rule 1 — The Version Lives in N Places; Enumerate Them
7
+
8
+ Every project carries its version string in more places than the obvious
9
+ manifest: package manifests, lockfiles (often more than once per file),
10
+ platform config, documentation banners. **On adoption, this policy's
11
+ first job is to enumerate every location** *(adopt-time slot)* — and to
12
+ keep the enumeration current, because a bump that follows a stale list
13
+ literally ships with locations stale.
14
+
15
+ ```
16
+ # Fill in on adoption — every file carrying the version string, e.g.:
17
+ # package.json · package-lock.json (root AND packages[""]) ·
18
+ # platform config · Cargo.toml · Cargo.lock · docs banner
19
+ ```
20
+
21
+ - Every bump updates **all locations in the same commit**.
22
+ - **The gate:** a repo-wide search for the OLD version string before
23
+ committing — zero hits outside ignored directories.
24
+
25
+ ## Rule 2 — Versioning Scheme
26
+
27
+ *(Adopt-time slot.)* The project declares its scheme here. Recommended
28
+ default: semver, valid for every packaging target the project ships to.
29
+ If the project uses a pre-release iteration suffix (`1.0.1-1`,
30
+ `1.0.1-2`, …), record here what the bare version is reserved for and who
31
+ decides when it's spent.
32
+
33
+ ## Rule 3 — Sequence
34
+
35
+ Version bumps land **last**: merge code branches first, push docs and
36
+ plans, bump after the release scope is locked (`policies/git.md` §3).
37
+ Release bumps get their own commit.
38
+
39
+ ## Rule 4 — Artifacts and Their Prerequisites
40
+
41
+ Enumerate here, on adoption: pre-release staging steps (bundled runtimes,
42
+ sidecars, assets), the exact release build command, and any artifacts
43
+ that must be archived per released version (e.g. sourcemaps or debug
44
+ symbols that crash reporting depends on for symbolication). A release
45
+ whose symbols weren't archived is a release whose crash reports can't be
46
+ read.
47
+
48
+ ## Rule 5 — Verify the Release Artifact Is a Release Artifact
49
+
50
+ Dev-mode configuration leaks into release builds — dev-server URLs,
51
+ debug endpoints, unminified bundles — and the resulting binary looks
52
+ built while being broken standalone. The release artifact is verified by
53
+ **running it in isolation from the dev environment** before it ships. If
54
+ the project's toolchain has a known wrong-command trap (a plain release
55
+ compile that still targets the dev server), name the correct command
56
+ here the first time it burns a session.
@@ -0,0 +1,133 @@
1
+ # Research Policy
2
+
3
+ Scoped agent-governance procedure (AGENTS.md §1/§2). Load **before the
4
+ first tool call** of any task involving research, investigation,
5
+ debugging, architecture discovery, repository exploration, documentation
6
+ review, root-cause analysis, or any task requiring more than a few tool
7
+ calls. Failure to follow this policy is an execution error.
8
+
9
+ ## Bootstrap Checklist
10
+
11
+ ☐ Read this document completely
12
+ ☐ Create the research journal
13
+ ☐ Record objective and success criteria
14
+ ☐ Begin investigation
15
+
16
+ ## Primary Objective
17
+
18
+ **Research must be resilient to interruption.** Assume execution may stop
19
+ at any time: session expiration, context limits, rate limits, model
20
+ replacement, restart, user interruption, process termination. At no point
21
+ should significant investigative work exist only inside a model's context
22
+ window.
23
+
24
+ The governing invariant:
25
+
26
+ > If execution stops unexpectedly, another agent must be able to continue
27
+ > after reading only the journal, without repeating completed work.
28
+
29
+ This invariant takes priority over convenience and speed.
30
+
31
+ ## Rule 1 — Journal First
32
+
33
+ Before the first search, grep, file read, or tool call, create the
34
+ journal:
35
+
36
+ ```
37
+ .research/<date>-<short-task-name>.md
38
+ ```
39
+
40
+ (`.research/` is in-tree but gitignored by design.) The journal is the
41
+ authoritative record of the investigation from this moment on.
42
+
43
+ **Sub-agents create their own journals.** A sub-agent's investigation is
44
+ still an investigation: it gets its own journal, named to show lineage —
45
+ `.research/<date>-<parent-task>--sub-<label>.md`. The parent links every
46
+ sub-journal from its own journal and from its registry file
47
+ (`policies/memory.md` §3), and on the sub-agent's completion absorbs the
48
+ conclusions into its `## Current Findings` — by link and summary, not by
49
+ copy. Sub-journals follow every rule in this policy.
50
+
51
+ ## Rule 2 — Record the Objective
52
+
53
+ The journal begins with: original request, current objective, success
54
+ criteria, known constraints, assumptions. This section is never
55
+ overwritten.
56
+
57
+ ## Rule 3 — Log Every Investigation Step
58
+
59
+ Every significant action — searches, greps, file inspections, symbol
60
+ lookups, build/test runs, log and database inspection — gets an entry:
61
+ what was done, why, and **what was learned**. Relevant files and symbols
62
+ by name. Do not merely state that an action occurred.
63
+
64
+ ## Rule 4 — Evidence, Not Chain of Thought
65
+
66
+ The journal is a technical notebook, not a reasoning dump. Record observed
67
+ facts, supporting code, documentation references, verified behavior,
68
+ rejected hypotheses (with why), confirmed conclusions. It must be
69
+ understandable by another engineer or agent with no access to hidden
70
+ reasoning.
71
+
72
+ ## Rule 5 — Running Sections
73
+
74
+ Maintain continuously, so no future reader reconstructs state from raw
75
+ log entries:
76
+
77
+ - `## Current Findings` — every confirmed discovery, summarized.
78
+ - `## Remaining Questions` — unknowns, missing evidence, unverified
79
+ assumptions, edge cases.
80
+ - `## Next Actions` — an ordered checklist of the next executable work
81
+ items, always current.
82
+
83
+ ## Rule 6 — Save Continuously
84
+
85
+ Append and save after every significant step. The maximum work lost to an
86
+ interruption is one investigation step.
87
+
88
+ ## Rule 7 — Resume From the Journal
89
+
90
+ If interrupted: locate the journal, read it completely, reconstruct state,
91
+ continue from `## Next Actions`. Never restart an investigation blindly.
92
+
93
+ ## Rule 8 — No Duplicate Investigation
94
+
95
+ Before any search, grep, or inspection, consult the journal. Completed
96
+ findings that remain valid are reused, not re-derived — unless
97
+ verification is explicitly the point.
98
+
99
+ ## Rule 9 — Final Deliverable
100
+
101
+ A complete journal contains: Objective · Original Request · Investigation
102
+ Log · Evidence · Current Findings · Remaining Questions · Next Actions ·
103
+ Final Conclusions. The report presented to the owner derives from the
104
+ journal.
105
+
106
+ > **Addendum (2026-10-17, owner-directed policy tags):** Near the top,
107
+ > a journal names the policies loaded for its task on one line:
108
+ > `Policies: research, implementation`. The dispatch table already makes
109
+ > a missed policy an execution error (AGENTS.md §2.2); this line makes
110
+ > the dispatch auditable. The HUD shows declared policies as solid tags
111
+ > and policies a journal only mentions as dotted ones.
112
+
113
+ ## Rule 10 — The Journal Is the Source of Truth
114
+
115
+ Conversation context is temporary; the journal is persistent. If they
116
+ disagree, prefer the journal. Write for multi-agent compatibility: no
117
+ assumed shared memory, no reliance on prior conversation context —
118
+ everything needed to resume exists inside the journal.
119
+
120
+ ## Rule 11 — Link the Journal Into the Web
121
+
122
+ > **Erratum (2026-10-02, configurable memory):** Resolve the memory entry
123
+ > point in AGENTS.md §5. The node and ledger instructions below apply to
124
+ > the bundled web. For another provider, record the journal reference in
125
+ > its appropriate repository area, following that provider's conventions.
126
+ > When the provider is private or read-only, use the configured shared
127
+ > handoff location for successor discovery. The journal remains the task's
128
+ > detailed evidence record; a second memory module is not required.
129
+
130
+ When the investigation touches an area with a memory node
131
+ (`policies/memory.md`), append a link to the journal in that node's link
132
+ table or ledger. The web is how a future agent *finds* the journal; a
133
+ journal only the writing agent knows about has failed half its purpose.
@@ -0,0 +1,6 @@
1
+ # Failure And Recovery Policy
2
+
3
+ Reserved scope (AGENTS.md §4). No rules exist here yet: proceed on
4
+ general judgment and AGENTS.md. When a lesson emerges in this scope,
5
+ codify it here — dated, with the incident that produced it — per the
6
+ accumulation loop (AGENTS.md §3).
@@ -0,0 +1,6 @@
1
+ # Migration Policy
2
+
3
+ Reserved scope (AGENTS.md §4). No rules exist here yet: proceed on
4
+ general judgment and AGENTS.md. When a lesson emerges in this scope,
5
+ codify it here — dated, with the incident that produced it — per the
6
+ accumulation loop (AGENTS.md §3).
@@ -0,0 +1,6 @@
1
+ # Planning Policy
2
+
3
+ Reserved scope (AGENTS.md §4). No rules exist here yet: proceed on
4
+ general judgment and AGENTS.md. When a lesson emerges in this scope,
5
+ codify it here — dated, with the incident that produced it — per the
6
+ accumulation loop (AGENTS.md §3).
@@ -0,0 +1,6 @@
1
+ # Review Policy
2
+
3
+ Reserved scope (AGENTS.md §4). No rules exist here yet: proceed on
4
+ general judgment and AGENTS.md. When a lesson emerges in this scope,
5
+ codify it here — dated, with the incident that produced it — per the
6
+ accumulation loop (AGENTS.md §3).
@@ -0,0 +1,6 @@
1
+ # Test Authoring Policy
2
+
3
+ Reserved scope (AGENTS.md §4). No rules exist here yet: proceed on
4
+ general judgment and AGENTS.md. When a lesson emerges in this scope,
5
+ codify it here — dated, with the incident that produced it — per the
6
+ accumulation loop (AGENTS.md §3).
@@ -0,0 +1,85 @@
1
+ # Security Policy
2
+
3
+ Scoped agent-governance procedure (AGENTS.md §1/§2). Load for
4
+ security-relevant work: anything creating a new execution or network
5
+ surface, dependency changes (with `policies/tooling.md`), supply-chain
6
+ features, or audit/review passes.
7
+
8
+ ## Rule 1 — When a Security Review Is Mandatory
9
+
10
+ - A change introduces a **new execution surface** (anything that
11
+ downloads, installs, or runs third-party code) or a **new network
12
+ surface**.
13
+ - A privileged command or IPC boundary touches filesystem, process
14
+ spawn, or network.
15
+ - Dependencies are added or materially upgraded. (A tooling fast-path
16
+ addition's recorded condition check satisfies this —
17
+ `policies/tooling.md` §4.1; everything else takes the full review.)
18
+ - A release or visibility milestone approaches (public flip, external
19
+ beta).
20
+ - External intel lands — a post-mortem, advisory, or incident relevant
21
+ to a surface this project has.
22
+ - Periodically, and after any major arc touching the above.
23
+
24
+ ## Rule 2 — Method
25
+
26
+ - **Classify before designing.** Any "should the project download/run
27
+ Z?" question starts with the class: (1) **verified artifact** — pin
28
+ version + hash, verify before use, official distributors only;
29
+ (2) **reference data** — cache, size-cap, treat as inert;
30
+ (3) **project-owned execution** — never run it hidden; visible
31
+ execution is the consent and the audit trail; (4) **system-owned
32
+ toolchains** — detect and hint, never install.
33
+ - **Primary sources, adversarially verified.** The research policy
34
+ applies to all security investigation; claims that shape design get
35
+ verified against primary sources before they're load-bearing.
36
+ - **Standing trust rules:** no silent downloads, ever; pinned exact
37
+ versions over `latest`; freshness risk gets an age gate; provenance is
38
+ not a safety signal by itself — valid provenance has appeared on
39
+ compromised packages.
40
+ - **Name the residual risk in the same breath as the mitigation.** Every
41
+ posture statement lists what is NOT covered. User-facing safety claims
42
+ are conservative and, where possible, test-enforced.
43
+
44
+ ## Rule 3 — Deliverables
45
+
46
+ - **A living audit** is the home of observed security state: dated
47
+ review ledger ("Last reviewed"), explicit scope line, checklist form,
48
+ dependency scan results with commit refs, verified strengths, and
49
+ blocked-upstream items carrying their reason and what unblocks them. A
50
+ review pass appends a dated entry and refreshed scans — never rewrites
51
+ history.
52
+ - **Scoped deep-dives** cover one surface each. If a premise dies, the
53
+ document is parked with a dated banner explaining why and what a
54
+ revival must re-scope — never silently deleted.
55
+ - **Security decisions that change behavior are ADRs**, not audit
56
+ entries. The audit records observed state; the ADR records the
57
+ decision. Cross-link both ways.
58
+ - Findings mid-arc that don't block the arc get journaled and surfaced
59
+ to the owner with severity honestly stated — flagged where found,
60
+ fixed before the surface goes live.
61
+
62
+ ## Rule 4 — Chokepoint Exceptions Inherit Every Exemption
63
+
64
+ When a policy is enforced at a central chokepoint (a write manager, a
65
+ gateway, a validation layer), every ratified exception or bypass of that
66
+ chokepoint silently inherits an exemption from **every rule the
67
+ chokepoint carries — including rules added later.** Therefore:
68
+
69
+ - **Exceptions live in a register at the chokepoint.** An exception that
70
+ isn't listed is a bug, not an exception.
71
+ - **Adding a rule to the chokepoint re-triggers an audit of the
72
+ register.** Each exception either re-applies the new rule locally
73
+ (documented at its site) or is explicitly recorded as deliberately
74
+ exempt, with the reason.
75
+ - **Sweep for effect-equivalent paths, not just registered exceptions.**
76
+ Ask: what user action produces this same effect through different
77
+ code? (A rename produces a creation; a save-as produces a creation.)
78
+ The loophole class hides in flows that don't share the guarded verb's
79
+ name.
80
+ - **Refusals must be visible.** A chokepoint that blocks silently reads
81
+ as a bug upstream, trains users to route around it, and hides the
82
+ loophole class from live verification. Every refusal surfaces at
83
+ whichever layer can show it. Ordering interacts with refusal:
84
+ `policies/implementation.md` Rule 7 — a chokepoint that can refuse
85
+ makes any state-first flow a drift trap.
@@ -0,0 +1,153 @@
1
+ # Tooling Policy
2
+
3
+ Scoped agent-governance procedure (AGENTS.md §1/§2). Load at repository
4
+ birth, and afterward for any dependency addition, upgrade, replacement,
5
+ framework adoption, or language question. This policy owns the former
6
+ standalone dependency-change scope.
7
+
8
+ Tooling has two arms: **bootstrap** (the repo is being born) and
9
+ **steady state** (the stack evolves). Both arms end in the same place —
10
+ the tooling register.
11
+
12
+ ## 1. Bootstrap — the research arm at repo birth
13
+
14
+ The user wants to make a thing. The path from that want to a stack:
15
+
16
+ 1. **PRD first.** Take the owner's PRD if one exists; if not, create one
17
+ with the owner before any tooling research
18
+ (`policies/documentation.md` for the document kind). The PRD is the
19
+ constraint set — platforms, performance envelope, team shape,
20
+ licensing posture, longevity expectations. Tooling serves the PRD,
21
+ never the reverse.
22
+ 2. **Load `policies/research.md`.** Journal-first: tooling selection is an
23
+ investigation and follows every research rule.
24
+ 3. **Enumerate candidates** for each layer the PRD implies: language(s),
25
+ framework(s), runtime dependencies, build tooling, test tooling.
26
+ 4. **Evaluate each candidate against the criteria in §3.** Primary
27
+ sources — repos, changelogs, advisories, license texts — not model
28
+ memory. Claims that will shape the stack get verified before they are
29
+ load-bearing.
30
+ 5. **Build the tooling proposal and give it to the user:** per layer, the
31
+ candidates considered, tradeoffs stated honestly, a recommendation
32
+ with its reasoning, and every license named. The owner decides; the
33
+ agent recommends.
34
+ 6. **The owner's decisions birth the tooling register** (§2). Rejected
35
+ candidates stay in the proposal with the reason — a future "should we
36
+ switch to X?" starts by reading why X lost the first time.
37
+
38
+ ## 2. The Tooling Register
39
+
40
+ `docs/TOOLING.md` — the living, authoritative record of what this project
41
+ builds with and why. All future stack questions reference it first.
42
+
43
+ - **The first entry is the license allowlist** *(adopt-time slot — the
44
+ owner declares it: e.g. permissive-only such as MIT/Apache-2.0, or a
45
+ broader compatibility rule)*, together with the exception procedure
46
+ (§4).
47
+ - Every subsequent entry records: item, role in the stack, version and
48
+ pinning policy, license, decision date, and a link to the rationale
49
+ (proposal, journal, or ADR).
50
+ - The register follows amendment discipline
51
+ (`policies/documentation.md`): dated addenda, struck-and-stamped
52
+ supersessions, never silent rewrites. A register you can read
53
+ chronologically is a register you can trust.
54
+
55
+ ## 3. Selection Criteria
56
+
57
+ Weigh every candidate — bootstrap or steady state — on:
58
+
59
+ - **License** against the allowlist. A disqualifying license ends the
60
+ evaluation unless the exception procedure is invoked.
61
+ - **Maintenance health** — release cadence, issue responsiveness, bus
62
+ factor, governance. A brilliant abandoned library is a future
63
+ migration.
64
+ - **Security posture** — advisory history, supply-chain surface,
65
+ install-time behavior. Standing trust rules apply
66
+ (`policies/security.md`): no silent downloads, pinned exact versions
67
+ over `latest`, provenance is not by itself a safety signal.
68
+ - **Fit with the existing stack** — steady state only. The register says
69
+ what already exists; a candidate that duplicates a capability already
70
+ on the register needs a reason beyond preference.
71
+ - **Cost** — size, build-time impact, cognitive complexity, transitive
72
+ dependency load.
73
+ - **Exit cost** — how hard is it to leave? Prefer candidates whose
74
+ boundaries the project can wrap.
75
+
76
+ ## 4. Steady State
77
+
78
+ Any future need — new dependency, major upgrade, replacement, new
79
+ framework or language — follows one loop:
80
+
81
+ 1. **Register first.** Read what exists and why before proposing what's
82
+ new. Weigh the initial tooling decisions; they are precedent, not
83
+ scripture.
84
+ 2. **Evaluate options** per §3, research-policy discipline for anything
85
+ nontrivial.
86
+ 3. **Present options and tradeoffs to the owner** — including "do
87
+ nothing" and "build it" where they are real options. Help the owner
88
+ weigh options and practices; do not pre-decide by presenting one
89
+ candidate.
90
+ 4. **Owner decides; register updated in the same unit of work** as the
91
+ change itself. A dependency in the lockfile that the register doesn't
92
+ explain is a defect.
93
+
94
+ **When no allowlist-compliant option exists,** the options are, in order
95
+ of preference: build the needed piece, vendor or wrap a compliant
96
+ alternative, or the owner grants an exception — dated, reasoned, and
97
+ recorded in the register. Exceptions are owner decisions only; an agent
98
+ never self-grants one.
99
+
100
+ ### 4.1 Fast Path — Trivial Dev-Only Additions
101
+
102
+ The full loop is the default, not a tax on every test matcher. An
103
+ addition may take the fast path when **all** of the following hold:
104
+
105
+ - **License is on the allowlist** — no exception needed.
106
+ - **Dev-time only** — build, test, lint, or type tooling that ships in
107
+ no production artifact.
108
+ - **No new execution or network surface** — in particular, no
109
+ install-time script execution. Check the package's install hooks: a
110
+ dependency that runs code at install time is an execution surface and
111
+ exits the fast path regardless of how trivial it looks.
112
+ - **Pinned exact version.**
113
+
114
+ Fast path procedure: the agent adds the dependency and its register
115
+ entry in the same unit of work, the entry marked `fast path` and
116
+ recording the condition check. That recorded check stands as the
117
+ security review for the addition (`policies/security.md` Rule 1), and
118
+ the owner's PR review is the decision — no separate proposal round.
119
+
120
+ Any condition unclear or failing → the full loop, and
121
+ `policies/security.md` loads. When in doubt, the doubt is the answer:
122
+ full loop.
123
+
124
+ ## 5. Research Standards
125
+
126
+ Tooling claims decay fast. Verify against primary sources at decision
127
+ time — repository activity, changelogs, advisory databases, the actual
128
+ license file in the actual repo — and record in the journal *how* each
129
+ load-bearing claim was verified. "Widely used" and "well maintained" are
130
+ hypotheses until checked.
131
+
132
+ ## 6. Brownfield Adoption
133
+
134
+ An existing project adopting this suite does not audit its way to a
135
+ complete register on day one — a mature repository's transitive
136
+ dependency census is a project in itself, and most of the output would be
137
+ dead information.
138
+
139
+ - **Seed the register with the load-bearing decisions only:** the
140
+ license allowlist, the language(s), framework(s), build and test
141
+ tooling, and the top-level runtime dependencies a real stack question
142
+ would reference. Each entry is stamped
143
+ `recorded from existing state, <date>` in place of a decision
144
+ rationale — an honest "this predates the register" beats a
145
+ reconstructed justification.
146
+ - **Everything else registers by contact.** When steady-state work (§4)
147
+ touches a dependency not yet on the register, it is added then, with
148
+ whatever rationale is recoverable — or
149
+ `pre-register, rationale unrecorded`.
150
+ - The register reaches completeness through work, not census. §4's "a
151
+ dependency the register doesn't explain is a defect" applies **after**
152
+ an area has been worked under this suite; before contact, it is merely
153
+ not registered yet.
@@ -0,0 +1,60 @@
1
+ # Verification Policy
2
+
3
+ Scoped agent-governance procedure (AGENTS.md §1/§2). Load when preparing
4
+ any PR, completing a milestone or slice, or changing an API or
5
+ architecture boundary.
6
+
7
+ ## Rule 1 — The Standard Check Suite
8
+
9
+ *(Adopt-time slot.)* The project enumerates its actual check commands
10
+ here — this list, not an agent's recollection of it, is what "run the
11
+ checks" means. The suite should cover, where the stack supports each:
12
+
13
+ - **Structural enforcement** — architecture/boundary guards, import
14
+ rules, contract checks, whatever enforcement code exists.
15
+ - **The full test suite** — and this policy names where the tests live,
16
+ so "all tests pass" is a verifiable claim, not a vibe.
17
+ - **A production build** — dev servers hide build-only failures.
18
+ - **Zero-warning compilation** where the toolchain distinguishes
19
+ warnings — warnings are the floor (`policies/implementation.md`
20
+ Rule 5).
21
+
22
+ ```
23
+ # Fill in on adoption, e.g.:
24
+ # node scripts/memory-lint.mjs — memory web form (ships with the suite)
25
+ # node scripts/provider-memory.mjs check <memory-dir> — provider memory hub (ships with the suite)
26
+ # node scripts/agents-md-budget.mjs — AGENTS.md chain under 30 KiB (ships with the suite)
27
+ # npm run check — guards + build
28
+ # npm run test — full suite
29
+ # cargo build && cargo test — zero warnings required
30
+ ```
31
+
32
+ ## Rule 2 — When to Run
33
+
34
+ Run the suite whenever any of the following is true: a milestone or
35
+ refactor slice is completed; a new module/domain is added; any change
36
+ affects an existing API, command, selector, or behavior; any
37
+ architecture boundary or import rule changes; any PR is being prepared.
38
+
39
+ Record pass/fail evidence in the related plan or checklist doc when one
40
+ exists.
41
+
42
+ ## Rule 3 — Verify the Commit, Not Just the Tree
43
+
44
+ After committing, read the commit summary and check the files-changed
45
+ count against intent **before pushing**. Two silent failure modes this
46
+ catches in seconds:
47
+
48
+ - A pathspec commit (`git commit -m "..." <path>`) commits ONLY that
49
+ pathspec and silently drops the rest of the staged index.
50
+ - A commit made on the wrong branch lands there silently.
51
+
52
+ Read the summary line; run `git status`; every time.
53
+
54
+ ## Rule 4 — Verification Is Evidence, Not Ceremony
55
+
56
+ A check that was run but whose output wasn't read verifies nothing. When
57
+ a check fails, the failure is investigated under
58
+ `policies/research.md` discipline if nontrivial — never rerun-until-
59
+ green, never skipped with intent to fix later unless the owner has
60
+ explicitly accepted that debt, dated, in the relevant plan.
@@ -0,0 +1,71 @@
1
+ #!/usr/bin/env node
2
+ // agents-md-budget.mjs — keeps the AGENTS.md chain inside what Codex reads
3
+ // (AGENTS.md §3 and §5, provider memory table).
4
+ //
5
+ // Codex reads at most one instruction file per directory, AGENTS.override.md
6
+ // before AGENTS.md, skipping empty files, from the project root down to its
7
+ // working directory, and stops adding files once the combined size reaches
8
+ // project_doc_max_bytes (32 KiB by default). Guidance past that point is
9
+ // never read. This guard measures every root-to-directory chain in the
10
+ // repository against a 30 KiB budget, which leaves room for a global
11
+ // ~/.codex/AGENTS.md:
12
+ //
13
+ // E1 a chain of instruction files over budget
14
+ //
15
+ // A directory holding its own .git (a worktree or submodule) is a separate
16
+ // project root with its own chain, so the walk does not enter it. Fallback
17
+ // filenames configured in Codex (project_doc_fallback_filenames) are not
18
+ // covered.
19
+ //
20
+ // Zero dependencies. Usage:
21
+ // node scripts/agents-md-budget.mjs [repo-root] [--max <bytes>]
22
+ // Exit 1 when any chain is over budget.
23
+ // The checks are the policy; the implementation is fungible.
24
+
25
+ import { readdirSync, statSync, existsSync } from 'node:fs';
26
+ import { join, relative } from 'node:path';
27
+
28
+ const args = process.argv.slice(2);
29
+ const maxAt = args.indexOf('--max');
30
+ const MAX = maxAt >= 0 ? Number(args[maxAt + 1]) : 30 * 1024;
31
+ const ROOT = args.find((a, i) => !a.startsWith('--') && (maxAt < 0 || i !== maxAt + 1)) ?? '.';
32
+ const SKIP = new Set(['.git', 'node_modules']);
33
+
34
+ function instructionFile(dir) {
35
+ for (const name of ['AGENTS.override.md', 'AGENTS.md']) {
36
+ const p = join(dir, name);
37
+ if (existsSync(p) && statSync(p).isFile() && statSync(p).size > 0) {
38
+ return { path: relative(ROOT, p).replace(/\\/g, '/'), size: statSync(p).size };
39
+ }
40
+ }
41
+ return null;
42
+ }
43
+
44
+ const chains = [];
45
+ function walk(dir, chain) {
46
+ const file = instructionFile(dir);
47
+ const here = file ? [...chain, file] : chain;
48
+ if (file) chains.push(here);
49
+ for (const entry of readdirSync(dir, { withFileTypes: true })) {
50
+ if (!entry.isDirectory() || SKIP.has(entry.name)) continue;
51
+ const sub = join(dir, entry.name);
52
+ if (existsSync(join(sub, '.git'))) continue;
53
+ walk(sub, here);
54
+ }
55
+ }
56
+ walk(ROOT, []);
57
+
58
+ if (chains.length === 0) {
59
+ console.log('agents-md-budget: no AGENTS.md found — nothing to check.');
60
+ process.exit(0);
61
+ }
62
+
63
+ const total = (chain) => chain.reduce((sum, f) => sum + f.size, 0);
64
+ const over = chains.filter((c) => total(c) > MAX);
65
+ for (const chain of over) {
66
+ console.error(`ERROR E1 ${chain.at(-1).path} — chain is ${total(chain)} bytes, over the ${MAX}-byte budget: ` +
67
+ chain.map((f) => `${f.path} (${f.size})`).join(' + '));
68
+ }
69
+ const largest = chains.reduce((a, b) => (total(b) > total(a) ? b : a));
70
+ console.log(`agents-md-budget: largest chain ${total(largest)} / ${MAX} bytes (${largest.at(-1).path}); ${over.length} over budget`);
71
+ process.exit(over.length > 0 ? 1 : 0);