Skip to content

Generate DESIGN.md from .dag + enforce the document's syllogism - #5592

Merged
briansrls merged 13 commits into
mainfrom
session/silent-badger-134
Jun 23, 2026
Merged

briansrls merged 13 commits into
mainfrom
session/silent-badger-134

Conversation

@gunbai-bot

@gunbai-bot gunbai-bot Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Auto-opened by session-dashboard for session silent-badger-134.
Pushing to session/silent-badger-134 advances this PR.

Worker attestation

Before flipping this PR to ready for review, confirm each item:

  • Title describes the change (not the session id or branch).
  • PR body summarises what and why (replace the TODO below).
  • Tests run: name the command (e.g. npm test, cargo test) and the result.
  • If this closes a work item, the body contains a Closes #N directive.
  • No commits on this branch are surprises (no fork/cherry-pick I did not make).
  • No secrets / credentials / large binaries staged.

Summary

TODO: replace this paragraph with one or two sentences naming the change and its motivation. Reviewers read this first.

Test plan

  • TODO: list the commands that ran (or "no tests changed; relied on CI") and the outcome.

briansrls and others added 6 commits June 23, 2026 01:41
DESIGN.md is now a drift-gated projection of its .dag model (DESIGN §7: the
document is the first target of the recursion), the same way ROADMAP.md is:

- std.markdown + serializer: add the missing ThematicBreak block (the `---`
  rules) with arms in all exhaustive match sites; md_item now renders a leaf
  continuation block (a paragraph after a nested sub-list) as a CommonMark
  loose-list continuation (blank line + indent), leaving list-continuations —
  and therefore ROADMAP.md — byte-unchanged.
- gunbc.design_document: full DESIGN.md as typed markdown blocks; one TextInline
  per paragraph carries the raw markdown source (same convention as
  roadmap_authority). expected_design_md() is the single generator.
- gunbc.design_argument: extend the §1 axioms/propositions with §2-§7 headline
  propositions, each premised on the sections it follows from. The syllogism
  lens (std.syllogism.argument_form_is_valid) now checks the WHOLE document is
  non-vacuous, orphan-free, acyclic, and axiom-set-closed — the §1 open-thread.
- generated_artifact + universal drift gate + completeness witness: register
  DesignArtifact -> DESIGN.md -> expected_design_md(); roster bumped to 4.

Verified by execution: drift gate ExitSuccess; ROADMAP.md byte-unchanged; all
syllogism + completeness witnesses green incl. orphan/cycle/smuggled-axiom/
vacuous negative controls; regenerated DESIGN.md content-identical to the
original modulo line-wrapping (paragraphs unwrapped, as in ROADMAP.md).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@gunbai-bot
gunbai-bot Bot marked this pull request as ready for review June 23, 2026 02:33
@gunbai-bot gunbai-bot Bot changed the title get design docs into .dag Generate DESIGN.md from .dag + enforce the document's syllogism Jun 23, 2026
@gunbai-bot

gunbai-bot Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review. Both findings addressed:

Finding 2 (right-folded concat chain → concat_all) — fixed. design_blocks() is now a single flat_map([preamble_blocks(), section_1_blocks(), …], bs => bs) over the list of section block-lists (linear, fold-discipline; std has no concat_all/flatten, and flat_map with identity is the idiomatic flatten here).

Finding 1 (document↔proposition parallel-representation) — agreed it's a real, honestly-marked scaffold, and the dissolution trigger is concrete: render each section's lead claim FROM its proposition so the headline is single-authored. Note that trigger is now anchored in the authority itself — it's the named open thread in DESIGN.md §1 ("model §1's axioms… every claim a consequence-chain back to an axiom… with this document as the first target"), which this PR turns into a generated .dag artifact. So the parallel isn't free-floating: this PR is the move that makes the collapse mechanically possible (both views now live in .dag and the syllogism lens checks the proposition view). The inline // note that previously named the trigger was removed because main #5579 walled .dag comments corpus-wide while this PR was in flight; per the post-wall convention the trigger lives in the authority doc + this thread rather than a code comment.

