Repository navigation
T-30 — generated hollow-alias .dag checker (Node->Outcome fail-closed; substrate-native) #3359
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
188b924
WIP: T-30 — generated hollow-alias .dag checker (Node->Outcome fail-c…
briansrls ea88f72
T-30: generated substrate-native hollow-alias checker (Node -> Outcom…
briansrls 8f3765e
T-30: module_no_hollow_alias returns Outcome<Bool> — preserve fail-cl…
briansrls d320570
WIP: T-30 — generated hollow-alias .dag checker (Node->Outcome fail-c…
briansrls 0bc1b82
WIP: T-30 — generated hollow-alias .dag checker (Node->Outcome fail-c…
briansrls ed46a3b
T-30: drop carrier_spec_fact ComputationNode variant-abuse; fix chang…
briansrls c01b099
WIP: T-30 — generated hollow-alias .dag checker (Node->Outcome fail-c…
briansrls 6e18dd4
T-30: fact-density discriminator rework — NonZeroNat carrier, well-fo…
briansrls bd60903
T-30: sync SourceSpecReadFact ledger row to the NonZeroNat density ca…
briansrls beaa52b
Merge remote-tracking branch 'origin/main' into session/bold-bear-747
briansrls ef2780a
Merge remote-tracking branch 'origin/main' into session/bold-bear-747
briansrls 1c42962
Merge remote-tracking branch 'origin/main' into session/bold-bear-747
briansrls 3f3f47c
Merge remote-tracking branch 'origin/main' into session/bold-bear-747
briansrls 27f3e4d
WIP: T-30 — generated hollow-alias .dag checker (Node->Outcome fail-c…
briansrls 168ff08
T-30 (operator RULING-6): complete fact_density std->lens move — dele…
briansrls ed5bc02
T-30 (RULING-6): connective_spec_fact refined-alpha — factor connecti…
briansrls 3d6d2d5
Merge branch 'main' into session/bold-bear-747
briansrls File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,98 @@ | ||
| // src/v4/lens/fact_density.dag | ||
| // Scope: T-30 fact-density lens — a pure-advisory read that classifies each type carrier by the spec facts it records, surfacing carriers with empty fact-cardinality. | ||
| // Owns: SourceSpecReadFact, fact_density_kernel_ambient_string, fact_density_kernel_ambient_int, fact_density_kernel_ambient_bool, fact_density_kernel_ambient_char, fact_density_kernel_ambient_list, fact_density_kernel_ambient_map, symbol_is_kernel_ambient, named_fact_count, density_fact, connective_is_kernel_ambient_atom, connective_spec_fact, carrier_spec_fact. | ||
| // Consumes: std node, std nat, std cardinality. | ||
| // Status: T-30 lens — pure-advisory read; enforcement is the downstream apply_lens(Enforce) bridge, not this file. | ||
| // Anchor: https://github.com/gunb-ai/gunbc/blob/main/src/v4/TASKS.md | ||
|
|
||
| module v4.lens.fact_density | ||
|
|
||
|
|
||
| import v4.std.node { | ||
| Node, | ||
| Edge, | ||
| Named, | ||
| Positional, | ||
| Connective, | ||
| Atom, | ||
| Conj, | ||
| Disj, | ||
| Arrow, | ||
| Cardinality, | ||
| Instantiation, | ||
| TypeNode, | ||
| ComputationNode, | ||
| Symbol | ||
| } | ||
| import v4.std.nat { Nat, Zero, Succ } | ||
| import v4.std.cardinality { NonZeroNat } | ||
|
|
||
|
|
||
| data fact_density_kernel_ambient_string: Symbol = fact_density_kernel_ambient_string | ||
| data fact_density_kernel_ambient_int: Symbol = fact_density_kernel_ambient_int | ||
| data fact_density_kernel_ambient_bool: Symbol = fact_density_kernel_ambient_bool | ||
| data fact_density_kernel_ambient_char: Symbol = fact_density_kernel_ambient_char | ||
| data fact_density_kernel_ambient_list: Symbol = fact_density_kernel_ambient_list | ||
| data fact_density_kernel_ambient_map: Symbol = fact_density_kernel_ambient_map | ||
|
|
||
|
|
||
| fn symbol_is_kernel_ambient(s: Symbol) -> Bool { | ||
| s == fact_density_kernel_ambient_string || | ||
| s == fact_density_kernel_ambient_int || | ||
| s == fact_density_kernel_ambient_bool || | ||
| s == fact_density_kernel_ambient_char || | ||
| s == fact_density_kernel_ambient_list || | ||
| s == fact_density_kernel_ambient_map | ||
| } | ||
|
|
||
|
|
||
| // 🟢 coproduct dissolution — DECISIONS.md classification ledger: SourceSpecReadFact. | ||
| type SourceSpecReadFact | ||
| = NamedFieldFacts { density: NonZeroNat } | ||
| | KernelAmbientAtom | ||
| | NoFact | ||
| | NotATypeCarrier | ||
|
|
||
|
|
||
| fn named_fact_count(children: List<Edge>) -> Nat { | ||
| fold(children, init: Zero, f: fn(acc, e) { | ||
| match e.label { | ||
| Named { name: _ } => Succ { prev: acc } | ||
| Positional => acc | ||
| } | ||
| }) | ||
| } | ||
|
|
||
|
|
||
| fn density_fact(named_facts: Nat) -> SourceSpecReadFact { | ||
| match named_facts { | ||
| Zero => NoFact | ||
| Succ { prev: p } => NamedFieldFacts { density: NonZeroNat { prev: p } } | ||
| } | ||
| } | ||
|
|
||
|
|
||
| fn connective_is_kernel_ambient_atom(c: Connective) -> Bool { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. BLOCKING: connective_is_kernel_ambient_atom is a new Bool predicate over the Connective coproduct with no Practice-10 disposition tag or DECISIONS receipt, violating predicate-dissolution discipline. |
||
| match c { | ||
| Atom { identity: id } => symbol_is_kernel_ambient(s: id) | ||
| _ => false | ||
| } | ||
| } | ||
|
|
||
|
|
||
| fn connective_spec_fact(c: Connective, named_facts: Nat) -> SourceSpecReadFact { | ||
| if connective_is_kernel_ambient_atom(c: c) { | ||
| KernelAmbientAtom | ||
| } else { | ||
| density_fact(named_facts: named_facts) | ||
| } | ||
| } | ||
|
|
||
|
|
||
| fn carrier_spec_fact(carrier: Node) -> SourceSpecReadFact { | ||
| match carrier.kind { | ||
| ComputationNode { behavior: _ } => NotATypeCarrier | ||
| TypeNode { connective: c } => | ||
| connective_spec_fact(c: c, named_facts: named_fact_count(children: carrier.children)) | ||
| } | ||
| } | ||
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| // src/v4/test/claim/manual/fact_density_anchor.dag | ||
| // Scope: T-30 v2-bootstrap compile anchor — exercises the fact-density lens read on a hollow alias, a fact-bundle carrier, and a kernel-ambient atom. | ||
| // Owns: fact_density_anchor_int32_symbol, fact_density_anchor_width_field, fact_density_anchor_signedness_field, fact_density_anchor_hollow_alias, fact_density_anchor_fact_bundle, fact_density_anchor_kernel_ambient_bool, anchor_hollow_alias_read, anchor_fact_bundle_read, anchor_kernel_ambient_bool_read. | ||
| // Consumes: lens fact_density, std node. | ||
| // Status: scaffold — compile-only until T-22; lens read pinned in lens/fact_density.dag. | ||
| // Anchor: https://github.com/gunb-ai/gunbc/blob/main/src/v4/TASKS.md | ||
|
|
||
| module v4.test.claim.manual.fact_density_anchor | ||
|
|
||
|
|
||
| import v4.lens.fact_density { | ||
| carrier_spec_fact, | ||
| SourceSpecReadFact, | ||
| fact_density_kernel_ambient_bool | ||
| } | ||
| import v4.std.node { | ||
| Node, | ||
| TypeNode, | ||
| Atom, | ||
| Conj, | ||
| Edge, | ||
| Named, | ||
| Symbol | ||
| } | ||
|
|
||
|
|
||
| data fact_density_anchor_int32_symbol: Symbol = fact_density_anchor_int32_symbol | ||
|
|
||
| data fact_density_anchor_hollow_alias: Node = Node { | ||
| kind: TypeNode { connective: Atom { identity: fact_density_anchor_int32_symbol } }, | ||
| children: [] | ||
| } | ||
|
|
||
|
|
||
| data fact_density_anchor_width_field: Symbol = fact_density_anchor_width_field | ||
| data fact_density_anchor_signedness_field: Symbol = fact_density_anchor_signedness_field | ||
|
|
||
| data fact_density_anchor_fact_bundle: Node = Node { | ||
| kind: TypeNode { connective: Conj }, | ||
| children: [ | ||
| Edge { | ||
| label: Named { name: fact_density_anchor_width_field }, | ||
| target: fact_density_anchor_hollow_alias | ||
| }, | ||
| Edge { | ||
| label: Named { name: fact_density_anchor_signedness_field }, | ||
| target: fact_density_anchor_hollow_alias | ||
| } | ||
| ] | ||
| } | ||
|
|
||
|
|
||
| data fact_density_anchor_kernel_ambient_bool: Node = Node { | ||
| kind: TypeNode { connective: Atom { identity: fact_density_kernel_ambient_bool } }, | ||
| children: [] | ||
| } | ||
|
|
||
|
|
||
| fn anchor_hollow_alias_read() -> SourceSpecReadFact { | ||
| carrier_spec_fact(carrier: fact_density_anchor_hollow_alias) | ||
| } | ||
|
|
||
|
|
||
| fn anchor_fact_bundle_read() -> SourceSpecReadFact { | ||
| carrier_spec_fact(carrier: fact_density_anchor_fact_bundle) | ||
| } | ||
|
|
||
|
|
||
| fn anchor_kernel_ambient_bool_read() -> SourceSpecReadFact { | ||
| carrier_spec_fact(carrier: fact_density_anchor_kernel_ambient_bool) | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BLOCKING: named_fact_count directly matches EdgeLabel instead of consuming std/node.dag's declared edge_is_named query, so the lens re-derives lower-layer storage shape and violates INVARIANTS P2/L-7 single-authority boundary discipline.