Repository navigation
T-21 affected_set.dag Wave-0 implementation — IRT-1 whole/changed-subgraph gate #3349
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
Changes from 4 commits
b309e4e
11c7cfb
3ff9fae
1e15af2
ac7a960
a284b65
98acfe3
69bce37
f6d6c3a
a22d65f
8ea7b03
8d64ff8
0918255
8599e11
6f237e0
fd20dac
4280cba
e021b6e
85a433b
6efcab9
19377cf
9f4850b
f785f0e
aead718
f49e633
495e03a
b5bbdec
3193c8e
f36b6c8
bd54256
d827396
49cdd7d
70b6d9d
f49dbca
f1483a7
e5d95ef
33b96e0
7a87a03
b5cef0c
12e75ad
6bade1e
80e7e5b
56c2bc1
bd0751c
b66bc15
5892f82
9a3e51f
5cad48f
e6874be
6d99f26
37ec8f7
b014e41
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,14 @@ | ||
| // src/v4/lens/affected_set.dag | ||
| // Scope: canonical affected-set authority for CI/incremental re-execution; fail-closed B-4/B-5 node frontier. | ||
| // Owns: Dag, AffectedDimension, ExclusionKey, ExclusionProof, FrontierDecision, ReExecFrontier, AffectedSetRead. | ||
| // Consumes: Map, Diff, Node, Path, Symbol, Witness; B-4 resolved Symbol equality; B-5 per-Arrow signature effects. | ||
| // Status: scaffold; dissolves when T-21 read body, CI use, and .dag TestClaims land. | ||
| // Owns: Dag, AffectedDimension, ExclusionKey, ExclusionProof, FrontierDecision, ReExecFrontier, AffectedFrontierMode, AffectedSetRead, affected_set. | ||
| // Consumes: Map, Diff, Edit, Hash, Node, Path, Symbol, Witness; B1 content_hash receipts; B-4 resolved Symbol equality; B-5 per-Arrow signature effects. | ||
| // Status: Wave-0 front: read body + changed-subgraph gate landed; dissolves when CI use and .dag TestClaims land. | ||
|
|
||
| module v4.lens.affected_set | ||
|
|
||
|
|
||
| import v4.std.collection { Map } | ||
| import v4.std.node { Diff, Node, Path, Symbol } | ||
| import v4.std.node { Diff, Edit, Hash, Node, Path, Symbol } | ||
| import v4.std.witness { Witness } | ||
|
|
||
|
|
||
|
|
@@ -17,6 +17,8 @@ type Dag = Node | |
|
|
||
| type AffectedDimension = Symbol | ||
|
|
||
| data affected_dimension_value: Symbol = affected_dimension_value | ||
|
|
||
|
|
||
| type ExclusionKey { | ||
| at: Path | ||
|
|
@@ -28,6 +30,13 @@ type ExclusionKey { | |
| type ExclusionProof | ||
| = EmptyDimensionDelta { subject: Path } | ||
| | DimensionNotRead { producer: Path } | ||
| | UnchangedPureBoundary { subject: Path, content_hash: Hash } | ||
|
|
||
|
|
||
| // 🟢 coproduct dissolution — DECISIONS.md #3153-subsumed; IRT-1 whole/changed-subgraph gate. | ||
| type AffectedFrontierMode | ||
| = ChangedSubgraph { roots: List<Path> } | ||
| | WholeDagFailClosed { reason: Symbol } | ||
|
|
||
|
|
||
| // 🟢 coproduct dissolution — DECISIONS.md #3153-subsumed | ||
|
|
@@ -37,10 +46,162 @@ type FrontierDecision | |
|
|
||
|
|
||
| type ReExecFrontier { | ||
| mode: AffectedFrontierMode | ||
| decisions: Map<ExclusionKey, FrontierDecision> | ||
| } | ||
|
|
||
|
|
||
| type AffectedSetRead { | ||
| hash_receipt: fn(Dag, Path, Node) -> HashReceipt | ||
| read: fn(Dag, Diff) -> Witness<ReExecFrontier> | ||
| } | ||
|
|
||
|
|
||
| // 🟡 coproduct dissolution — DECISIONS.md #3153-subsumed; dissolves into B1 content_hash read receipts. | ||
| type HashReceipt | ||
| = HashUnchanged { content_hash: Hash } | ||
| | HashChanged | ||
| | HashUnknown { reason: Symbol } | ||
|
|
||
|
|
||
| // 🟡 coproduct dissolution — DECISIONS.md #3153-subsumed; dissolves when T-21 .dag TestClaims prove boundary cases. | ||
| type BoundaryReceipt | ||
| = BoundaryPruned { proof: ExclusionProof } | ||
| | BoundaryExpands | ||
| | BoundaryUnknown { reason: Symbol } | ||
|
|
||
|
|
||
| type FrontierAcc { | ||
| mode: AffectedFrontierMode | ||
| decisions: Map<ExclusionKey, FrontierDecision> | ||
| roots: List<Path> | ||
| } | ||
|
|
||
|
|
||
| fn empty_frontier_acc() -> FrontierAcc { | ||
| FrontierAcc { | ||
| mode: ChangedSubgraph { roots: [] }, | ||
| decisions: empty_map(), | ||
| roots: [] | ||
| } | ||
| } | ||
|
|
||
|
|
||
| fn frontier_from_acc(acc: FrontierAcc) -> ReExecFrontier { | ||
| ReExecFrontier { | ||
| mode: acc.mode, | ||
| decisions: acc.decisions | ||
| } | ||
| } | ||
|
|
||
|
|
||
| fn root_key(path: Path) -> ExclusionKey { | ||
| ExclusionKey { | ||
| at: path, | ||
| dimension: affected_dimension_value | ||
This comment was marked as resolved.
Sorry, something went wrong.
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. Valid finding. Fixed across
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. Follow-up valid for the remaining sentinel use. Fixed on current head |
||
| } | ||
| } | ||
|
|
||
|
|
||
| fn mark_rerun(acc: FrontierAcc, key: ExclusionKey) -> FrontierAcc { | ||
| FrontierAcc { | ||
| mode: acc.mode, | ||
| decisions: map_insert(acc.decisions, key, Rerun), | ||
| roots: acc.roots | ||
| } | ||
| } | ||
|
|
||
|
|
||
| fn mark_excluded(acc: FrontierAcc, key: ExclusionKey, proof: ExclusionProof) -> FrontierAcc { | ||
| FrontierAcc { | ||
| mode: acc.mode, | ||
| decisions: map_insert(acc.decisions, key, Excluded { proof: proof }), | ||
| roots: acc.roots | ||
| } | ||
| } | ||
|
|
||
This comment was marked as resolved.
Sorry, something went wrong.
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. Verified against current head |
||
|
|
||
| fn mark_whole_dag(acc: FrontierAcc, reason: Symbol) -> FrontierAcc { | ||
| FrontierAcc { | ||
| mode: WholeDagFailClosed { reason: reason }, | ||
| decisions: acc.decisions, | ||
| roots: acc.roots | ||
| } | ||
| } | ||
|
|
||
|
|
||
| fn append_root(acc: FrontierAcc, path: Path) -> FrontierAcc { | ||
| match acc.mode { | ||
| WholeDagFailClosed { reason: r } => | ||
| FrontierAcc { | ||
| mode: WholeDagFailClosed { reason: r }, | ||
| decisions: acc.decisions, | ||
| roots: list_push(acc.roots, path) | ||
| } | ||
| ChangedSubgraph { roots: _ } => | ||
| FrontierAcc { | ||
| mode: ChangedSubgraph { roots: list_push(acc.roots, path) }, | ||
| decisions: acc.decisions, | ||
| roots: list_push(acc.roots, path) | ||
| } | ||
| } | ||
| } | ||
|
|
||
|
|
||
| fn boundary_receipt(read_model: AffectedSetRead, dag: Dag, path: Path, replacement: Node) -> BoundaryReceipt { | ||
| match read_model.hash_receipt(dag, path, replacement) { | ||
| HashUnchanged { content_hash: h } => | ||
| BoundaryPruned { | ||
| proof: UnchangedPureBoundary { | ||
This comment was marked as resolved.
Sorry, something went wrong.
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. Valid finding. Fixed in |
||
| subject: path, | ||
| content_hash: h | ||
| } | ||
| } | ||
| HashChanged => BoundaryExpands | ||
| HashUnknown { reason: r } => BoundaryUnknown { reason: r } | ||
| } | ||
| } | ||
|
|
||
|
|
||
| fn seed_edit_frontier( | ||
| read_model: AffectedSetRead, | ||
| dag: Dag, | ||
| acc: FrontierAcc, | ||
| edit: Edit | ||
| ) -> FrontierAcc { | ||
| match boundary_receipt( | ||
| read_model: read_model, | ||
| dag: dag, | ||
| path: edit.at, | ||
| replacement: edit.replacement | ||
| ) { | ||
| BoundaryPruned { proof: p } => | ||
| mark_excluded(acc: acc, key: root_key(path: edit.at), proof: p) | ||
| BoundaryExpands => | ||
| append_root( | ||
| acc: mark_rerun(acc: acc, key: root_key(path: edit.at)), | ||
| path: edit.at | ||
| ) | ||
| BoundaryUnknown { reason: r } => | ||
| mark_whole_dag( | ||
| acc: mark_rerun(acc: acc, key: root_key(path: edit.at)), | ||
| reason: r | ||
| ) | ||
| } | ||
| } | ||
|
|
||
|
|
||
| fn affected_set(read_model: AffectedSetRead, dag: Dag, diff: Diff) -> Witness<ReExecFrontier> { | ||
| Holds { | ||
| value: frontier_from_acc( | ||
| acc: fold(diff.edits, init: empty_frontier_acc(), f: fn(acc, edit) { | ||
This comment was marked as resolved.
Sorry, something went wrong.
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. Valid finding. Addressed on current head |
||
| seed_edit_frontier( | ||
| read_model: read_model, | ||
| dag: dag, | ||
| acc: acc, | ||
| edit: edit | ||
| ) | ||
| }) | ||
| ) | ||
| } | ||
| } | ||
This comment was marked as resolved.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
Verified against current head
bd54256880477c8be7fe47dfe014ae99249e03f2: this is already structurally prevented.BoundaryPrunedcarriesBoundaryExclusionProof, notExclusionProof;BoundaryExclusionProofonly hasUnchangedPureBoundary, while dimension/key-specific evidence remains inExclusionProofforFrontierDecision.Excluded. — sent from neat-badger-436