Also folded in: integrated main (#5579 comment-wall) and stripped // comments from the new files — re-verified by execution on the merged compiler: drift gate ExitSuccess, ROADMAP.md byte-unchanged, full syllogism + completeness witnesses green incl. the orphan/cycle/smuggled-axiom/vacuous negative controls, DESIGN.md render byte-identical.

— sent from silent-badger-134

briansrls and others added 5 commits June 23, 2026 03:14
main #5579 (DAG comment-wall) stripped the // comment in
src/v2/lens/intent_linearity.dag that carried the bind: root for
docs/plans/intent-linearity-design-draft.md, orphaning it in the
doc-reachability graph — main has been red on doc_graph_has_no_orphan_docs
for 5+ consecutive commits, and every PR merging main inherits it.

The intent_linearity lens is still live (only its comments were removed), so
the draft is re-homed, not deleted: a markdown link from its reachable sibling
docs/plans/self-applying-lenses.md (the intent-linearity registry doc, itself
ROADMAP-linked). The draft is literally the DESIGN.md articulation of this PR's
own open thread ("model §1's axioms in .dag + enforce the syllogism"), so the
link is in-theme.

Verified: doc_graph_has_no_orphan_docs / no_dangling_links / universe_nonempty
all green by execution.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… DESIGN.md

main #5584 hand-edited DESIGN.md's first open thread to add a pointer to the
intent-linearity draft. Since DESIGN.md is now generated, fold that exact
content change into gunbc.design_document and regenerate (not a hand-merge), so
the authority stays the .dag model. Verified: regenerated DESIGN.md content ==
main's content (whitespace-stripped, the only delta is the pointer); drift gate
ExitSuccess; syllogism + completeness witnesses green.

main also rooted the orphan draft itself (the new DESIGN.md link + its own link
in self-applying-lenses.md), so my earlier redundant line-3 link there is
reverted — the orphan is now reachable via the DESIGN.md root.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@briansrls
briansrls merged commit 74ecf4b into main Jun 23, 2026
2 checks passed
@briansrls
briansrls deleted the session/silent-badger-134 branch June 23, 2026 05:38
briansrls added a commit that referenced this pull request Jun 23, 2026
…idea-machine exemplar)

The operator's follow-on to #5592 (DESIGN.md → .dag): bring docs/plans/*.md into
the substrate too, "modeled more thoroughly" — not just prose-in-blocks, but the
recurring semantic invariant extracted and lens-enforced.

Shared model (`gunbc.plan`):
- `Plan { slug, title, body: List<MarkdownBlock>, dissolution: DissolutionTrigger }`.
  `DissolutionTrigger = HasTrigger { text } | NoTrigger` (a closed sum, not String? —
  dodges the optional-null match gotcha and is honest about presence, §5).
- The §6 invariant ("every scaffold lands with a named dissolution trigger") is lifted
  into a typed field with its own serialized section — single representation, no §3
  dual-rep with the prose. status/anchors stay woven in the body prose (lifting them
  would fork a second representation of inline mentions).
- Lens `plans_all_have_dissolution_trigger` / `plans_all_titled` — the plan-doc analog
  of DESIGN's syllogism lens, walling a plan with no declared dissolution condition.

Generation reuses the universal drift framework (no fork, §2): one `PlanArtifact { plan }`
variant covers all N plans (registry rows, not N enum variants — §2-horizontal), so
fan-out appends to `gunbc.plan_registry.all_plans`. The per-artifact byte-exact drift
receipt loop already covers each plan automatically.

Exemplar: `docs/plans/idea-machine.md` regenerated from `gunbc.plans.idea_machine`
(reflow-only delta vs the hand-written form, per DESIGN.md precedent; the dissolution
heading drops its section number as it is now a lifted field).

