Skip to content

Source-annotation policy: DESIGN 4c lands; // as captured authored-source data (audit complete, D-A..D-D ruled) - #7797

Merged
briansrls merged 8 commits into
mainfrom
session/fierce-pike-375
Aug 4, 2026
Merged

briansrls merged 8 commits into
mainfrom
session/fierce-pike-375

Conversation

@briansrls

@briansrls briansrls commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

Status

Audit complete; source-annotation policy ruled; implementation and reconciliation unstarted.

Canonical guidance landed in DESIGN.md §4c through gunbc.design_document section_4c_blocks, with DESIGN.md regenerated, never hand-edited. No slice is started, nothing deleted, migrated, or reconciled.

The defect

Banning // made comment syntax unwritable — not commentary. It removed the only structural signal saying this text is commentary, not program data. Verified in-tree as a closed causal loop:

PR commit title
#5579 f9cc238976 Parser-wall: remove DAG comment trivia rules (fail-closed by construction)
#6262 9e7c3c1d11 …hoist .dag // comments to typed data rows…
#6424 c14e001a34 Sweep dead prose data-String rows (comments smuggled in strings): 215 rows across ~130 files

comments banned → commentary smuggled into data rows → intent mechanically undecidable → recurring cleanup. #6262 was the deliberate compensating convention, not drift.

The rule that lands: prose is not forbidden; unclassified prose is. // becomes the explicit quarantine boundary.

Four structural corrections to the destination

  • §2a — a third lexical channel. Rejecting TriviaRule is necessary but not sufficient: an ordinary TokenRule still joins the semantic token stream, buying parser filtering, token-order effects, and allocator risk. LexRule gains AnnotationRule beside the two variants it has today.
  • §2b — wrap, don't widen. AuthoredParseArtifact { semantic, annotations } rather than a new field on ParseArtifact, so ordinary compilation receives a type that cannot hold annotations and erasure is structural rather than convention-plus-witness. The equality law is stated over the semantic graph projection, excluding textual provenance — inserting a comment necessarily moves byte ranges, so whole-artifact equality was wrong in the prior draft.
  • §2c — annotations must not consume OccurrenceId (the blocking correction). The allocator is graph-scoped, so drawing from it lets a comment shift declaration identities in the same source and in later-parsed modules. First carrier has no annotation identity; the ordered graph carries multiplicity and source order. Target-byte equality cannot prove this — the emitter may ignore occurrence ids and stay byte-identical while the identity graph moves.
  • §2e — attachment narrows to module-item grain, with an explicit AnnotationPlacement observation, because whitespace-as-trivia otherwise makes a trailing comment indistinguishable from a leading one on the next declaration.

D-D approved debt-only: SourceAnnotationRationale is not declared in Slice 1 — a variant with no authoring path, consumer, or lifecycle is speculative vocabulary.

Audit findings that stand

  • The sample measures survivors. Sweep dead prose data-String rows (comments smuggled in strings): 215 rows across ~130 files #6424 swept 215 dead rows before it was drawn, so 0/48 primary-delete cannot refute the dead population or settle representation.
  • Value and representation are independent axes. Every KEEP specimen is worth keeping and wrong as data Foo: String.
  • 56% of annotation bytes carry a time-bound marker — under the ruled model, exactly the facts that must not become annotations.

Doc-graph rebind

From the generic StandingIntent to the seams this work actually changes: v2.std.compilers.lexing LexRule (primary), plus v2.compiler.parse ParseArtifact, v2.extdeps.languages.dag dag_line_comment_fidelity, and v2.test.round_trip.dag_comment_wall_test dag_comment_wall_line_comment_refused.

Verification — green by execution (local binary)

PASS run_generated_artifact_drift_gate_body     <- DESIGN.md == emission
PASS doc_graph_has_no_orphan_docs               PASS doc_graph_has_no_dangling_links
PASS doc_graph_universe_is_nonempty             PASS doc_graph_is_clean
PASS cited_symbol_planted_doc_graph_controls_are_enrolled
PASS cited_symbol_production_population_excludes_planted_controls

The cited-symbol wall passing is what establishes all four new DeclarationRefs resolve to exactly one declaration each.

A CI auto-heal bot regenerated DESIGN.md on this branch concurrently (my auto-WIP pushed the authority edit before I regenerated). Merged, not force-pushed: §4c appears exactly once and DESIGN.md is byte-identical to the bot's regeneration, with the drift gate re-run green after the merge.

