Skip to content

feat(spec): OperationalDAG + GovernedLoop — loops-vs-graphs governance - #253

Merged
mdheller merged 2 commits into
mainfrom
feat/operational-dag-governed-loop
Aug 2, 2026
Merged

feat(spec): OperationalDAG + GovernedLoop — loops-vs-graphs governance#253
mdheller merged 2 commits into
mainfrom
feat/operational-dag-governed-loop

Conversation

@mdheller

@mdheller mdheller commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Where loops vs graphs win — made mechanical

Closes the enforcement owed by the loops-vs-graphs doctrine.

OperationalDAG carries identity / dependency / causality → MUST be acyclic. validate_dag_loop.py refuses a cycle (a loop where a DAG belongs is unsatisfiable), resolves every edge to a real node, and requires every node to be semantically grounded (semanticRef → GlossaryTerm / DataClass / service). Placement is a field-calculus reference (placementRef → PlacementFact / phase-field), not ad-hoc.

GovernedLoop is the only legitimate cycle, admissible only when governed:

  • boundedbound.maxIterations ≥ 1 (termination)
  • convergentconvergence.measure ∈ {fixpoint, monotone-decrease, error-below-tolerance}
  • fail-closedonNonConvergence ∈ {refuse, escalate-human}, never continue
  • admittedadmission.superconsciousRef (the superconscious holds refusal authority + convergence budget; loops don't self-authorize)

Teeth (verified)

  • an OperationalDAG with a cycle → refused (has a CYCLE)
  • a loop that self-authorizes (empty admission) → refused (don't self-authorize)
  • 5 negative vectors fail on their named failValidator (node missing semanticRef, edge missing endpoint, onNonConvergence=continue, loop missing admission, loop missing bound)

Wired into make validate (RC=0; 347 unique $id).

Ties: SP-GATE fail-closed pattern, vocabulary-as-governance-substrate, field calculus (MeshRush phase-field), superconscious governor.

Copilot AI review requested due to automatic review settings August 2, 2026 21:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds normative schemas + fixtures + a validator to mechanically enforce the “loops vs graphs” governance split: OperationalDAG must remain acyclic with semantically grounded nodes, while GovernedLoop is the only admissible cycle shape (bounded + convergent + fail-closed + admitted).

Changes:

  • Introduces new JSON Schemas: OperationalDAG and GovernedLoop, plus positive examples and negative conformance fixtures.
  • Adds tools/validate_dag_loop.py to enforce schema conformance and extra invariants (edge resolution + DAG acyclicity + loop governance).
  • Documents the doctrine and adds a make validate-dag-loop target (but currently not included in make validate).

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tools/validate_dag_loop.py New validator: schema conformance + DAG edge/cycle checks + loop governance checks + negative vectors.
specs/operational-dag-governed-loop.md New spec note describing OperationalDAG vs GovernedLoop semantics and validation entrypoint.
schemas/OperationalDAG.json New schema defining OperationalDAG nodes/edges and semantic grounding requirements.
schemas/GovernedLoop.json New schema defining governed loops (bound, convergence, fail-closed handler, admission).
Makefile Adds validate-dag-loop target (needs wiring into aggregate validate).
fixtures/dag-loop/conformance.json Adds negative vectors with expected failing JSON-Schema keywords.
examples/operational_dag.promotion.json Adds a conforming OperationalDAG example.
examples/governed_loop.vocab_currency.json Adds a conforming GovernedLoop example.
CHANGELOG.md Documents addition of OperationalDAG/GovernedLoop and validator wiring.

Comment thread Makefile
Comment on lines +14 to +16
validate-dag-loop:
python3 -m pip install --user jsonschema >/dev/null
python3 tools/validate_dag_loop.py
Comment on lines +49 to +52
for name, dag in dags.items():
node_ids = {n["id"] for n in dag["nodes"]}
adj: dict[str, list[str]] = {n: [] for n in node_ids}
ok_edges = True
mdheller added a commit that referenced this pull request Aug 2, 2026
…Y (Copilot #253)

The prior wiring used a string match that didn't hit this repo's long 'validate:' line, so the
target was DEFINED but unreachable — 'make validate' silently skipped the new enforcement (the
exact 'declared but not live' gap this contract exists to refuse; RC=0 was false comfort). Now
appended to both the 'validate:' prerequisites and .PHONY; 'make -n validate' confirms it runs.
Copilot's second comment (duplicate node ids collapsing in the set) was already remediated in
the preceding commit (validator refuses duplicate node ids, teeth-verified).
mdheller added a commit that referenced this pull request Aug 2, 2026
…Y (Copilot #253)

The prior wiring used a string match that didn't hit this repo's long 'validate:' line, so the
target was DEFINED but unreachable — 'make validate' silently skipped the new enforcement (the
exact 'declared but not live' gap this contract exists to refuse; RC=0 was false comfort). Now
appended to both the 'validate:' prerequisites and .PHONY; 'make -n validate' confirms it runs.
Copilot's second comment (duplicate node ids collapsing in the set) was already remediated in
the preceding commit (validator refuses duplicate node ids, teeth-verified).
@mdheller
mdheller force-pushed the feat/operational-dag-governed-loop branch from 138f09a to 56e2e0c Compare August 2, 2026 21:27
DAG carries identity/dependency/causality → MUST be acyclic; validate_dag_loop.py
REFUSES a cycle (a loop where a DAG belongs is unsatisfiable) and grounds every node
in the vocab/DataClass/service substrate (semanticRef) with field-calculus placement.

GovernedLoop is the only legitimate cycle, and only when governed: BOUNDED
(maxIterations) + CONVERGENT (a measure) + FAIL-CLOSED (onNonConvergence refuse|
escalate-human, never continue) + ADMITTED by the superconscious (loops don't
self-authorize). 5 negative vectors; teeth-verified (cycle refused, self-authorizing
loop refused). Wired into make validate.
A DAG is identity; two nodes sharing an id collapse into one in the node-id set and
silently mask edge/cycle errors. Schema minItems cannot catch it, so validate_dag_loop.py
now refuses duplicate node ids. Teeth-verified.
@mdheller
mdheller force-pushed the feat/operational-dag-governed-loop branch from 56e2e0c to dae2571 Compare August 2, 2026 21:31
@mdheller
mdheller merged commit 7f4fb5a into main Aug 2, 2026
7 checks passed
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.

2 participants