Witnesses (all green by execution): byte-exact drift incl. idea-machine; §6 lens over
the registry; synthetic RED controls (missing trigger / missing title detected); non-fold
lens, doc-reachability, dangling-link all still green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
briansrls added a commit that referenced this pull request Jun 23, 2026
…idea-machine exemplar) (#5622)

* WIP: get design docs into .dag

* WIP: get design docs into .dag

* WIP: get design docs into .dag

* WIP: get design docs into .dag

* WIP: get design docs into .dag

* Generate DESIGN.md from .dag + enforce the document's syllogism

DESIGN.md is now a drift-gated projection of its .dag model (DESIGN §7: the
document is the first target of the recursion), the same way ROADMAP.md is:

- std.markdown + serializer: add the missing ThematicBreak block (the `---`
  rules) with arms in all exhaustive match sites; md_item now renders a leaf
  continuation block (a paragraph after a nested sub-list) as a CommonMark
  loose-list continuation (blank line + indent), leaving list-continuations —
  and therefore ROADMAP.md — byte-unchanged.
- gunbc.design_document: full DESIGN.md as typed markdown blocks; one TextInline
  per paragraph carries the raw markdown source (same convention as
  roadmap_authority). expected_design_md() is the single generator.
- gunbc.design_argument: extend the §1 axioms/propositions with §2-§7 headline
  propositions, each premised on the sections it follows from. The syllogism
  lens (std.syllogism.argument_form_is_valid) now checks the WHOLE document is
  non-vacuous, orphan-free, acyclic, and axiom-set-closed — the §1 open-thread.
- generated_artifact + universal drift gate + completeness witness: register
  DesignArtifact -> DESIGN.md -> expected_design_md(); roster bumped to 4.

Verified by execution: drift gate ExitSuccess; ROADMAP.md byte-unchanged; all
syllogism + completeness witnesses green incl. orphan/cycle/smuggled-axiom/
vacuous negative controls; regenerated DESIGN.md content-identical to the
original modulo line-wrapping (paragraphs unwrapped, as in ROADMAP.md).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* WIP: get design docs into .dag

* Re-home orphaned intent-linearity draft (main #5579 fallout)

main #5579 (DAG comment-wall) stripped the // comment in
src/v2/lens/intent_linearity.dag that carried the bind: root for
docs/plans/intent-linearity-design-draft.md, orphaning it in the
doc-reachability graph — main has been red on doc_graph_has_no_orphan_docs
for 5+ consecutive commits, and every PR merging main inherits it.

The intent_linearity lens is still live (only its comments were removed), so
the draft is re-homed, not deleted: a markdown link from its reachable sibling
docs/plans/self-applying-lenses.md (the intent-linearity registry doc, itself
ROADMAP-linked). The draft is literally the DESIGN.md articulation of this PR's
own open thread ("model §1's axioms in .dag + enforce the syllogism"), so the
link is in-theme.

Verified: doc_graph_has_no_orphan_docs / no_dangling_links / universe_nonempty
all green by execution.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Resolve merge: fold main's open-thread pointer into the model + regen DESIGN.md

main #5584 hand-edited DESIGN.md's first open thread to add a pointer to the
intent-linearity draft. Since DESIGN.md is now generated, fold that exact
content change into gunbc.design_document and regenerate (not a hand-merge), so
the authority stays the .dag model. Verified: regenerated DESIGN.md content ==
main's content (whitespace-stripped, the only delta is the pointer); drift gate
ExitSuccess; syllogism + completeness witnesses green.

main also rooted the orphan draft itself (the new DESIGN.md link + its own link
in self-applying-lenses.md), so my earlier redundant line-3 link there is
reverted — the orphan is now reachable via the DESIGN.md root.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* WIP: get design docs into .dag

* Model plan docs as .dag: Plan carrier + §6 dissolution-trigger lens (idea-machine exemplar)

The operator's follow-on to #5592 (DESIGN.md → .dag): bring docs/plans/*.md into
the substrate too, "modeled more thoroughly" — not just prose-in-blocks, but the
recurring semantic invariant extracted and lens-enforced.

Shared model (`gunbc.plan`):
- `Plan { slug, title, body: List<MarkdownBlock>, dissolution: DissolutionTrigger }`.
  `DissolutionTrigger = HasTrigger { text } | NoTrigger` (a closed sum, not String? —
  dodges the optional-null match gotcha and is honest about presence, §5).
- The §6 invariant ("every scaffold lands with a named dissolution trigger") is lifted
  into a typed field with its own serialized section — single representation, no §3
  dual-rep with the prose. status/anchors stay woven in the body prose (lifting them
  would fork a second representation of inline mentions).
- Lens `plans_all_have_dissolution_trigger` / `plans_all_titled` — the plan-doc analog
  of DESIGN's syllogism lens, walling a plan with no declared dissolution condition.

Generation reuses the universal drift framework (no fork, §2): one `PlanArtifact { plan }`
variant covers all N plans (registry rows, not N enum variants — §2-horizontal), so
fan-out appends to `gunbc.plan_registry.all_plans`. The per-artifact byte-exact drift
receipt loop already covers each plan automatically.

Exemplar: `docs/plans/idea-machine.md` regenerated from `gunbc.plans.idea_machine`
(reflow-only delta vs the hand-written form, per DESIGN.md precedent; the dissolution
heading drops its section number as it is now a lifted field).

Witnesses (all green by execution): byte-exact drift incl. idea-machine; §6 lens over
the registry; synthetic RED controls (missing trigger / missing title detected); non-fold
lens, doc-reachability, dangling-link all still green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* WIP: get design docs into .dag

* Plan lens: require non-empty dissolution trigger text (review fix)

Addresses claude-opus-4-7 #5622: `plan_has_dissolution_trigger` checked only the
HasTrigger variant, not that `text` is non-empty — asymmetric with `plans_all_titled`
(which requires length > 0). An empty `HasTrigger { text: "" }` is no trigger. Now
`length(text) > 0`, with a discriminating RED control (`plan_with_empty_trigger`).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Brian Searls <briansrls@gunb.ai>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: Brian Searls <11205878+briansrls@users.noreply.github.com>
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.

1 participant