Skip to content

feat(build): 3x3 build-recipe contract + CLI-surface reconciliation (closes #57) - #58

Merged
mdheller merged 2 commits into
mainfrom
feat/build-recipes-cli-surface-57
Aug 4, 2026
Merged

feat(build): 3x3 build-recipe contract + CLI-surface reconciliation (closes #57)#58
mdheller merged 2 commits into
mainfrom
feat/build-recipes-cli-surface-57

Conversation

@mdheller

@mdheller mdheller commented Aug 3, 2026

Copy link
Copy Markdown
Member

Closes #57. cc @mdheller. Related: #76.

Lands the one net-new, schema-shaped slice from the Prophet CLI & System Architecture spec (intake 2026-07-31). Everything else the spec commits to is already-real elsewhere and is consumed, not rebuilt (sourceos-spec Genesis/Inception/Twin, source-os/runtime/quorumd, estate gitops-promote / gate.yml / canary lifecycle, TriTRPC transport skins, prophet-platform deploy plane). This repo owns only the ordering + gate contract and the surface reconciliation.

1. 3x3 build-recipe contract (DAG + health-gate teeth)

  • build/recipes.yamlprophet build local|region|macro, each an ordered, acyclic chain of 3 stages. Every stage declares depends_on + a required health gate, so stage N+1 cannot start until stage N verifies.
    • local: genesis → inception → twin-bridge
    • region: security/storage → bus/HOPE → work/agents
    • macro: federated-twin → policy/replication → macro-agents/search
  • manifests/build-recipes.schema.json — schema-as-code. It is the single source of truth for the tier enum and stage keys; scripts/validate_build_recipes.py reads them back, so schema and validator cannot silently drift.
  • scripts/validate_build_recipes.py — proves the ordering is a DAG: no cycles, no forward edges, no skip edges, and every stage has a real gate (required: true + non-empty check; anything weaker is treated as missing).

Teeth (both ways)

Accept fixture (build/recipes.yaml) VERIFIES. Reject fixtures under build/fixtures/ each fire:

fixture fault
reject-forward-dep.yaml stage depends on a later stage
reject-missing-gate.yaml stage missing its health gate
reject-unknown-tier.yaml unknown tier
reject-cycle.yaml cycle in depends_on

--self-test asserts accept passes AND every reject fires with the expected reason. Negative control confirmed: weakening a reject fixture makes --self-test exit non-zero.

2. Command-tree reconciliation (decision-as-data)

  • manifests/cli-surface.json + scripts/validate_cli_surface.py reconcile the spec command tree (context/config/build/fs/graph/docker/conda/minio/rsync/kafka/work/vocab/gib/search/opencog/genesis/inception/twin/bridge/agents) onto the canonical verb model in docs/CLI_SURFACE_POLICY.md.
  • Teeth: verb drift fires both ways (declared-but-not-in-policy, and in-policy-but-not-declared); every noun resolves only to canonical verbs (no competing command language); per the phase-1 policy, deferred nouns must not scaffold empty subtrees; the whole spec tree must be accounted for.
  • Only nouns with a real delegate are adopted (build, vocab, search, agents); the remaining 16 are deferred as follow-up (surface growth is policy-gated).

Wiring

  • make validatevalidate-manifests → both self-tests. Also make validate-recipes / make validate-surface.
  • New python CI workflow .github/workflows/build-recipes.yml; validate.yml gains Python + pyyaml so make validate stays green.

Local teeth results

python3 scripts/validate_build_recipes.py --self-test   # PASS (accept + 4 rejects; negative control fails as expected)
python3 scripts/validate_cli_surface.py  --self-test   # PASS (accept + 4 drift rejects)

Follow-up (out of this slice)

Deferred noun-namespace adoption (the 16 nouns without a real delegate) — filed separately @mdheller; surface growth is policy-gated and must not scaffold empty subtrees.

Net-new buildable slice from the Prophet CLI & System Architecture spec
(#57). Two schema-shaped artifacts with teeth, both wired into `make
validate` and CI:

build/recipes.yaml — `prophet build local|region|macro` as an ordered,
acyclic chain of stages, each with a required health gate so stage N+1
cannot start until stage N verifies. manifests/build-recipes.schema.json
is the source of truth for the tier enum and stage keys, so schema and
validator cannot drift. scripts/validate_build_recipes.py proves the
ordering is a DAG (no cycles, no forward edges, no skip edges) and every
stage carries a real gate. Reject fixtures under build/fixtures/ fire on
forward dep, missing gate, unknown tier, and cycle; --self-test asserts
the accept fixture verifies and each reject fixture is rejected.

manifests/cli-surface.json + scripts/validate_cli_surface.py reconcile
the spec command tree (context/config/build/fs/graph/... /agents) onto
the canonical verb model in docs/CLI_SURFACE_POLICY.md. Verb drift fires
both ways (declared-but-not-in-policy and in-policy-but-not-declared);
nouns must resolve only to canonical verbs (no competing command
language); per phase-1 policy, deferred nouns must not scaffold empty
subtrees. Only nouns with a real delegate (build/vocab/search/agents)
are adopted; the rest are deferred as follow-up.

Consume-not-fork: recipes delegate to already-real engines
(sourceos-spec Genesis/Inception/Twin, estate gitops-promote); this repo
owns only the ordering + gate contract and the surface reconciliation.
…LI-surface deferred-delegate/duplicate-noun bypasses

Red-team of the merged teeth surfaced four holes the validators admitted:
- recipe: a stage with an unknown key (e.g. skip:true) passed although the
  schema declares additionalProperties:false -- a runtime-honoured field could
  bypass the health gate the contract exists to enforce;
- recipe: two recipes sharing a tier passed, making prophet build <tier>
  ambiguous (the 3x3 contract is one recipe per tier);
- recipe: stage ids violating the schema id pattern passed;
- cli-surface: a deferred noun with a real delegate (no verbs) scaffolded a
  subtree, and duplicate noun entries were silently deduped.

Harden both validators (schema-driven, no new deps) and add reject fixtures
reject-duplicate-tier.yaml and reject-unknown-key.yaml plus deferred-delegate
and duplicate-noun self-test cases. All teeth fire both ways.
@mdheller
mdheller merged commit 3ad136a into main Aug 4, 2026
13 checks passed
@mdheller
mdheller deleted the feat/build-recipes-cli-surface-57 branch August 4, 2026 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prophet CLI & System Architecture spec (intake 2026-07-31): land 3x3 build-recipe contract; reconcile command tree with CLI_SURFACE_POLICY

1 participant