geneseed 5.2.0 → 5.3.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.
- package/CHANGELOG.md +27 -0
- package/README.md +2 -2
- package/SHIPPED.md +1 -1
- package/adapters/opencode/plugins/geneseed-context.js +56 -10
- package/adapters/opencode/plugins/geneseed-guard.js +6 -1
- package/bin/geneseed-cli.mjs +61 -16
- package/bin/geneseed-hook.mjs +37 -3
- package/docs/concepts/factories.md +40 -6
- package/docs/concepts/footprint.md +1 -1
- package/docs/concepts/foreman-mode.md +2 -2
- package/docs/concepts/loop-gates.md +1 -1
- package/docs/concepts/loops.md +2 -2
- package/docs/concepts/shared-tier.md +1 -1
- package/docs/design-history.md +140 -0
- package/docs/extending.md +54 -162
- package/docs/guides/run-a-factory.md +15 -2
- package/docs/guides/upgrade.md +2 -2
- package/docs/reference/factory-actions.md +6 -5
- package/docs/reference/troubleshoot-update.md +1 -1
- package/docs/web-ui.md +16 -3
- package/harness.config.json +1 -1
- package/js/README.md +4 -3
- package/js/build/args.mjs +3 -3
- package/js/build/render.mjs +44 -24
- package/js/cli-table.json +135 -59
- package/js/factory/cli.mjs +24 -5
- package/js/factory/graph.mjs +13 -9
- package/js/factory/metrics.mjs +93 -0
- package/js/factory/registry.mjs +37 -12
- package/js/factory/state.mjs +25 -6
- package/js/hosts/hooks-context.mjs +26 -1
- package/js/hosts/hooks-prims.mjs +52 -3
- package/js/hosts/hooks.mjs +50 -29
- package/js/hosts/loss.mjs +6 -1
- package/js/inspect/diff.mjs +16 -1
- package/js/inspect/doctor.mjs +7 -3
- package/js/inspect/excludes.mjs +18 -6
- package/js/inspect/status.mjs +35 -7
- package/js/inspect/validate.mjs +44 -21
- package/js/maintain/uninstall.mjs +28 -1
- package/js/maintain/update.mjs +31 -7
- package/js/ui/cli.mjs +34 -4
- package/js/ui/menu.mjs +1 -1
- package/js/ui/tui.mjs +11 -14
- package/js/web/actions.mjs +2 -0
- package/js/web/api.mjs +28 -10
- package/js/web/daemon.mjs +0 -1
- package/js/web/server.mjs +1 -0
- package/js/web/state.mjs +37 -16
- package/package.json +1 -1
- package/src/AGENT.md.tmpl +23 -17
- package/src/agents/_template.md +1 -1
- package/src/agents/advocate.md +1 -1
- package/src/agents/developer.md +12 -3
- package/src/agents/empiricist.md +1 -1
- package/src/agents/framer.md +1 -1
- package/src/agents/historian.md +1 -1
- package/src/agents/operator.md +1 -1
- package/src/agents/pragmatist.md +1 -1
- package/src/agents/researcher.md +1 -1
- package/src/agents/skeptic.md +1 -1
- package/src/agents/steward.md +1 -1
- package/src/agents/user-advocate.md +1 -1
- package/src/agents/visionary.md +1 -1
- package/src/bricks/intake.md +10 -3
- package/src/bricks/retro.md +13 -3
- package/src/doctrines/comms.md +1 -1
- package/src/doctrines/ops.md +1 -1
- package/src/doctrines/process.md +7 -5
- package/src/factories/analysis-to-build.json +1 -0
- package/src/factories/bug-report-to-fix.json +1 -0
- package/src/factories/issue-to-pr.json +1 -0
- package/src/laws/universal.md +2 -2
- package/src/modes/foreman.md +8 -14
- package/src/skills/commit.md +7 -2
- package/src/skills/debug.md +1 -1
- package/src/skills/diagram-design/SKILL.md +1 -1
- package/src/skills/diagram-design/VENDOR.md +3 -1
- package/src/skills/factory-forge.md +5 -3
- package/src/skills/factory.md +22 -1
- package/src/skills/geneseed.md +1 -1
- package/src/skills/handoff.md +1 -1
- package/src/skills/parallel-agents.md +1 -1
- package/src/skills/pipeline.md +6 -6
- package/src/skills/plan.md +7 -3
- package/src/skills/spring-testing.md +1 -1
- package/themes/biker.json +78 -78
- package/themes/commentator.json +81 -81
- package/themes/cyberpunk.json +79 -79
- package/themes/gamer.json +77 -77
- package/themes/imperial.json +82 -82
- package/themes/joker.json +79 -79
- package/themes/marvin.json +82 -82
- package/themes/mean.json +82 -82
- package/themes/military.json +78 -78
- package/themes/neutral.json +78 -78
- package/themes/pirate.json +79 -79
- package/themes/sports.json +79 -79
- package/themes/verstappen.json +78 -78
- package/themes/wizard.json +79 -79
- package/web/dist/assets/ActiveLoops-BJJN3P-V.js +1 -0
- package/web/dist/assets/Activity-CqJiquEq.js +1 -0
- package/web/dist/assets/ActivityDetail-BSzevynX.js +1 -0
- package/web/dist/assets/{Bonsai-DSwUbavu.js → Bonsai-Bfpb6W-1.js} +1 -1
- package/web/dist/assets/{CopyButton-BzRQz7k2.js → CopyButton-ByIntFtB.js} +1 -1
- package/web/dist/assets/Dashboard-DBOEi9lQ.js +2 -0
- package/web/dist/assets/Docs-DvlMJhpu.js +5 -0
- package/web/dist/assets/Factories-Bpvv7L2H.js +1 -0
- package/web/dist/assets/{GreenhouseView-y9WAfcc_.js → GreenhouseView-GpBsYn50.js} +1 -1
- package/web/dist/assets/Installs-BlGmVrFK.js +3 -0
- package/web/dist/assets/{JournalView-DeBLRNGc.js → JournalView-iLuLrOxE.js} +1 -1
- package/web/dist/assets/Kits-DRwpxC-J.js +1 -0
- package/web/dist/assets/Laws-CZkiNOWQ.js +4 -0
- package/web/dist/assets/LibRows-DEHjIoD-.js +1 -0
- package/web/dist/assets/Library-B4K-1iNF.js +3 -0
- package/web/dist/assets/Loops-BWSzaW8E.js +2 -0
- package/web/dist/assets/{OperatorHudView-2ujVMjq1.js → OperatorHudView-BAXwCEvY.js} +1 -1
- package/web/dist/assets/Personal-Bp9nV4GR.js +2 -0
- package/web/dist/assets/Settings-CWWuaIp-.js +1 -0
- package/web/dist/assets/Tabs-CWeQTADL.js +1 -0
- package/web/dist/assets/index-CsAZq0BQ.css +1 -0
- package/web/dist/assets/index-How7SzDZ.js +6 -0
- package/web/dist/assets/usePoll-D5c_qIFZ.js +1 -0
- package/web/dist/index.html +2 -2
- package/web/dist/assets/ActiveLoops-BTHIaRhn.js +0 -1
- package/web/dist/assets/Activity-DlQ30znB.js +0 -1
- package/web/dist/assets/ActivityDetail-CG0mn5fW.js +0 -1
- package/web/dist/assets/Dashboard-Ce3UOsxJ.js +0 -2
- package/web/dist/assets/Docs-CisVnYqv.js +0 -5
- package/web/dist/assets/Factories-Dq5oW4CU.js +0 -1
- package/web/dist/assets/Installs-m4GElwFW.js +0 -3
- package/web/dist/assets/Kits-DJYVAnyE.js +0 -1
- package/web/dist/assets/Laws-CNpc_8ZV.js +0 -4
- package/web/dist/assets/LibRows-RO5bvXth.js +0 -1
- package/web/dist/assets/Library-Dg0ScciC.js +0 -3
- package/web/dist/assets/Loops-CjEdo-NG.js +0 -2
- package/web/dist/assets/Personal-D0yS7ahT.js +0 -2
- package/web/dist/assets/Settings-DEN0U8QI.js +0 -1
- package/web/dist/assets/Tabs-But5R6_r.js +0 -1
- package/web/dist/assets/index-Ck42AbRX.js +0 -6
- package/web/dist/assets/index-PG_ukkh6.css +0 -1
- package/web/dist/assets/usePoll-o8ul-Sog.js +0 -1
package/docs/web-ui.md
CHANGED
|
@@ -359,7 +359,7 @@ screen the run list stacks above the detail.
|
|
|
359
359
|
grey block, a fork amber, a `loop:` stage a teal box that names its loop (without `loop:`)
|
|
360
360
|
over `whole loop`, or `not in catalogue` when this install lacks it; the ring itself is on the
|
|
361
361
|
Loops page. A fork is what the engine calls one: a brick that declares a named outcome
|
|
362
|
-
(one outside `pass`, `fail`, `error`, `none
|
|
362
|
+
(one outside `pass`, `fail`, `error`, `none`, `needs-info` and `reject`), never a `loop:` stage, however
|
|
363
363
|
many stages its edges reach. The targets of a fork share a row, side by side, each lane labelled with its outcome,
|
|
364
364
|
and join again at the first stage every lane reaches. Each route back (an edge into a cycle's
|
|
365
365
|
first stage, the edge that spends a lap, `$lane` included) is a rail on the left labelled
|
|
@@ -376,13 +376,26 @@ screen the run list stacks above the detail.
|
|
|
376
376
|
factory's rules. It reads `GET /api/factories/catalog` for the install the *Install:* picker
|
|
377
377
|
names. **Active** is every run `geneseed factory init` registered on this machine
|
|
378
378
|
(`GET /api/factories/active`, polled every 5 s, the graph read from each run's `FACTORY.md`),
|
|
379
|
-
|
|
379
|
+
shown as a **board** while no run is selected: three columns of cards, **Waits for you** (a
|
|
380
|
+
held gate, or a `FACTORY.md` that cannot be read), **Running**, and **Ended** (stopped, closed,
|
|
381
|
+
or its `FACTORY.md` gone). A card gives the run's title, its factory, and one line of facts: where it
|
|
382
|
+
stands (a held gate as `stage · outcome`), its task as `i/n`, its work time so far, the wait
|
|
383
|
+
still open at its gate (`waiting 25 min`), and each cycle spent above 0 as `name n/max`. A
|
|
384
|
+
run with no state says why instead. The list beside it groups the runs under the same three
|
|
385
|
+
names, each row with the same facts under its factory, and while a run is open the list's
|
|
386
|
+
header names it by its title. A card opens the run: the reader
|
|
387
|
+
shows the run's stage, transitions, task number, its
|
|
380
388
|
child loop's step and iteration, what it awaits, and its graph with the current stage lit,
|
|
381
389
|
the lane its last fork took (the run's `lane`, else read from its `history`) lit, the child
|
|
382
390
|
loop's node named under the current stage (`at <node>`) and each cycle's laps as `n / max`. A
|
|
383
391
|
run carries its graph but no bricks or loops: the graph borrows those from the catalogue of the
|
|
384
392
|
install the Templates tab's picker names, which the run's project may not share, and the reader
|
|
385
|
-
says which.
|
|
393
|
+
says which. Under the graph, a **timeline** has one row per history entry: the stage, its
|
|
394
|
+
outcome or your answer at a gate, the time it was recorded (UTC), its duration (waiting time on
|
|
395
|
+
an answer) and a rework mark. A held run names its gate's stage, its outcome and the path of
|
|
396
|
+
its note; the console does not read the note. The numbers are the ones `geneseed factory report`
|
|
397
|
+
prints, and a time nobody recorded reads `unknown`. The board changes nothing: you answer a gate
|
|
398
|
+
in the agent's session. No run reports tab: a run's report lives in its own worktree.
|
|
386
399
|
- **Profile** (`#/profile`) — `PROFILE.md`: who you are and how you like to work, one card
|
|
387
400
|
per file: the shared one every global install reads, tagged `shared`, and each project
|
|
388
401
|
install's own. Opens rendered; **Edit** is a whole-file editor. The save carries
|
package/harness.config.json
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
"_comment": "version is a human-readable release label only; the canonical identity of an installed harness is the source fingerprint stamped in .geneseed-version (see `harness version`), not this string.",
|
|
3
3
|
"theme": "neutral",
|
|
4
4
|
"product": "Geneseed",
|
|
5
|
-
"version": "5.
|
|
5
|
+
"version": "5.3.0"
|
|
6
6
|
}
|
package/js/README.md
CHANGED
|
@@ -39,7 +39,7 @@ layers. These pairs import each other (relative imports between folders, measure
|
|
|
39
39
|
| build ↔ hosts | 24 / 5 | hosts reads `build/source.mjs` (`installs`, `link`, `native`, `opencode`) and `build/version.mjs` (`opencode`) |
|
|
40
40
|
| build ↔ inspect | 2 / 23 | `build/driver.mjs` records deploy roots in `inspect/registry.mjs`; `build/catalog.mjs` reads `inspect/inventory.mjs` |
|
|
41
41
|
| build ↔ loop | 4 / 1 | `loop/catalog.mjs` reads `build/source.mjs` |
|
|
42
|
-
| build ↔ ui | 2 /
|
|
42
|
+
| build ↔ ui | 2 / 2 | `ui/cli.mjs` reads `ROOT` from `build/source.mjs` and the generator's choice lists from `build/args.mjs` |
|
|
43
43
|
| build ↔ web | 1 / 9 | `build/generate.mjs` lazily imports `web/daemon.mjs` to restart a stale console after `rebuild-all` |
|
|
44
44
|
| hosts ↔ inspect | 1 / 36 | `hosts/installs.mjs` reads `inspect/registry.mjs`'s deploy roots |
|
|
45
45
|
| ui ↔ web | 1 / 1 | `ui/menu.mjs` starts the daemon; `web/docs.mjs` renders `ui/cli.mjs`'s CLI reference |
|
|
@@ -217,8 +217,9 @@ brick or a whole loop; a fork's named outcomes pick its lane), persisted as a JS
|
|
|
217
217
|
|---|---|
|
|
218
218
|
| `graph.mjs` | `checkFactory` — the rules a factory must satisfy before a stage runs: stages exist, edges cover every outcome, `$close` is reachable, every cycle is declared (the loop engine's `undeclaredCycles`), `$lane` only behind a fork, `protected` a list of paths, and every `review.seats` entry a shipped agent. Also the fork helpers the engine shares: `isFork`, `lanesOf`, `laneTargets`, `spentCycle` |
|
|
219
219
|
| `state.mjs` | The engine itself: `initFactory`, `nextStage`, `recordStage`, `decideFactory`, `renderFactoryFile`/`parseFactoryFile`, `validateFactoryState`, `countSpecTasks` |
|
|
220
|
-
| `
|
|
221
|
-
| `
|
|
220
|
+
| `metrics.mjs` | `runMetrics(state, { now })` — pure: per stage its runs, reworks, work time and tokens, and per run its work time, waiting time, the wait still open at a held gate (to `now`, which the caller reads), tokens and transitions, from the history's `at` stamps. Unknown is `null`, never 0. The one writer of those numbers: `factory report` prints it, and the console reads it through `registry.mjs` |
|
|
221
|
+
| `cli.mjs` | `geneseed factory check\|list\|init\|next\|record\|decide\|report` — the only face of this engine. It reads the clock; the engine stays pure |
|
|
222
|
+
| `registry.mjs` | `factories.json` beside `loops.json`: `recordFactory` (called by `factory init`, and the one place the registry is swept and pruned), `listFactories` (the console's read-only rows, each live row with its `metrics`), on the loop registry's own `loadRows`/`saveRows`/`sweepRows`. A run and its child loop share a root, which is how a reader groups them |
|
|
222
223
|
|
|
223
224
|
**Before editing:** `FACTORY.md` is in `js/loop/state.mjs`'s `ENGINE_FILES`, so a child loop never
|
|
224
225
|
scores it; the clean-tree check after a stage outside a loop filters with that same list. `cli.mjs`
|
package/js/build/args.mjs
CHANGED
|
@@ -99,14 +99,14 @@ export function configDefaults(config = CONFIG, rules = ruleCanon(SRC).rules) {
|
|
|
99
99
|
* own private copy of the flags is a second source that drifts silently the first time a
|
|
100
100
|
* flag is added to one and not the other, and nothing downstream would say so.
|
|
101
101
|
*/
|
|
102
|
-
const VALUED = {
|
|
102
|
+
export const VALUED = {
|
|
103
103
|
'--theme': 'theme', '--posture': 'posture', '--mode': 'mode', '--trust': 'trust',
|
|
104
104
|
'--doctrines': 'doctrines', '--exclude-rules': 'excludeRules', '--exclude-skills': 'excludeSkills',
|
|
105
105
|
'--kits': 'kits', '--shared-tier': 'sharedTier',
|
|
106
106
|
'--out': 'out', '--target': 'out', '--emit': 'emit',
|
|
107
107
|
'--footprint': 'footprint', '--root': 'root', '--config-dir': 'cfgDir',
|
|
108
108
|
};
|
|
109
|
-
const FLAGS = {
|
|
109
|
+
export const FLAGS = {
|
|
110
110
|
'--sync-themes': 'syncThemes', '--validate-only': 'validateOnly',
|
|
111
111
|
// The gate switches (`GATE_SWITCHES`, law order). No `harness.config.json` key feeds them,
|
|
112
112
|
// deliberately: a rebuild elides a flag when armed, so a config default could disarm an armed
|
|
@@ -155,7 +155,7 @@ const FLAG_BY_NAME = Object.fromEntries(
|
|
|
155
155
|
* advertised a metavar that lies. It is validated by `parseDoctrines` instead and prints the
|
|
156
156
|
* plain `DOCTRINES` metavar, exactly as `--theme` (also open-ended) already does.
|
|
157
157
|
*/
|
|
158
|
-
function choicesFor() {
|
|
158
|
+
export function choicesFor() {
|
|
159
159
|
return {
|
|
160
160
|
'--emit': EMITS,
|
|
161
161
|
'--footprint': ['lean', 'full'],
|
package/js/build/render.mjs
CHANGED
|
@@ -35,7 +35,7 @@ import { parseJson } from '../lib/json.mjs';
|
|
|
35
35
|
import { normcase, comparePaths } from '../lib/paths.mjs';
|
|
36
36
|
// `js/build/source.mjs` imports nothing but node builtins, so this direction cannot cycle.
|
|
37
37
|
import {
|
|
38
|
-
CREDIT_RE, GATE_SWITCHES, PACK_ORDER, kitMembers, loadKits, readPackText, resolveCredits, resolveRuleIds, ruleCanon, upstreamOf,
|
|
38
|
+
CREDIT_RE, GATE_SWITCHES, PACK_ORDER, kitMembers, loadKits, readPackText, resolveCredits, resolveRuleIds, ruleCanon, titleKey, upstreamOf,
|
|
39
39
|
} from './source.mjs';
|
|
40
40
|
import { SHARED_TIER_LINE } from '../hosts/hosts.mjs';
|
|
41
41
|
import { VENDORED_SKILL_DIRS } from '../hosts/native.mjs';
|
|
@@ -296,14 +296,41 @@ export function splitAtLawHeadings(text) {
|
|
|
296
296
|
return out;
|
|
297
297
|
}
|
|
298
298
|
|
|
299
|
-
/**
|
|
300
|
-
|
|
299
|
+
/**
|
|
300
|
+
* The one pointer at lean, closing §2 for both tiers: the laws' and the rules' lean text is
|
|
301
|
+
* authored in LEAN blocks, and this names where the complete text of each lives. It was two notes,
|
|
302
|
+
* one under each section, saying the same thing (owner decision D2, 2026-11-11).
|
|
303
|
+
*/
|
|
304
|
+
export function briefPointer(theme, lawsPrefix = '', anyPack = true) {
|
|
301
305
|
const law = theme.LAW ?? 'Law';
|
|
306
|
+
const doctrine = theme.DOCTRINE ?? 'Doctrine';
|
|
302
307
|
const lawsDir = theme.DIR_LAWS ?? 'laws';
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
308
|
+
const dir = theme.DIR_DOCTRINES ?? 'doctrines';
|
|
309
|
+
// With no pack active only the laws are above; the packs' folder is still named, as it ships.
|
|
310
|
+
const above = anyPack ? `${law} and ${doctrine}` : law;
|
|
311
|
+
return `> Each ${above} above is given in brief — the rule, not its reasoning. `
|
|
312
|
+
+ `The complete text is in \`${lawsPrefix}${lawsDir}/universal.md\` (binding) and in `
|
|
313
|
+
+ `\`${lawsPrefix}${dir}/\` (every pack, active or not). Read the matching file whenever a rule's application `
|
|
314
|
+
+ `is unclear; read \`${lawsPrefix}${lawsDir}/universal.md\` before any act touching secrets, `
|
|
315
|
+
+ 'deletion, git history, scope, or untrusted content.';
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* LEAN DROPS THE VOICE'S HALF of each rule title and the italic epigraph under each § heading
|
|
320
|
+
* (owner decision D2, 2026-11-11). A theme spells a title `Arcana Sigillata · Sealed Secrets`;
|
|
321
|
+
* lean renders the principle alone, the name every citation already renders (`*Sealed
|
|
322
|
+
* Secrets*`), so one rule reads the same at its heading and where it is cited. Done here, on the
|
|
323
|
+
* unsubstituted tokens, so all fourteen voices follow without a theme edit. Keyed on the PER-FILE
|
|
324
|
+
* footprint: the on-disk `laws/`, `ontology/` and `doctrines/` render full even in a lean install,
|
|
325
|
+
* keep the voice, and are what `js/inspect/inventory.mjs` and the console parse.
|
|
326
|
+
*/
|
|
327
|
+
const TITLE_TOKEN_RE = /\{\{((?:LEX|DOC)_[A-Z0-9_]+)\}\}/g;
|
|
328
|
+
const EPIGRAPH_LINE_RE = /^\*\{\{EPI_[A-Z_]+\}\}\*\n\n/gm;
|
|
329
|
+
function leanVoice(text, src) {
|
|
330
|
+
text = text.replace(EPIGRAPH_LINE_RE, '');
|
|
331
|
+
if (!text.includes('{{LEX_') && !text.includes('{{DOC_')) return text;
|
|
332
|
+
const names = new Map(ruleCanon(src).rules.map((r) => [titleKey(r.kind, r.id), r.name]));
|
|
333
|
+
return text.replace(TITLE_TOKEN_RE, (whole, key) => names.get(key) ?? whole);
|
|
307
334
|
}
|
|
308
335
|
|
|
309
336
|
/**
|
|
@@ -392,17 +419,14 @@ export function renderFile(cfg, filePath, theme, footprint = 'full', lawsPrefix
|
|
|
392
419
|
if (normcase(target) === normcase(here) || visiting.has(normcase(target))) {
|
|
393
420
|
return `<!-- CIRCULAR INCLUDE: ${rel} -->`;
|
|
394
421
|
}
|
|
395
|
-
|
|
396
|
-
|
|
422
|
+
return renderFile(cfg, target, theme, footprint, lawsPrefix,
|
|
423
|
+
new Set(visiting).add(normcase(here)), nativeCatalog)
|
|
397
424
|
.replace(/\n+$/, ''); // `.rstrip("\n")`
|
|
398
|
-
if (footprint === 'lean' && rel === 'laws/universal.md') {
|
|
399
|
-
inner = `${inner}\n\n${lawsPointer(theme, lawsPrefix)}`;
|
|
400
|
-
}
|
|
401
|
-
return inner;
|
|
402
425
|
});
|
|
403
426
|
|
|
404
427
|
text = resolveCatalogs(text, nativeCatalog, cfg.excludeSkills ?? [], cfg);
|
|
405
428
|
text = resolveLean(text, footprint);
|
|
429
|
+
if (footprint === 'lean') text = leanVoice(text, cfg.src);
|
|
406
430
|
return substitute(text, theme);
|
|
407
431
|
}
|
|
408
432
|
|
|
@@ -503,7 +527,8 @@ function dropExcludedRules(text, pack, excluded) {
|
|
|
503
527
|
}
|
|
504
528
|
|
|
505
529
|
function doctrinesBody(cfg, theme, active, footprint, lawsPrefix) {
|
|
506
|
-
|
|
530
|
+
// At lean the section still carries the one pointer with no pack active: it names the laws too.
|
|
531
|
+
if (!active.length) return footprint === 'lean' ? briefPointer(theme, lawsPrefix, false) : '';
|
|
507
532
|
const excluded = new Set(cfg.excludeRules ?? []);
|
|
508
533
|
const parts = active.map((name) => {
|
|
509
534
|
const raw = dropExcludedRules(readPackText(path.join(cfg.src, 'doctrines', `${name}.md`)),
|
|
@@ -512,15 +537,10 @@ function doctrinesBody(cfg, theme, active, footprint, lawsPrefix) {
|
|
|
512
537
|
// voice second. THE ORDER IS LOAD-BEARING — `resolveLean` reads HTML markers, and
|
|
513
538
|
// substituting first would hand it prose in fourteen voices. The first-sentence cut is gone;
|
|
514
539
|
// a rule's lean text is written in `src/doctrines/<pack>.md`, not measured out of its prose.
|
|
515
|
-
|
|
540
|
+
const text = resolveLean(raw, footprint);
|
|
541
|
+
return substitute(footprint === 'lean' ? leanVoice(text, cfg.src) : text, theme).trim();
|
|
516
542
|
});
|
|
517
|
-
if (footprint === 'lean')
|
|
518
|
-
const doctrine = theme.DOCTRINE ?? 'Doctrine';
|
|
519
|
-
const dir = theme.DIR_DOCTRINES ?? 'doctrines';
|
|
520
|
-
parts.push(`> Each ${doctrine} above is given in brief — the rule, not its reasoning. `
|
|
521
|
-
+ `The complete text of every pack, active or not, is in \`${lawsPrefix}${dir}/\`; read `
|
|
522
|
-
+ `the pack file whenever a ${doctrine}'s application is unclear.`);
|
|
523
|
-
}
|
|
543
|
+
if (footprint === 'lean') parts.push(briefPointer(theme, lawsPrefix));
|
|
524
544
|
return parts.join('\n\n');
|
|
525
545
|
}
|
|
526
546
|
|
|
@@ -667,8 +687,8 @@ export function renderAll(cfg, themeName, {
|
|
|
667
687
|
if (NOT_BUNDLED.has(sp[0])) continue;
|
|
668
688
|
if (sp.length >= 2 && Object.hasOwn(off, sp[0]) && off[sp[0]].has(sp[1].replace(/\.md$/, ''))) continue;
|
|
669
689
|
const outRel = destRel(themedRel(rel, theme)).split(path.sep).join('/'); // as_posix()
|
|
670
|
-
// The on-disk `laws/`, `ontology/` and `doctrines/` are the "complete text" the
|
|
671
|
-
//
|
|
690
|
+
// The on-disk `laws/`, `ontology/` and `doctrines/` are the "complete text" the lean
|
|
691
|
+
// pointer under the Doctrines section promises. They render at full whatever the
|
|
672
692
|
// footprint; only what AGENT.md INLINES leans. `doctrines/` joined them when its rules got
|
|
673
693
|
// authored LEAN blocks: before that a pack file carried no markers and shipped whole by
|
|
674
694
|
// accident, which is a different thing from shipping whole by contract.
|