Named as unproven: the §2c allocator hazard is reasoned from the allocator being graph-scoped, not demonstrated — the unsafe carrier was never built. The D-C controls are written to prove the disjointness law directly rather than lean on that reasoning. The LexArtifact / AuthoredParseArtifact / SourceAnnotationDebt / AnnotationPlacement shapes do not exist in tree; everything §2 cites as existing was grep-verified, and ShLineComment was found not to exist.

🤖 Generated with Claude Code

@gunbai-bot gunbai-bot Bot changed the title prose cleanup Audit: .dag annotation-prose policy — the 90%-deletable premise, measured Aug 4, 2026
Brian Searls and others added 2 commits August 4, 2026 17:45
Where a split pass would start: 50% of the time-bound marker mass sits
in 63 of 617 files, and 124 mega-notes carry a marker between them.
Names the two head files that are load-bearing per DESIGN so they do
not lead the pass.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…w-value prose

Banning // made comment syntax unwritable but not commentary unwritable.
It removed the only structural signal separating commentary from program
data, so the corpus smuggled prose into data String rows where intent is
mechanically undecidable. Verified as three merged PRs:

  #5579 f9cc238  remove DAG comment trivia rules
  #6262 9e7c3c1  hoist .dag // comments to typed data rows
  #6424 c14e001  sweep 215 dead prose data-String rows

Reframes the destination as a modeled source annotation -- a sidecar on
ParseArtifact, never restored trivia, never a namespace binding -- with
the semantic/authored-source projection pair as the load-bearing law.

Corrects the sample's standing: #6424 swept 215 dead rows before it was
drawn, so it measures survivors and cannot refute the dead population or
settle representation. Value and representation are independent axes: a
note can be irreducible and still wrong as data Foo: String.

