Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions .fixtures/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ for the current architecture.
```
.fixtures/
├── seeds/ # Tracked reusable explicit-basis inputs
│ └── <seed-set>/
│ └── <seed-family>/
│ ├── README.md
│ ├── <seed>.json
│ ├── <variant>.json
│ └── _*.ts # Reproducible data-prep scripts, not product code
├── workbenches/ # Launchable local workspaces; .brunch/ is gitignored
│ └── <name>/
Expand All @@ -46,13 +46,14 @@ Seed workbench state explicitly; `npm run dev` never seeds by implication. See
catalog. From the repo root, load one tracked seed into one named workspace with:

```sh
npm run seed -- --workspace .fixtures/workbenches/live-graph-observer --seed workspace-spread/alpha-grounding
npm run dev -- --cwd .fixtures/workbenches/live-graph-observer
npm run seed -- --seed workspace-alpha-grounding/base --reset
npm run dev -- --workspace .fixtures/workbenches/workspace-alpha-grounding
```

The seed command writes only the target workspace's `.brunch/data.db` and reports
that destination path plus the `set/slug → specId` mapping. Add `--reset` to wipe
the target workspace's runtime state before seeding — `data.db` (+ `-wal`/`-shm`),
that destination path plus the `name/variant → specId` mapping. Add `--reset` to
wipe the target workspace's runtime state before seeding — `data.db`
(+ `-wal`/`-shm`),
`sessions/`, `debug/`, and `workspace.json` — so a relaunch starts a fresh session
instead of resuming a stale one; unknown files in `.brunch/` and the directory
itself survive. Use `--all-seeds` only as an explicit opt-in when a manual
Expand Down
33 changes: 24 additions & 9 deletions .fixtures/seeds/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
# `.fixtures/seeds/`

Tracked reusable graph seeds. Each seed set owns one or more explicit-basis spec
fixtures consumed by `src/graph/seed-fixtures.ts` through `CommandExecutor`.
Tracked reusable graph seeds. Each seed family owns one or more explicit-basis
spec fixtures consumed by `src/graph/seed-fixtures.ts` through
`CommandExecutor`.

Seed refs are always `name/variant`:

- `name` is the canonical family/workbench id; omitting `--workspace` derives
`.fixtures/workbenches/<name>/`
- `variant` is the starting graph state within that family; `base` is the
canonical full graph, and semantic variants like `grounded-intent` capture
alternate starting states for the same workbench

Use a single named seed for normal workbench setup, or opt in to the whole
catalog when building a broad manual workbench / probe-input database:

```sh
npm run seed -- --workspace .fixtures/workbenches/<name> --seed workspace-spread/alpha-grounding
npm run seed -- --seed workspace-alpha-grounding/base --reset
npm run dev -- --seed workspace-alpha-grounding/base --reset --open-web
npm run seed -- --workspace .fixtures/workbenches/<name> --all-seeds --reset
```

Expand All @@ -18,14 +28,19 @@ than loading anything into the shell cwd.

| Seed set | Disposition | Purpose |
| --- | --- | --- |
| `bilal-port` | manual workbench | Rich ported prototype graphs for UI, renderer, and agent-context development against realistic messy specs. |
| `bilal-port-variants` | probe input | Small curated Bilal-derived bases for product-path fixture curation and proposal runs. |
| `bilal-code-health` | manual workbench | Rich Bilal-derived spec for renderer, context, and curation work around code-health material. |
| `bilal-explorer-ui` | manual workbench | Rich Bilal-derived spec for UI- and renderer-heavy exploration. |
| `bilal-macro-view` | probe input | Bilal-derived macro-view family; `base` is the full port and `grounded-intent` is the curated probe starting state. |
| `brunch-self` | preview | Faithful Brunch planning graph used as a realistic all-planes anchor for renderer and graph previews. |
| `cook-port` | test | Small fully-grounded intent graphs that exercise fan-out, join/gate, and halt-isolation shapes. |
| `cook-layered-todo` | test | Small grounded intent graph that exercises fan-out, join, and cross-epic gate shape. |
| `cook-parallel-utils` | test | Small grounded intent graph that exercises pure scaffold-to-leaf fan-out. |
| `cook-resilient-pipeline` | test | Small grounded intent graph that exercises halt isolation and an unreachable join. |
| `dumpchat` | preview | Faithful external-project graph that previews all-plane rendering over a compact real spec. |
| `edge-spread` | test | Synthetic edge-category and absence-case coverage for graph projections and renderers. |
| `edge-category-directions` | test | Synthetic edge-category and absence-case coverage for graph projections and renderers. |
| `edge-hub-neighborhood` | test | Synthetic neighborhood fixture centered on a high-degree hub for traversal and projection checks. |
| `fable` | preview | Faithful external-project graph with broad all-plane coverage for realistic renderer/readback previews. |
| `kind-band-spread` | test | Compact synthetic coverage matrix for every graph kind and readiness band. |
| `kind-coverage-matrix` | test | Compact synthetic coverage matrix for every graph kind and readiness band. |
| `rd-loop` | preview | Faithful harness graph that provides a second realistic all-planes anchor beside Brunch itself. |
| `workspace-spread` | test | Deterministic two-spec workspace inventory for workspace/spec projection tests and workbenches. |
| `workspace-alpha-grounding` | test | Small workspace-oriented grounding fixture used for smoke workbenches and projection tests. |
| `workspace-beta-commitments` | test | Small workspace-oriented commitments fixture paired with the alpha workbench family for multi-spec tests. |
| `yamlbase` | preview | Faithful external-project graph used as a worked template for porting planning prose into seed truth. |
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"spec": {
"slug": "code-health",
"slug": "bilal-code-health",
"name": "Code Health"
},
"nodes": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"spec": {
"slug": "explorer-ui",
"slug": "bilal-explorer-ui",
"name": "Explorer UI"
},
"nodes": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@ interface SeedFixture {
}>;
}

const VARIANT_SLUG = 'macro-view-grounded-intent';
const SOURCE_SLUG = 'macro-view';
const VARIANT_SPEC_SLUG = 'bilal-macro-view';
const VARIANT_FILENAME = 'grounded-intent.json';
const SOURCE_SEED_NAME = 'bilal-macro-view';
const GROUNDED_SOURCE = /^(stakeholder|external-observed|technical-observed)\b/;

async function main(): Promise<void> {
const here = dirname(fileURLToPath(import.meta.url));
const sourcePath = join(here, '..', 'bilal-port', `${SOURCE_SLUG}.json`);
const sourcePath = join(here, '..', SOURCE_SEED_NAME, 'base.json');
const source = JSON.parse(await readFile(sourcePath, 'utf8')) as SeedFixture;
const kept = source.nodes.filter(
(node) =>
Expand Down Expand Up @@ -64,15 +65,15 @@ async function main(): Promise<void> {
});
const variant = {
spec: {
slug: VARIANT_SLUG,
name: 'Macro View — grounded intent base',
slug: VARIANT_SPEC_SLUG,
name: 'Macro View — grounded intent',
},
nodes,
edges,
} satisfies SeedFixture;

await mkdir(here, { recursive: true });
await writeFile(join(here, `${VARIANT_SLUG}.json`), `${JSON.stringify(variant, null, 2)}\n`, 'utf8');
await writeFile(join(here, VARIANT_FILENAME), `${JSON.stringify(variant, null, 2)}\n`, 'utf8');
}

main().catch((error: unknown) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"spec": {
"slug": "macro-view",
"slug": "bilal-macro-view",
"name": "Macro View"
},
"nodes": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"spec": {
"slug": "macro-view-grounded-intent",
"name": "Macro View — grounded intent base"
"slug": "bilal-macro-view",
"name": "Macro View — grounded intent"
},
"nodes": [
{
Expand Down
20 changes: 0 additions & 20 deletions .fixtures/seeds/bilal-port-variants/README.md

This file was deleted.

20 changes: 11 additions & 9 deletions .fixtures/seeds/bilal-port/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ Not probe-run artifacts; sits under `.fixtures/seeds/` alongside
Source: vendored under [`_originals/`](./_originals/) — copied from
Bilal's spec-elicitation prototype `spec/<slug>/graph/{nodes,edges}.json`.

Each `<slug>.json` is generated from `_originals/` by
Each sibling `bilal-*/base.json` is generated from `_originals/` by
[`_port-script.ts`](./_port-script.ts) (a throwaway data-prep step,
not product code). Re-runnable from this directory alone; each run
overwrites the `<slug>.json` files.
overwrites the sibling base fixtures.

## Transformation rules

Expand Down Expand Up @@ -45,13 +45,15 @@ Curation flags carried in the `source` field:
```
bilal-port/
├── README.md # this file (generated)
├── _port-script.ts # throwaway prep: _originals/ → <slug>.json
├── _port-script.ts # throwaway prep: _originals/ → sibling bilal-*/base.json
├── _originals/ # vendored Bilal source (reproducibility)
│ └── <slug>/{nodes,edges}.json
└── <slug>.json # consolidated seed contract (× 3)
├── ../bilal-code-health/base.json
├── ../bilal-explorer-ui/base.json
└── ../bilal-macro-view/base.json
```

Each `<slug>.json` is the seed contract consumed by the loader:
Each sibling `base.json` is the seed contract consumed by the loader:

```
{
Expand All @@ -70,8 +72,8 @@ columns stay coherent under brunch's mutation contract.

## Stats

| Spec | nodes in | edges in | nodes emitted | edges emitted | edges absorbed | self-after-collapse drops | unresolved-endpoint drops | duplicate-after-collapse drops |
| Seed family | spec slug | nodes in | edges in | nodes emitted | edges emitted | edges absorbed | self-after-collapse drops | unresolved-endpoint drops | duplicate-after-collapse drops |
| --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
| code-health | 335 | 600 | 277 | 446 | 117 | 1 | 0 | 74 |
| explorer-ui | 316 | 698 | 280 | 580 | 74 | 15 | 0 | 34 |
| macro-view | 265 | 568 | 232 | 461 | 68 | 0 | 0 | 43 |
| bilal-code-health | bilal-code-health | 335 | 600 | 277 | 446 | 117 | 1 | 0 | 74 |
| bilal-explorer-ui | bilal-explorer-ui | 316 | 698 | 280 | 580 | 74 | 15 | 0 | 34 |
| bilal-macro-view | bilal-macro-view | 265 | 568 | 232 | 461 | 68 | 0 | 0 | 43 |
54 changes: 31 additions & 23 deletions .fixtures/seeds/bilal-port/_port-script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
* checkout. Anyone can regenerate the seed contracts from this directory alone.
*/

import { existsSync, readFileSync, writeFileSync } from 'node:fs';
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
import { dirname, resolve } from 'node:path';
import { fileURLToPath } from 'node:url';

Expand All @@ -98,12 +98,11 @@ import { dedupeSeedEdgesByPrecedence, type OriginTaggedEdge } from './duplicate-

const SCRIPT_DIR = dirname(fileURLToPath(import.meta.url));
const ORIGINALS_ROOT = resolve(SCRIPT_DIR, '_originals');
const OUTPUT_ROOT = SCRIPT_DIR;

const SPECS: { source: string; slug: string; displayName: string }[] = [
{ source: 'code-health', slug: 'code-health', displayName: 'Code Health' },
{ source: 'explorer-ui', slug: 'explorer-ui', displayName: 'Explorer UI' },
{ source: 'macro-view', slug: 'macro-view', displayName: 'Macro View' },
const SPECS: { source: string; seedName: string; specSlug: string; displayName: string }[] = [
{ source: 'code-health', seedName: 'bilal-code-health', specSlug: 'bilal-code-health', displayName: 'Code Health' },
{ source: 'explorer-ui', seedName: 'bilal-explorer-ui', specSlug: 'bilal-explorer-ui', displayName: 'Explorer UI' },
{ source: 'macro-view', seedName: 'bilal-macro-view', specSlug: 'bilal-macro-view', displayName: 'Macro View' },
];

// ---------------------------------------------------------------------------
Expand Down Expand Up @@ -720,11 +719,13 @@ function validateSeed(seed: SeedFixture): void {
seedFixture(executor, seed);
}

function writeSpec(seed: SeedFixture): void {
writeFileSync(resolve(OUTPUT_ROOT, `${seed.spec.slug}.json`), JSON.stringify(seed, null, 2) + '\n');
function writeSpec(seedName: string, seed: SeedFixture): void {
const outputDir = resolve(SCRIPT_DIR, '..', seedName);
mkdirSync(outputDir, { recursive: true });
writeFileSync(resolve(outputDir, 'base.json'), JSON.stringify(seed, null, 2) + '\n');
}

function writeReadme(results: { slug: string; displayName: string; stats: Record<string, number> }[]): void {
function writeReadme(results: { seedName: string; specSlug: string; displayName: string; stats: Record<string, number> }[]): void {
const lines: string[] = [
'# `.fixtures/seeds/bilal-port/`',
'',
Expand All @@ -740,10 +741,10 @@ function writeReadme(results: { slug: string; displayName: string; stats: Record
'Source: vendored under [`_originals/`](./_originals/) — copied from',
"Bilal's spec-elicitation prototype `spec/<slug>/graph/{nodes,edges}.json`.",
'',
'Each `<slug>.json` is generated from `_originals/` by',
'Each sibling `bilal-*/base.json` is generated from `_originals/` by',
'[`_port-script.ts`](./_port-script.ts) (a throwaway data-prep step,',
'not product code). Re-runnable from this directory alone; each run',
'overwrites the `<slug>.json` files.',
'overwrites the sibling base fixtures.',
'',
'## Transformation rules',
'',
Expand Down Expand Up @@ -773,13 +774,15 @@ function writeReadme(results: { slug: string; displayName: string; stats: Record
'```',
'bilal-port/',
'├── README.md # this file (generated)',
'├── _port-script.ts # throwaway prep: _originals/ → <slug>.json',
'├── _port-script.ts # throwaway prep: _originals/ → sibling bilal-*/base.json',
'├── _originals/ # vendored Bilal source (reproducibility)',
'│ └── <slug>/{nodes,edges}.json',
'└── <slug>.json # consolidated seed contract (× 3)',
'├── ../bilal-code-health/base.json',
'├── ../bilal-explorer-ui/base.json',
'└── ../bilal-macro-view/base.json',
'```',
'',
'Each `<slug>.json` is the seed contract consumed by the loader:',
'Each sibling `base.json` is the seed contract consumed by the loader:',
'',
'```',
'{',
Expand All @@ -798,17 +801,17 @@ function writeReadme(results: { slug: string; displayName: string; stats: Record
'',
'## Stats',
'',
'| Spec | nodes in | edges in | nodes emitted | edges emitted | edges absorbed | self-after-collapse drops | unresolved-endpoint drops | duplicate-after-collapse drops |',
'| Seed family | spec slug | nodes in | edges in | nodes emitted | edges emitted | edges absorbed | self-after-collapse drops | unresolved-endpoint drops | duplicate-after-collapse drops |',
'| --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |',
];
for (const r of results) {
const s = r.stats;
lines.push(
`| ${r.slug} | ${s.nodes_in} | ${s.edges_in} | ${s.nodes_emitted} | ${s.edges_emitted} | ${s.edges_absorbed} | ${s.edges_dropped_self_after_collapse} | ${s.edges_dropped_unresolved_endpoint} | ${s.edges_dropped_duplicate_after_collapse} |`,
`| ${r.seedName} | ${r.specSlug} | ${s.nodes_in} | ${s.edges_in} | ${s.nodes_emitted} | ${s.edges_emitted} | ${s.edges_absorbed} | ${s.edges_dropped_self_after_collapse} | ${s.edges_dropped_unresolved_endpoint} | ${s.edges_dropped_duplicate_after_collapse} |`,
);
}
lines.push('');
writeFileSync(resolve(OUTPUT_ROOT, 'README.md'), lines.join('\n'));
writeFileSync(resolve(SCRIPT_DIR, 'README.md'), lines.join('\n'));
}

// ---------------------------------------------------------------------------
Expand All @@ -821,18 +824,23 @@ function main(): void {
process.exit(1);
}

const summaries: { slug: string; displayName: string; stats: Record<string, number> }[] = [];
const summaries: { seedName: string; specSlug: string; displayName: string; stats: Record<string, number> }[] = [];
for (const spec of SPECS) {
console.log(`Porting ${spec.source} → ${spec.slug}.json...`);
const result = portSpec(spec.source, spec.slug, spec.displayName);
console.log(`Porting ${spec.source} → ../${spec.seedName}/base.json...`);
const result = portSpec(spec.source, spec.specSlug, spec.displayName);
const seed = buildSeed(result, spec.displayName);
validateSeed(seed); // throws if the seed would not commit cleanly
writeSpec(seed);
summaries.push({ slug: spec.slug, displayName: spec.displayName, stats: result.stats });
writeSpec(spec.seedName, seed);
summaries.push({
seedName: spec.seedName,
specSlug: spec.specSlug,
displayName: spec.displayName,
stats: result.stats,
});
console.log(` ${JSON.stringify(result.stats)}`);
}
writeReadme(summaries);
console.log(`\nDone. Output at ${OUTPUT_ROOT}`);
console.log(`\nDone. Output at ${resolve(SCRIPT_DIR, '..')}`);
}

main();
12 changes: 7 additions & 5 deletions .fixtures/seeds/brunch-self/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

A **faithful** spec graph hand-derived from this repository's own planning prose
(`memory/SPEC.md` + `memory/PLAN.md`), as opposed to the synthetic
coverage/edge-spread fixtures.
coverage fixtures such as `kind-coverage-matrix/base` and
`edge-category-directions/base`.

Purpose:

Expand All @@ -23,8 +24,9 @@ Coverage (a by-product of being faithful, not the goal):

Contents:

- `spec-graph.json` — one `planning_ready` spec describing Brunch itself.
- `base.json` — the canonical faithful Brunch graph; one `planning_ready` spec
describing Brunch itself.

Structural legality is enforced by the seed loader: `spec-graph` is committed
through `CommandExecutor` by `src/renderers/graph/previews.test.ts`, which fails
if any node/edge is structurally illegal.
Structural legality is enforced by the seed loader: `base` is committed through
`CommandExecutor` by `src/renderers/graph/previews.test.ts`, which fails if any
node/edge is structurally illegal.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"spec": {
"slug": "layered-todo-spec",
"slug": "cook-layered-todo",
"name": "layered-todo (reversed cook fixture)"
},
"nodes": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"spec": {
"slug": "parallel-utils-spec",
"slug": "cook-parallel-utils",
"name": "parallel-utils (reversed cook fixture)"
},
"nodes": [
Expand Down
Loading
Loading