@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
package/package.json CHANGED
@@ -1,6 +1,54 @@
1
1
  {
2
2
  "name": "@dall337/lore",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "LORE — Living Operational Rules & Evidence: a read-and-adapt governance suite for agent-driven development, with a local HUD for its board and journals.",
5
+ "keywords": [
6
+ "agents",
7
+ "governance",
8
+ "claude-code",
9
+ "codex",
10
+ "kanban",
11
+ "memory",
12
+ "policies",
13
+ "ai-agents"
14
+ ],
15
+ "homepage": "https://github.com/DalL337/agent-lore#readme",
16
+ "bugs": {
17
+ "url": "https://github.com/DalL337/agent-lore/issues"
18
+ },
19
+ "license": "MIT",
20
+ "type": "module",
21
+ "bin": {
22
+ "lore": "bin/lore.mjs"
23
+ },
24
+ "files": [
25
+ "bin",
26
+ "suite",
27
+ "hud/dist"
28
+ ],
29
+ "engines": {
30
+ "node": ">=20"
31
+ },
32
+ "repository": {
33
+ "type": "git",
34
+ "url": "git+https://github.com/DalL337/agent-lore.git"
35
+ },
36
+ "publishConfig": {
37
+ "access": "public"
38
+ },
39
+ "scripts": {
40
+ "prepack": "npm run build",
41
+ "build": "vite build --config hud/vite.config.ts && vite build --config hud/vite.config.ts --ssr server/main.ts",
42
+ "typecheck": "tsc -p hud/tsconfig.json",
43
+ "test": "node --test \"hud/test/*.test.ts\"",
44
+ "test:e2e": "npm run build && node hud/test/e2e/ui.e2e.mjs && node hud/test/e2e/cli.e2e.mjs",
45
+ "hud": "node bin/lore.mjs hud",
46
+ "demo": "npm run build && node hud/scripts/demo.mjs"
47
+ },
48
+ "devDependencies": {
49
+ "@fontsource/jetbrains-mono": "5.3.0",
50
+ "@types/node": "24.19.1",
51
+ "typescript": "7.0.2",
52
+ "vite": "8.3.2"
53
+ }
54
+ }
@@ -0,0 +1,228 @@
1
+ # AGENTS.md — Agent Governance Entry Point
2
+
3
+ > **Seed suite.** This governance suite was adopted from LORE — Living
4
+ > Operational Rules & Evidence — and is expected to diverge. It is
5
+ > read-and-adapt: when a rule here conflicts with this project's reality,
6
+ > fix the rule — with a dated note — rather than working around it. The
7
+ > transferable part is the method; the specifics are yours to earn.
8
+
9
+ ## 1. Purpose and Authority
10
+
11
+ This file is the first thing an agent reads in this repository. Everything
12
+ in it is either a policy to follow or a pointer to the document that owns
13
+ the details.
14
+
15
+ Order of authority:
16
+
17
+ 1. **Enforcement code** — guards, CI checks, and any ratified automated
18
+ gate. The enforced floor. When prose and enforcement disagree, the
19
+ enforcement wins and the prose gets fixed. The suite ships its first
20
+ guard: `scripts/memory-lint.mjs`, which checks memory-web form
21
+ (`policies/memory.md` §4). It is the model for what earned enforcement
22
+ looks like — as rules prove out, they graduate from prose to guards.
23
+ 2. **This file** — repository-wide process policy and the dispatch maps
24
+ below.
25
+ 3. **`policies/*`** — scoped procedures. Mandatory when a dispatch row
26
+ matches the task; they own execution detail within their scope.
27
+ 4. **Agent judgment** — governs everything the above does not. Judgment is
28
+ not a fallback of last resort; it is the default state of an
29
+ ungoverned scope, and the source of every future rule (§3).
30
+
31
+ ## 2. Two Maps
32
+
33
+ An agent's first question is which map applies.
34
+
35
+ ### 2.1 Greenfield — repository birth
36
+
37
+ If this repository has no established stack (no tooling register exists):
38
+
39
+ 1. Load `policies/tooling.md`. Take the owner's PRD, or create one first.
40
+ 2. Research candidates, build the tooling proposal, present it. The
41
+ owner's decisions birth the **tooling register** — the living record
42
+ every future stack question references.
43
+ 3. Load `policies/memory.md`. Resolve the memory configuration (§5), use
44
+ the established system when one exists, and bootstrap the bundled web
45
+ only when that is the chosen backend.
46
+ 4. Scaffold. Steady state begins.
47
+
48
+ ### 2.2 Steady state — policy dispatch
49
+
50
+ Read the work request, match it against this table, and load ONLY the
51
+ policies the task needs — never the whole suite. A policy loads BEFORE
52
+ the work it governs begins. Failure to load a matching policy is an
53
+ execution error.
54
+
55
+ | When the task involves… | Load and follow |
56
+ |---|---|
57
+ | First contact with this repo; configuring, reading, or writing repository memory | `policies/memory.md` — resolve the configured web entry point (§5), then walk the relevant rings; bootstrap the bundled files only when selected |
58
+ | Research, investigation, debugging, architecture discovery, repository exploration, documentation review, root-cause analysis | `policies/research.md` — **before the first tool call** (journal-first) |
59
+ | Writing or changing code (any language) | `policies/implementation.md` |
60
+ | Branching, committing, pushing, opening PRs | `policies/git.md` |
61
+ | Preparing any PR, completing a milestone/slice, changing an API or architecture boundary | `policies/verification.md` |
62
+ | Creating or updating repo documents (ADRs, plans, briefs, PRDs, notes) | `policies/documentation.md` |
63
+ | Release work: version bumps, bundling, release builds | `policies/release.md` |
64
+ | Security-relevant work: new execution/network surface, supply-chain features, audit passes | `policies/security.md` |
65
+ | Owner-requested adversarial deep dive; creating or changing an enforcement point or a guarantee about state ownership, lifetime, or ordering | `policies/adversarial-check.md` — trace the guarantee through the system before calling the slice done or opening its PR |
66
+ | Owner-invoked creative mode; exploring an inventive direction, an unusual connection, or an unfinished idea | `policies/creative.md` — develop possibilities with the owner; evaluation begins when requested |
67
+ | More than one agent may touch this repo; starting or ending a session in a shared repo; handing work off | `policies/orchestration.md` (with `policies/memory.md`) |
68
+ | Starting, moving, or finishing a unit of work when the board is the work-status record; filling an empty board | `policies/board.md` |
69
+ | Adding, upgrading, or replacing dependencies, frameworks, or languages; any stack question | `policies/tooling.md` |
70
+
71
+ A task matching multiple rows loads multiple policies. A code slice that
72
+ ends in a PR loads implementation + git + verification; an investigation
73
+ that produces an ADR loads research + documentation; a dependency swap
74
+ loads tooling + security + git.
75
+
76
+ > **Addendum (2026-10-17, provider memory areas):** Where a harness lets
77
+ > the agent write its own memory index, loading a policy also opens that
78
+ > policy's area from the index's hub (`policies/memory.md` §0).
79
+
80
+ ## 3. Provenance and Accumulation
81
+
82
+ This suite ships with **no incident history — deliberately.** The rules
83
+ below the entry point are starting principles distilled from a real
84
+ repository's lessons, with the incidents stripped. Your project's rules
85
+ will be earned here, on this repository, and they will carry their
86
+ origins.
87
+
88
+ **The accumulation loop is mandatory:**
89
+
90
+ 1. A lesson emerges — a bug ships, a check gets skipped, an audit finds a
91
+ loophole, a workflow fails in a way a rule would have prevented.
92
+ 2. The agent drafts the rule in the policy that owns the scope, carrying
93
+ the date and a description of the incident that produced it.
94
+ 3. The owner ratifies, amends, or rejects. Ratified rules are policy.
95
+ 4. The suite grows in place. Rules carry their origin on purpose: a rule
96
+ whose origin you can read is a rule you can argue with when it stops
97
+ fitting.
98
+
99
+ **Amendment discipline:** accepted rules grow by dated addenda and
100
+ corrections, never silent rewrites. History stays legible in the document
101
+ itself. (Full conventions: `policies/documentation.md`.)
102
+
103
+ **Housekeeping:** keep this suite free of personal or account data —
104
+ names, email addresses, account IDs, machine paths, third-party
105
+ identities. Rules describe *behavior* and cite roles ("the owner") and
106
+ artifacts (PR numbers, scripts, ADRs). Identity values live in local
107
+ config and agent memory, never in these files.
108
+
109
+ > **Addendum (2026-10-01, owner-directed policy expansion):** Added
110
+ > `policies/creative.md` for collaborative exploration and
111
+ > `policies/adversarial-check.md` for investigation of concrete guarantees.
112
+ > Their dispatch rows above define the triggers. Creative exploration
113
+ > moves into evaluation when the owner asks for it or selects a concrete
114
+ > proposal to develop.
115
+
116
+ > **Addendum (2026-10-02, owner-directed memory adaptation):** Memory may
117
+ > use the bundled web, an established agent or company system, or another
118
+ > location. The memory configuration in §5 is the entry point for that
119
+ > choice. Existing company and project conventions govern their stores;
120
+ > the bundled web's layout applies when that backend is selected.
121
+
122
+ > **Erratum (2026-10-02, owner clarification of the web):** The web's
123
+ > progression from repository categories to increasingly specific nodes is
124
+ > retained across providers. Configuration selects its storage and
125
+ > navigation mapping. A thin pointer index can expose those routes over
126
+ > existing agent or company memory without replacing its records.
127
+
128
+ > **Addendum (2026-10-17, owner-directed provider memory):** A harness's
129
+ > own memory coexists with the configured backend as a private layer
130
+ > governed by its provider's conventions. LORE writes only pointers into
131
+ > it, and anything another agent needs stays in the shared layer. Where
132
+ > the agent writes the provider's index, that index is a links-only hub
133
+ > over areas named for the policies, reserved scopes included, checked
134
+ > by `scripts/provider-memory.mjs`. The provider memory table in §5
135
+ > records each harness's store and LORE's use of it.
136
+
137
+ > **Addendum (2026-10-17, instruction budget):** Codex reads at most
138
+ > 32 KiB of `AGENTS.md` files along the path to its working directory and
139
+ > stops reading the rest. `scripts/agents-md-budget.mjs` holds every such
140
+ > chain under 30 KiB, leaving room for a global file. When an addendum
141
+ > would push past the budget, move its detail into the policy that owns
142
+ > the scope and leave a pointer here.
143
+
144
+ ## 4. Reserved Scopes
145
+
146
+ Empty policy files exist for scopes with no rules yet:
147
+
148
+ `planning` · `review` · `test-authoring` · `migration` ·
149
+ `failure-and-recovery`
150
+
151
+ An empty policy means no rules exist for that scope: proceed on general
152
+ judgment and this file, and when a lesson emerges, codify it there (with
153
+ provenance) rather than growing this file.
154
+
155
+ New scopes are allowed. When the first rule of a new kind needs a home,
156
+ create the stub in `policies/reserved/`, add its dispatch row, and place
157
+ the rule.
158
+
159
+ Two scopes from the ancestor suite were retired on generalization, their
160
+ duties absorbed: **dependency-change** lives in `policies/tooling.md`
161
+ (steady-state arm); **handoff** lives in `policies/orchestration.md` §5.
162
+
163
+ ## 5. Adaptation Slots
164
+
165
+ Read-and-adapt means most of this suite works as shipped, but a handful of
166
+ decisions are the adopting project's to make. Fill these deliberately, and
167
+ early — each is flagged at its site:
168
+
169
+ - **Tooling register + license allowlist** — `policies/tooling.md` §2.
170
+ The first register entry is the allowlist.
171
+ - **Standard check suite** — `policies/verification.md` Rule 1. Enumerate
172
+ the project's actual commands.
173
+ - **Merged-branch stance** (delete vs retain) — `policies/git.md` §1.4.
174
+ - **Version string locations** — `policies/release.md` Rule 1. Enumerate
175
+ every file that carries the version.
176
+ - **Memory storage and web entry point** — fill the memory configuration below;
177
+ `policies/memory.md` §0 owns selection and coexistence. For the bundled
178
+ web, also decide ignored vs committed per its §5. List each harness's
179
+ native memory in the provider memory table below.
180
+ - **Stale-claim threshold** — `policies/orchestration.md` §3.
181
+ - **Markdown lint stance** — `policies/documentation.md` Rule 6.
182
+ - **Work status** — memory-node ledgers or the LORE board
183
+ (`policies/board.md`); record the choice in the memory configuration
184
+ below.
185
+
186
+ Keep the dispatch table in sync with what actually exists. A row pointing
187
+ at a policy this project deleted is a trap for the next agent.
188
+
189
+ ### Memory Configuration
190
+
191
+ *(Adopt-time slot, added 2026-10-02.)* Record the chosen configuration in
192
+ this table, or replace it with a pointer to the project or company document
193
+ that owns the configuration. Honor an established choice before creating
194
+ a new store. These fields are prompts to fill, not a requirement to adopt
195
+ the bundled module.
196
+
197
+ | Field | Record on adoption |
198
+ |---|---|
199
+ | Storage provider | Bundled LORE files, agent-native/company memory, or an external store. |
200
+ | Web entry point | The repository-relative path, document reference, URI, or supported tool entry point for the repository's navigation hub. The bundled files start at `memory/INDEX.md`. |
201
+ | Navigation mapping | How broad repository categories lead through increasingly specific nodes to authoritative records; use provider links/categories or a thin index that points into the chosen store. |
202
+ | Scope and access | The repository's namespace or area; which agents can read and write; visibility across sessions, worktrees, and clones. |
203
+ | Coordination location | The same backend when it supports shared, verifiable claims; otherwise a separate shared file or service. |
204
+ | Work status | Where each unit of work's status lives: the web's node ledgers, or the LORE board (`.lore/board.json`, `policies/board.md`), whose cards the nodes then link. |
205
+ | History and checks | The chosen provider's update/retention rules and the checks available for its records. |
206
+ | Fallback | An approved alternate location or how unavailable memory is reported; no silent competing store. |
207
+
208
+ An agent-native entry point that exposes the repository web can be used
209
+ directly. The bundled file module is optional; the navigation can use a
210
+ provider's own structure or a thin pointer index in another location.
211
+ An external store may be as small as a shared project note with those routes.
212
+ The [memory policy](policies/memory.md#0-configured-memory) defines how
213
+ these choices interact with the suite's default conventions.
214
+
215
+ ### Provider Memory
216
+
217
+ *(Adopt-time slot, added 2026-10-17.)* One row per harness that works in
218
+ this repository. A harness's native memory is its private layer
219
+ ([memory policy §0](policies/memory.md#coexist-with-provider-native-memory)):
220
+ the provider's conventions govern it, and LORE writes only pointers
221
+ there. The seeded rows describe two harnesses as their vendors
222
+ documented them in October 2026. Confirm against current documentation,
223
+ and remove rows for harnesses this project does not use.
224
+
225
+ | Harness | Native memory | Written by | Load cap | LORE writes there | Visibility |
226
+ |---|---|---|---|---|---|
227
+ | Claude Code | [Auto memory](https://code.claude.com/docs/en/memory#auto-memory): `~/.claude/projects/<project>/memory/`, a `MEMORY.md` index with one file per memory. On by default. | The agent, during sessions | First 200 lines or 25KB of `MEMORY.md` each session; other files on demand | The hub and area indexes, links only, checked by `scripts/provider-memory.mjs` | One machine; shared by the repository's worktrees |
228
+ | Codex | [Memories](https://developers.openai.com/codex/memories): `~/.codex/memories/`, or under `CODEX_HOME`. Off by default. | Codex, in the background from past chats | Summary truncated to about 2,500 tokens ([openai/codex#48679](https://github.com/openai/codex/issues/48679)); `AGENTS.md` chain 32 KiB | Nothing; `AGENTS.md` is the pointer channel, held under 30 KiB by `scripts/agents-md-budget.mjs` | One machine; repository scoping undocumented |
@@ -0,0 +1,19 @@
1
+ @AGENTS.md
2
+
3
+ # CLAUDE.md
4
+
5
+ This repository's agent governance lives in **[AGENTS.md](AGENTS.md)**,
6
+ imported above.
7
+
8
+ Read it first, in full, before any other action. It carries the authority
9
+ order, the two maps (greenfield vs steady state), and the policy dispatch
10
+ table that says which of `policies/*` to load for the task at hand.
11
+
12
+ This file exists only as a pointer for harnesses that look for
13
+ `CLAUDE.md` by convention. `AGENTS.md` is the entry point of record; if
14
+ the two ever disagree, `AGENTS.md` wins and this file is what gets fixed.
15
+
16
+ > **Correction (2026-10-17):** Added the import line. Claude Code reads
17
+ > `AGENTS.md` on its own only when no `CLAUDE.md` is present, so a
18
+ > prose-only pointer here left loading `AGENTS.md` to the agent's
19
+ > discretion. The import loads it at session start.
@@ -0,0 +1,16 @@
1
+ {
2
+ "hooks": {
3
+ "PostToolUse": [
4
+ {
5
+ "matcher": "Write|Edit",
6
+ "hooks": [
7
+ {
8
+ "type": "command",
9
+ "command": "node",
10
+ "args": ["${CLAUDE_PROJECT_DIR}/scripts/provider-memory.mjs", "hook"]
11
+ }
12
+ ]
13
+ }
14
+ ]
15
+ }
16
+ }
@@ -0,0 +1,17 @@
1
+ # LORE — append the default-location rules you use to your .gitignore.
2
+ # Added 2026-10-02: these are the default in-repo locations. Resolve
3
+ # AGENTS.md's memory configuration first; /memory/ is only needed when
4
+ # using the bundled web. Adapt ignore paths for chosen local locations;
5
+ # external or agent-native memory needs no extra memory directory.
6
+ #
7
+ # Do NOT copy this file in as your .gitignore, and do not paste these
8
+ # without the leading slashes: an unanchored `memory/` matches at EVERY
9
+ # level, so it would silently ignore a src/memory/ module in your own
10
+ # source tree. The leading slash anchors each rule to your repo root.
11
+
12
+ # Agent memory web — gitignored by default; owner decision to commit
13
+ # (policies/memory.md §5). Record the decision in memory/INDEX.md.
14
+ /memory/
15
+
16
+ # Research journals — in-tree, never committed (policies/research.md)
17
+ /.research/
@@ -0,0 +1,41 @@
1
+ # Memory Hub
2
+
3
+ Entry point to this repository's memory web (`policies/memory.md`).
4
+ Every walk starts here. Append-only: strike-and-stamp deprecations,
5
+ replacements in-slot.
6
+
7
+ > **Addendum (2026-10-02, configurable memory):** This hub is the bundled
8
+ > module's entry point. First resolve the memory configuration in AGENTS.md
9
+ > §5; an established agent/company memory or external location can be the
10
+ > selected home instead. Bootstrap and register here only when this web is
11
+ > selected. A copied template is not evidence that it is the active store.
12
+
13
+ > **Erratum (2026-10-02, navigation clarification):** This file is one
14
+ > implementation of the repository hub. The same category-to-specific-node
15
+ > walk is preserved in the chosen provider or a configured pointer index.
16
+
17
+ ## Structural Decisions
18
+
19
+ > **START HERE — decide this before writing anything else.**
20
+ >
21
+ > **Is `memory/` committed, or gitignored?** Shipped default is
22
+ > **ignored**: add `/memory/` to your `.gitignore` — keep the leading
23
+ > slash, or it also matches `src/memory/`. Then delete this box and
24
+ > replace it with a dated entry saying what you chose.
25
+ >
26
+ > **Decide now, while this web is empty.** It is append-only, so the flip
27
+ > from ignored to committed publishes everything ever written here, all at
28
+ > once, and nothing can be removed afterward. Until you choose, write as
29
+ > if this web were already public.
30
+ >
31
+ > Tradeoffs and full reasoning: `policies/memory.md` §5.
32
+
33
+ - (dated entries: git status of memory/, convention adoptions, vocabulary extensions)
34
+
35
+ ## Agents
36
+
37
+ - (links to `memory/agents/<platform>.md` as platforms register — one file per platform, sessions as dated entries)
38
+
39
+ ## Areas
40
+
41
+ - (links to first-ring nodes as they are laid down)
@@ -0,0 +1,169 @@
1
+ # Adversarial Check Policy
2
+
3
+ Scoped agent-governance procedure (AGENTS.md §1/§2). Load for an
4
+ owner-requested adversarial deep dive, or before calling a slice done or
5
+ opening its PR when it creates or changes an enforcement point or a
6
+ guarantee about state ownership, lifetime, or ordering. These are starting
7
+ principles; this project's own findings and lessons accumulate here with
8
+ their provenance.
9
+
10
+ This policy triggers a fresh investigation through the system. State the
11
+ important guarantees, trace the actual behavior that supports them, and
12
+ actively seek counterexamples. Use the implementation, its explanation,
13
+ and its tests as evidence to investigate. A convincing account or a green
14
+ test suite does not establish what its evidence never exercised.
15
+
16
+ ## Rule 1 — Scope Follows the Guarantee
17
+
18
+ Applies to access and disclosure decisions; trust-boundary parsing and
19
+ validation; resource limits; check-then-act operations; concurrency fences;
20
+ and state or lifecycle signals another module relies on, such as "ready,"
21
+ "loaded," "saved," or "still current." It also applies to a review target
22
+ the owner explicitly selects for an adversarial deep dive.
23
+
24
+ Routine styling, copy, and changes outside these guarantees do not trigger
25
+ the pass. Security-review obligations remain in the
26
+ [security policy](security.md); the normal check suite remains in the
27
+ [verification policy](verification.md).
28
+
29
+ Include upstream and downstream code the selected guarantee depends on,
30
+ even when that code predates the slice or lives in another module. If a
31
+ consumer trusts a signal, the producer and the conditions under which it
32
+ emits that signal are in scope. Trace until the guarantee has a supported
33
+ foundation or a concrete unresolved assumption.
34
+
35
+ Record unrelated findings separately, with their severity and evidence.
36
+ Keep their repair outside the slice unless the owner expands its scope.
37
+
38
+ ## Rule 2 — Investigate Independently
39
+
40
+ Reconstruct behavior from the real entry points and execution paths.
41
+ Use the author's account to orient the investigation, then establish each
42
+ important claim through source inspection and, where possible, execution.
43
+ Read reused helpers and callers; follow transformations, ownership changes,
44
+ and side effects across module boundaries.
45
+
46
+ Actively look for the missing connection: individually reasonable pieces
47
+ can rely on incompatible assumptions when composed. Inspect what tests
48
+ substitute or hand directly to a consumer. A test that supplies a ready
49
+ signal establishes behavior under that supplied signal; investigate whether
50
+ the real producer emits it under the correct conditions.
51
+
52
+ The author or a reviewer can perform this pass. A second agent is optional;
53
+ do not spawn subagents by default. Independent investigation is required
54
+ regardless of who performs it.
55
+
56
+ ## Rule 3 — The Deep Dive
57
+
58
+ 1. **State the claims.** Write one sentence per important guarantee,
59
+ including guarantees implied by the interface. Identify the input,
60
+ state, or observable outcome it covers.
61
+ 2. **Trace the full chain.** Follow the real input through normalization,
62
+ checks, state transitions, side effects, and consumers. Locate the
63
+ producer of every trusted signal and the object ultimately acted on.
64
+ Cite the relevant paths and symbols.
65
+ 3. **Expose the assumptions.** Identify what must be true about identity,
66
+ timing, ownership, ordering, platform behavior, and failure handling.
67
+ Establish where each condition is enforced. Keep an unsupported
68
+ assumption visible as an investigation target.
69
+ 4. **Explore alternate paths.** Trace other routes to the same effect,
70
+ including retries, reopening, cancellation, restoration, errors, and
71
+ stale work completing after a context switch. Apply Rule 4's questions
72
+ where they affect the guarantee.
73
+ 5. **Construct counterexamples.** Choose inputs and transitions that could
74
+ invalidate those assumptions. Exercise the real chain where practical.
75
+ For a race, introduce a test seam inside the exact check/use window and
76
+ change the state there; a change made before the check does not exercise
77
+ that window. Use disposable fixtures for destructive scenarios.
78
+ 6. **Demonstrate the failure.** Run a suspected reproduction against the
79
+ unfixed code. Preserve the script or test, observed output, revision,
80
+ and relevant environment. If execution is impractical, record why and
81
+ keep the finding qualified under Rule 5.
82
+ 7. **Verify the repair.** Run the same reproduction, unchanged, against the
83
+ fix. Verify each affected platform or environment where behavior differs;
84
+ name outstanding coverage explicitly. Examine new assumptions introduced
85
+ by the fix, including a second-order failure in its own checks.
86
+
87
+ ## Rule 4 — Questions That Open the Trace
88
+
89
+ These questions are prompts for investigation. Follow the relevant answer
90
+ into the code and behavior; checking a box is not evidence.
91
+
92
+ - **Identity and lifetime.** Is the object checked the object used? Can a
93
+ name, alias, copied identifier, counter, or reopened session identify a
94
+ different object or generation? What survives a context switch?
95
+ - **Check versus use.** What can change after validation or authorization
96
+ and before the operation? Is the eventual handle, snapshot, or state still
97
+ covered by the check? Does resolving a name change which object is acted
98
+ on?
99
+ - **Producer versus consumer.** Does a signal certify work its producer
100
+ actually completed for this context? Trace synchronous completion,
101
+ delayed completion, empty data, restoration, cleanup, and re-entry.
102
+ - **Ordering and refusal.** Can state announce success before a refusable
103
+ side effect succeeds? What happens after partial failure, cancellation,
104
+ duplicate execution, or a late result?
105
+ - **Bounds.** Are limits enforced on what is actually read, allocated,
106
+ processed, and emitted, including encoding, aggregate work, and concurrent
107
+ callers? Exercise the exact limit and the smallest input beyond it.
108
+ - **Alternate routes and observations.** Can another operation produce the
109
+ guarded effect? Can names, counts, errors, or timing expose something
110
+ withheld? Follow the exception and effect-equivalent-path method in
111
+ [security policy Rule 4](security.md#rule-4--chokepoint-exceptions-inherit-every-exemption).
112
+ - **Failure and platform differences.** What do missing state, failed OS
113
+ queries, unsupported behavior, and each supported platform do to the
114
+ guarantee? For a permission decision, an unresolved check must refuse.
115
+ Distinguish the behavior actually exercised from behavior inferred by
116
+ inspection.
117
+
118
+ ## Rule 5 — Evidence Status
119
+
120
+ Every finding has an explicit status. Report only what its evidence proves.
121
+
122
+ | Status | Meaning | Required evidence |
123
+ |---|---|---|
124
+ | **Suspected** | Inspection or reasoning indicates a possible failure. | The claim, source references, and a proposed reproduction. |
125
+ | **Reproduced** | The unfixed code demonstrated the failure. | A repeatable test or script, observed output, revision, and relevant environment. |
126
+ | **Verified fixed** | The same reproduction succeeds against the repair. | The unchanged reproduction and the run proving the corrected behavior in each claimed environment. |
127
+
128
+ A source-inspection finding begins as `suspected`, including a peer
129
+ reviewer's finding. A property established only by inspection is reported
130
+ as `suspected, confirmed by inspection`, with its citations; it is not
131
+ called reproduced. A passing functional test does not establish a resource
132
+ bound that it never measured.
133
+
134
+ When behavior differs by platform or environment, qualify status for each.
135
+ A repair that has not been exercised is described as `fix applied,
136
+ unverified`, alongside the last established finding status. Do not report
137
+ it as verified fixed.
138
+
139
+ A failed reproduction attempt stays in the record. Keep the finding
140
+ suspected, or explicitly withdraw it with the evidence and reason. Failure
141
+ to reproduce does not establish safety. State the status whenever the
142
+ finding is reported in a journal, PR, or conversation.
143
+
144
+ ## Rule 6 — Budget and Completion
145
+
146
+ Perform one pass per selected guarantee per slice; repeat for guarantees
147
+ affected by later changes. Scale the number of guarantees and experiments
148
+ to the change and its consequences. Keep each selected guarantee's trace
149
+ deep enough to examine its dependencies. Do not replace that investigation
150
+ with a shallow checklist to meet a line count or time budget.
151
+
152
+ A plausible disclosure, write, execution, data-loss, or wrong-context
153
+ failure needs a deliberate reproduction attempt and before/after evidence
154
+ for its repair. Lower-impact concerns can remain suspected with a clear
155
+ note. If a trace cannot be completed within the available scope, record the
156
+ unresolved assumption and what would establish it; do not call that
157
+ guarantee verified.
158
+
159
+ Log the pass in the slice's research journal under the
160
+ [research policy](research.md). Record the guarantees, the important trace
161
+ references, short attack verdicts, findings with their statuses, and
162
+ remaining gaps. A PR summary links that record and states material findings
163
+ and unresolved verification.
164
+
165
+ Planted mistakes remain useful for checking the failures already imagined.
166
+ This pass actively searches for additional failure modes. When a later
167
+ review finds a flaw the pass should have caught, append the project's own
168
+ lesson with its date, provenance, evidence, and the question or tracing
169
+ habit it sharpens, following AGENTS.md §3.
@@ -0,0 +1,103 @@
1
+ # Board Policy
2
+
3
+ Scoped agent-governance procedure (AGENTS.md §1/§2). Load when the LORE
4
+ board is this repository's work-status record (AGENTS.md §5, memory
5
+ configuration) and the task starts, moves, or finishes a unit of work;
6
+ and when the board is empty or missing and the owner wants it filled.
7
+
8
+ *(Added 2026-10-17, owner-directed: the board generalizes a project
9
+ kanban into LORE. Its first rule is that project's standing owner rule,
10
+ "keep the board current".)*
11
+
12
+ ## 1. What the Board Is
13
+
14
+ The board (`.lore/board.json`, shown by `lore hud`) holds one card per
15
+ unit of work, in a column that says where the work stands. It is private
16
+ by default: `.lore/` stays out of git unless the owner opts in.
17
+
18
+ - **It is a status record, not a coordination substrate.** Claims stay at
19
+ the configured coordination location (`policies/orchestration.md` §0).
20
+ A card may link the node or record that holds the claim.
21
+ - **It points; it does not explain.** Detail lives in journals, docs,
22
+ decision records, and PRs. A card's notes are a line or two.
23
+ - **When the board is the status record, memory nodes link cards** rather
24
+ than keeping a second status ledger for the same work.
25
+ - **Cards never point into a harness's private memory.** Provider memory
26
+ may point at card ids (`policies/memory.md` §0); anything another agent
27
+ needs goes on the card, in a journal, or in a doc.
28
+
29
+ ## 2. Keep It Current
30
+
31
+ When work moves, update the board in the same session:
32
+
33
+ | The work… | The card… |
34
+ |---|---|
35
+ | starts | exists in the active column, linked to its journal |
36
+ | opens a PR | links the PR |
37
+ | waits on the owner (review, ruling, merge, live pass) | moves to the review column |
38
+ | waits on something outside the repository | moves to blocked, with a one-line note |
39
+ | merges or ships | moves to done, with its PRs linked |
40
+
41
+ With the HUD running, use its API so the open page updates at once:
42
+ `POST /api/board/card` with `{ "card": { … } }` creates or updates,
43
+ `POST /api/board/move` with `{ "id", "column", "index" }` moves. Without
44
+ it, edit the file and keep it valid JSON; the HUD never overwrites a file
45
+ it cannot parse. A session that cannot write the board (a read-only
46
+ review, a worktree without `.lore/`) reports the implied changes instead.
47
+
48
+ ## 3. Bootstrap an Empty Board
49
+
50
+ When the board is empty or missing and the owner asks to fill it:
51
+
52
+ 1. **Journal first** (`policies/research.md`): the survey is an
53
+ investigation.
54
+ 2. **Read the repository:** README, docs and decision records, open PRs
55
+ and issues (`gh`), recent history and branches, TODO and FIXME
56
+ markers, existing journals.
57
+ 3. **Propose areas:** the repository's broad categories, the same first
58
+ ring as the memory web. Each is a short key and a one-line
59
+ description.
60
+ 4. **Propose cards:** units of work with their evidence links, each in a
61
+ column. Open PRs, open issues, and active journals already appear in
62
+ the HUD's Inbox; make those cards from the Inbox rather than by hand.
63
+ 5. **Write only what the owner approves**, then link the journal from the
64
+ cards it produced.
65
+
66
+ ## 4. The Board File
67
+
68
+ ```jsonc
69
+ {
70
+ "version": 1,
71
+ "columns": [
72
+ // role tells the HUD what a column means: intake (issues land here),
73
+ // active (journals), review (PRs, owner's attention), blocked, done.
74
+ // Each role is on at most one column; a column may have none.
75
+ { "id": "doing", "title": "In progress", "led": "pulse", "hint": "Active now", "role": "active" }
76
+ ],
77
+ "areas": { "api": "Public API: endpoints, SDK, versioning" },
78
+ "cards": [
79
+ {
80
+ "id": "rate-limits", // unique; a readable slug
81
+ "title": "Rate limits on the public API",
82
+ "column": "next", // a column id
83
+ "area": ["api"], // area keys
84
+ "notes": "One or two lines.",
85
+ "links": {
86
+ "journals": ["2026-10-06-rate-limits.md"], // in the journals folder
87
+ "prs": [108], "issues": [12],
88
+ "docs": ["docs/adrs/004-rate-limits.md"] // repo-relative
89
+ },
90
+ "created": "2026-10-06", "updated": "2026-10-11"
91
+ }
92
+ ]
93
+ }
94
+ ```
95
+
96
+ - Card order within a column is the order of the `cards` array.
97
+ - Moving work: change `column` and bump `updated`.
98
+ - In an update, a field left out keeps its value; `null` clears it.
99
+ - LEDs: `empty` · `blue` · `pulse` · `amber` · `red` · `green`.
100
+ - The HUD rejects duplicate ids, unknown columns, a role on two columns,
101
+ and cards without an id or title.
102
+ - `journals` (owner close marks) and `inboxDismissed` belong to the HUD;
103
+ leave them to it.