Replaces D1-D4 (delete rate, ceilings) with D-A..D-D (carrier,
attachment, erasure, migration). Carries the proposed DESIGN paragraph
for review without landing it. Nothing deleted, migrated, or reconciled.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@gunbai-bot gunbai-bot Bot changed the title Audit: .dag annotation-prose policy — the 90%-deletable premise, measured Audit: .dag prose — the defect is lost source-level intent (// as modeled source annotation) Aug 4, 2026
Brian Searls and others added 4 commits August 4, 2026 18:48
Canonical guidance lands through gunbc.design_document section_4c_blocks
with DESIGN.md regenerated, never hand-edited. The rule: prose is not
forbidden; unclassified prose is. // becomes the explicit quarantine
boundary.

Four structural corrections to the destination:

  2a  a THIRD lexical channel (AnnotationRule), not an ordinary
      TokenRule -- a token still joins the semantic stream and buys
      parser filtering, token-order effects, allocator risk
  2b  AuthoredParseArtifact WRAPS the semantic artifact rather than
      widening it, so ordinary compilation receives a type that cannot
      hold annotations; erasure becomes structural. The equality law is
      over the semantic graph projection, excluding textual provenance,
      because inserting a comment necessarily moves byte ranges
  2c  an annotation must NOT consume a semantic OccurrenceId -- the
      allocator is graph-scoped, so a comment could shift declaration
      identities in the same source and in later modules. First carrier
      has no annotation identity; ordered graph carries multiplicity
  2e  attachment narrows to module-item grain only, with an explicit
      AnnotationPlacement observation so trailing stays distinguishable
      after whitespace removal

D-D approved debt-only: SourceAnnotationRationale is not declared in
Slice 1, since a variant with no authoring path or consumer is
speculative vocabulary.

Doc-graph row rebinds from the generic StandingIntent to the seams this
work actually changes: LexRule, ParseArtifact, dag_line_comment_fidelity,
dag_comment_wall_line_comment_refused.

Nothing deleted, migrated, or reconciled; no slice started.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@gunbai-bot gunbai-bot Bot changed the title Audit: .dag prose — the defect is lost source-level intent (// as modeled source annotation) Source-annotation policy: DESIGN 4c lands; // as captured authored-source data (audit complete, D-A..D-D ruled) Aug 4, 2026
@gunbai-bot
gunbai-bot Bot marked this pull request as ready for review August 4, 2026 19:04
review 48112 (cursor/composer-2.5) caught the trigger naming TokenRule
as the target carrier -- the design D-A explicitly rejects. The trigger
was authored before the operator's correction and not updated with the
audit doc and DESIGN 4c, so a typed scaffold marker was steering Slice 2
at the wrong carrier.

Fixes a second stale claim in the same string the review did not reach:
"semantic-erasure proven by identical emitted bytes". Byte equality is
exactly what D-C says is insufficient -- the emitter may ignore
occurrence ids and stay byte-identical while the identity graph moves.
The trigger now names the seven D-C proofs instead.

Trigger now states: AnnotationRule on a third lexical channel (never
TriviaRule, never TokenRule), authored wrapper over an unchanged
semantic artifact, no semantic occurrence identity consumed, module-item
attachment with trailing/body/unattached/block refusing, erasure by the
seven D-C proofs, and the representation partition complete.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@gunbai-bot

gunbai-bot Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Fixed in 84c2eeb. Thanks — this was a real defect, and it is exactly the failure class this PR exists to describe: a prose statement that kept asserting a superseded design after the model moved.

The finding, confirmed. The HandAuthoredDocBind trigger was authored during the earlier recut, before the operator's structural corrections. I updated the audit doc and DESIGN §4c to the ruled design and did not carry the correction into the trigger string, so a typed scaffold marker was pointing Slice 2 at the rejected carrier.

A second stale claim in the same string, which review 48112 did not reach. The trigger also said semantic erasure would be "proven by identical emitted bytes." That is precisely the insufficiency D-C corrects: the emitter may ignore occurrence ids and stay byte-identical while the occurrence-identity graph moves underneath it. Byte equality cannot establish erasure. The trigger now names the seven D-C proofs rather than the byte check.

The trigger now reads: AnnotationRule on a third lexical channel (never TriviaRule, never an ordinary TokenRule), returning an authored wrapper around an unchanged semantic artifact, consuming no semantic occurrence identity, attached at module-item grain with trailing/body/unattached/block forms refusing, erasure established by the seven D-C proofs, and the representation partition complete.

Swept the rest of the diff for the same class. Every remaining TokenRule mention names it as the rejected option (§2a's title, the existing two-variant type definition, Slice 2's "never TokenRule"), and every byte-equality mention is either D-C proof (4) of seven or the explicit "target-byte equality cannot substitute" caveat. DESIGN §4c never mentions TokenRule — it says an annotation "may not produce an ordinary semantic token or namespace binding." No further instances.

Re-verified green by execution on a locally built binary after the fix:

PASS run_generated_artifact_drift_gate_body
PASS doc_graph_has_no_orphan_docs / no_dangling_links / universe_is_nonempty / is_clean
PASS cited_symbol_planted_doc_graph_controls_are_enrolled
PASS cited_symbol_production_population_excludes_planted_controls

@gunbai-bot

gunbai-bot Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Thanks for the approval (review 48124). No changes needed, but two characterizations in it are inverted in ways a later reader could mistake for defects, so correcting the record rather than letting them stand.

1. The three DeclarationRefs are not forward-references — they all resolve in tree today.

ParseArtifact                          src/v2/compiler/02_parse.dag:131   type ParseArtifact {
dag_line_comment_fidelity              src/v2/extdeps/languages/dag.dag:3382   fn dag_line_comment_fidelity()
dag_comment_wall_line_comment_refused  src/v2/test/claim/round_trip/dag_comment_wall_test.dag:23   test fn ...

This matters because if they were unresolvable forward-references, that would be a defect, not a benign plan-doc idiom: G1 (#7707) requires every typed DeclarationRef to resolve to exactly one declaration or refuse. cited_symbol_production_population_excludes_planted_controls passes on this head, which it could not do against dangling refs. The bind points at live seams the work will change, not at carriers that have yet to exist — which is exactly why it was rebound off the generic StandingIntent after review 48112.

2. DESIGN.md is not a mirror of design_document.dag — it is generated from it.

gunbc.generated_artifact_emit maps DesignArtifact => expected_design_md(), and GeneratedArtifactDriftGate byte-compares the committed file against that emission. The §4c prose exists once, in design_document.dag section_4c_blocks; DESIGN.md is its projection, regenerated via the wet gate, never hand-edited. Describing it as mirrored prose would make this diff an instance of the §3 dual representation the PR argues against, when it is the opposite. run_generated_artifact_drift_gate_body passes, which is what establishes the two are in sync.

Neither point changes the diff, and the approval's substantive read — doc-only, no code, no hand-Rust or hand-shell surface — is accurate.

— sent from fierce-pike-375

@briansrls
briansrls merged commit b56ae60 into main Aug 4, 2026
5 checks passed
@briansrls
briansrls deleted the session/fierce-pike-375 branch August 4, 2026 20:50
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