Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
142 commits
Select commit Hold shift + click to select a range
8b48c67
v2: the reference-site collector resolution_provenance has been missi…
Sep 12, 2026
5b1af9c
NAMESPACE-XL XL-0: the repair-input origin denominator, on the v2 route
Sep 12, 2026
70ec489
stage0 mirror: regenerate std_repair_input_origin.rs for the XL-0 car…
Sep 12, 2026
13f5c67
Deliver XL-4: reference-derived ModuleDependencyEdge producer and ins…
Sep 12, 2026
8426915
Delete repair_input_origin_roster_is_empty: a bare alias with no cons…
Sep 12, 2026
c5488f3
Floor repair: exhaustive elimination, in-body annotations, and one da…
Sep 12, 2026
47f20e7
Keep XL-4 discrimination on the instrument, not a floor claim.
Sep 12, 2026
4f3c760
v2: the reference-site collector resolution_provenance has been missi…
Sep 12, 2026
ea4238c
Rewire XL-4 edges onto the one reference-site collector.
Sep 12, 2026
e6ea6c1
Merge commit '8b48c67835f' into session/warm-ibex-518
Sep 12, 2026
dab04b6
Withdraw the XL-0 delivery claim: the denominator was green on fixtur…
Sep 12, 2026
9fa970a
Rework XL-4 evidence onto the one collector and a mutant.
Sep 12, 2026
a52b63c
Unreadable module roots become a typed, located, COUNTED refusal (ret…
Sep 12, 2026
3e52e7a
Record the call-argument collector undercount on parse and normalize.
Sep 12, 2026
05aeec8
Measure type-position and body-value misses on parse and normalize.
Sep 12, 2026
886387a
Collector: per-segment spine unwrap, linear traversal, and the cross-…
Sep 12, 2026
4ac0342
Measure the deleted parse QN walk on type-position vs body, as an ora…
Sep 12, 2026
c85c3fa
Consume ReferenceSiteCollection: pass .sites, refuse unreadable roots…
Sep 12, 2026
d619e1c
Ingest XL-4 on the XL-0 assembly route, not a bare parse_module.
Sep 12, 2026
3677566
Drop unused imports from the production-ingest measurement module.
Sep 12, 2026
9b6833b
The census was measuring one root and reporting for two: type positio…
Sep 12, 2026
2b3430e
XL-0's restoration trigger named less than the capability it restores
Sep 12, 2026
c97b97a
Widen the XL-4 undercount: type-position is independent of calls, and…
Sep 12, 2026
d913e56
State that today's collector route has no usable XL-4 edge class.
Sep 12, 2026
950480f
Hold the qualified-cross-module frontier off the body-lowering trigger.
Sep 12, 2026
feb888c
Unhold type-position from the retracted collector-absence claim.
Sep 12, 2026
7338990
Measure type-position on this fixture: the collector sees it, the edg…
Sep 12, 2026
9c4bd0f
A test green for the wrong reason: "Bool reaches" was matching the im…
Sep 12, 2026
59a43ca
Confirm the discriminator is qualification, not type position.
Sep 12, 2026
41e6c73
Record on the XL-4 producer that qualification, not type position, is…
Sep 12, 2026
c5d99d9
Merge origin/main after #10940 freeze release.
Sep 12, 2026
6d93d4d
Import mentions become their own arm; the spine recogniser moves to i…
Sep 12, 2026
05836d1
Imports never reach this route: the arm's controls were unauthorable …
Sep 12, 2026
1635fee
Enroll a bare field-type absence as a fourth class, not a dotted case.
Sep 12, 2026
a76a644
A third reference-site enumerator already existed; record the overlap…
Sep 13, 2026
92d92d3
Enroll a tree-side census of the record-with-field fixture, cause unv…
Sep 13, 2026
f031d21
State on the instrument that qualified mentions are under verification.
Sep 13, 2026
2468d7f
Trigger the qualified-reference frontier on the dotted-reference capa…
Sep 13, 2026
a2e5197
Record the collector-only ruling on the parse-QN oracle module.
Sep 13, 2026
7f418e9
Call is_empty instead of re-inventing it in a fold
Sep 13, 2026
43b08d9
Merge origin/main into session/sharp-owl-21
Sep 13, 2026
76f8c41
XL-4: withhold the delivery receipt and require a positive control in…
Sep 13, 2026
0a026f5
The instrument the carriers cite contradicted them on the trigger
Sep 13, 2026
3057bef
XL-4: refuse an importer absent from the reference pool; compute impo…
Sep 13, 2026
f15eb86
Merge origin/main (#11200 interlock + status carrier) into session/sh…
Sep 13, 2026
70c3745
Remove the orphan XL-0 delivery kind the withdrawal left behind
Sep 13, 2026
c32fca6
The cheap reject becomes the fold's own first step; both Bool predica…
Sep 13, 2026
f88cd9f
Share the fixture pipeline as data rows: the floor was interrupted, n…
Sep 13, 2026
77382e8
Put the dissolution condition in the typed carrier, not the narrative…
Sep 13, 2026
aee736b
Share the fixture ingest warm: the floor's frame is narrower than the…
Sep 13, 2026
f343b32
Both carriers said "a type-position name"; the instrument says which one
Sep 13, 2026
1aff8b5
File the expensive class, not just the cheap one; declare the stall u…
Sep 13, 2026
b73e6f5
The sibling probe re-derived the same ingest; consume the warm producer
Sep 13, 2026
a34ac8f
Merge remote-tracking branch 'origin/main' into session/sharp-owl-21
Sep 13, 2026
85acbcd
Delete the import arm: it is the decoration this PR refuses one file …
Sep 13, 2026
ba06ca0
Run my own rule on my own deletion: two orphans, not one
Sep 13, 2026
e541fb6
Share the XL-4 fixture ingest warm; cite measurements from typed carr…
Sep 13, 2026
81fdeff
Merge origin/main into session/warm-ibex-518
Sep 13, 2026
dab1d5f
XL-3: declaring-identity spelling carrier and verdict fold, file fixt…
Sep 12, 2026
417672f
XL-3: record measured collector coverage, not a silent empty ingest.
Sep 12, 2026
184225f
XL-3: wire the spelling census producer on the production ingest route.
Sep 12, 2026
ab415d9
XL-3: type-position kernel loss is not the call-lowering trigger.
Sep 12, 2026
1c98869
XL-3: the spelling census producer is wired, not held.
Sep 12, 2026
e14a7f9
XL-3: the usable class is a qualified cross-module mention, and it is…
Sep 12, 2026
dde7b6d
XL-3: drop dead fixture-path strings and the tautological coverage ch…
Sep 12, 2026
fc61bf6
XL-3: type-position fixtures observe; they are not held on a retracte…
Sep 12, 2026
2ce8184
XL-3: the miss is qualification, not type-position.
Sep 12, 2026
aaaada3
XL-3: name qualification, not lowering, on the producer comment.
Sep 12, 2026
b6a6c18
XL-3: IdentityUnbound is an index-path miss; frontiers are three capa…
Sep 12, 2026
f3ee6c8
XL-3: record the index-path Unbound cause on the producer.
Sep 12, 2026
b40d4e1
XL-3: measure a dotted field type as its own row, not merged with the…
Sep 12, 2026
45c5e32
XL-3: drop the Bool requalification helper and Symbol == alias.
Sep 12, 2026
8112d7c
XL-3: refuse a fabricated empty census on ingest Rejected.
Sep 13, 2026
46a93b1
XL-3: ingest committed fixture files; consume carrier_provenance.
Sep 13, 2026
0639108
XL-3: import filesystem_io so production-ingest witnesses can read fi…
Sep 13, 2026
6e7eea2
Type the empty located-root init and fold only the measured pair
Sep 13, 2026
e35ea87
Use the typed empty located-root list on the missing-provider arm
Sep 13, 2026
199c4da
State the binding frontier beside the declaration, not in a PR body
Sep 13, 2026
5df20bf
Parse-tree probes measure the collector, not the edge fold
Sep 13, 2026
fe4a4db
Merge origin/session/sharp-owl-21: inherit #11201 binding-frontier row.
Sep 13, 2026
463200b
XL-3: inherit #11201's spelling-derived DeclarationRef frontier.
Sep 13, 2026
9b26bcc
Merge origin/main into session/warm-ibex-518
Sep 13, 2026
9b010d6
Ingest the committed XL-4 fixtures; refuse a missing pair (review 65417)
Sep 13, 2026
eae8093
Merge origin/main into session/warm-ibex-518
Sep 13, 2026
afd0f4b
Name the XL-0 consumers of collect_reference_sites as a declared fron…
Sep 13, 2026
64e4fd4
The QN-shape gate belongs beside the fold it guards; the swap body is…
Sep 13, 2026
41721a1
Merge origin/main into session/warm-ibex-518
Sep 13, 2026
56cf735
Fold the qualified-name shape gate into the fold's own entry; the col…
Sep 13, 2026
a9bad7d
Key the declared constructor and the pattern with one identity
Sep 13, 2026
64d4299
WIP probe: is a dotted Disj arm authorable, and does it reach exhaust…
Sep 13, 2026
72f7b56
Key variant lookup with the same identity, and enroll the paired redu…
Sep 13, 2026
9583dd2
Carry the path with the tree out of the assembly fold; delete the pos…
Sep 13, 2026
3671563
stage0 mirror: regenerate v1_compiler_infer_patterns
Sep 13, 2026
d6b94c9
Delete the import-syntax switch from the production edge fold; compos…
Sep 13, 2026
e39ef94
Ambiguity refuses: a shared leaf key binds nothing
Sep 13, 2026
06c001c
stage0 mirror: regenerate the ambiguity refusal
Sep 13, 2026
b7c2f67
Make the qualified-name shape gate verdict-preserving: a zero-child C…
Sep 13, 2026
77c99ea
SystemdUnitProperty declared SubState twice
Sep 13, 2026
9a9b2e6
Failure mode: a coproduct declares one variant twice
Sep 13, 2026
54c98aa
Merge #11202 (session/warm-ibex-518) into integration/namespace-xl
Sep 16, 2026
6db8bda
Merge #11201 (session/sharp-owl-21) into integration/namespace-xl
Sep 16, 2026
745cb06
Merge remote-tracking branch 'origin/session/quick-otter-229' into in…
Sep 16, 2026
8595261
Merge #11301 (session/neat-moth-241) into integration/namespace-xl
Sep 16, 2026
9010bd5
Admit the XL-1 emit-rust repair-row interpreter bridge so v2 can pers…
Sep 12, 2026
e863ba5
Widen the XL-1 bridge to PrimaryRoot and execute it.
Sep 12, 2026
bd0cb3f
cherry-pick a136d012f4: superseded by #11203's review-65481 typed rep…
Sep 12, 2026
f49fe04
Keep the PrimaryRoot tap host-private behind the one builtin.
Sep 12, 2026
5957ac1
Give the repair-row coproduct one dag home and refuse tap failure as …
Sep 12, 2026
6f80598
Give ReferenceDerivedCandidateRow its generated module home.
Sep 13, 2026
033c570
Make XL-1 capture capable and enroll a persisted carrier against a pin.
Sep 13, 2026
06e0d8a
Keep the production pre-cut pin unpinned until ACT-0 names the base.
Sep 13, 2026
70227a1
Drop dangling XL-1 persist aliases, dissolution String, and the uninh…
Sep 13, 2026
7ac8e3d
Roster the XL-1 emit_host host on the seed-growth justification.
Sep 13, 2026
f710427
Make the remaining capture-refusal arm a unit variant so it inhabits.
Sep 13, 2026
4bcc89c
stage0 mirrors: install the four adjudicated candidates for the integ…
Sep 16, 2026
ab2ec3c
seed: v1_interpreter.rs = main's file plus #11209's two additive hunk…
Sep 16, 2026
bce4df7
Merge remote-tracking branch 'origin/main' into integration/namespace-xl
Sep 16, 2026
0a7376d
heal: regenerate v1_interpreter_dispatch_generated.rs from the primit…
Sep 16, 2026
840df7d
Merge remote-tracking branch 'origin/main' into integration/namespace-xl
Sep 16, 2026
7898426
declaring_identity_spelling: keep the data row's expression on its '=…
Sep 16, 2026
114ba1d
Admit the sixty-six reference-derived-candidate home moves; home the …
Sep 16, 2026
557188a
Merge origin/main into integration/namespace-xl
Sep 16, 2026
30a65f9
Refuse a malformed bridge row instead of dropping it (review 66826); …
Sep 16, 2026
e398337
XL-3 instrument label names the capability still missing, not the pro…
Sep 16, 2026
c4b3fc7
XL-1: the tap's Observed arm gets an executing positive control; Capt…
Sep 16, 2026
01d5517
One derivation of the primary-root subject, consumed by the compile t…
Sep 16, 2026
b080baa
XL-1 reports CaptureBlocked until the Observed arm executes on a requ…
Sep 16, 2026
aaa2dab
Withdraw the XL-1 Observed-arm controls (the floor executes a changed…
Sep 16, 2026
5352555
XL-4: prove by execution that a headerless module root is counted, no…
Sep 16, 2026
8d78cf6
Delete the dangling XL-6 roster alias and its vacuous witness (review…
Sep 16, 2026
05a0bef
Merge origin/main into integration/namespace-xl (admission rows reloc…
Sep 16, 2026
1cc0117
XL-1: the block's restoring receipt names the admission capability, n…
Sep 16, 2026
e424b72
program_assembly: LocatedNormalizedTree is a plain record so the emit…
Sep 16, 2026
b5d045c
Merge origin/main into integration/namespace-xl
Sep 16, 2026
9ccd19c
One census-only derivation for the compile transaction and the XL-1 t…
Sep 16, 2026
9f0143d
Cut the five production Symbol-equality copies over to v2.std.node sy…
Sep 16, 2026
3428cd5
qualified_name: the spine label set is one authority consumed by the …
Sep 17, 2026
3d35de1
decl_fact_value_projection witness consumes v2.std.node symbol_eq (fl…
Sep 17, 2026
c0ae8f9
Merge origin/main into integration/namespace-xl (#11265 root-row admi…
Sep 17, 2026
78a801e
XL-1: the Observed arm executes on the required floor over a measured…
Sep 17, 2026
afa916d
Merge origin/main into integration/namespace-xl; XL-1 reads CaptureAv…
Sep 17, 2026
3089b2f
Failure-mode row a_gate_sized_for_the_largest_subject: rung, receipt …
Sep 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions dag/extdeps/systemd/systemd.dag
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ type SystemdUnitProperty
| SubState
| Result
| ExecMainStatus
| SubState
| ExecStartProperty
| User
| WorkingDirectoryProperty
Expand Down Expand Up @@ -108,7 +107,6 @@ fn systemd_unit_property_wire(property: SystemdUnitProperty) -> NonEmptyStr {
SubState => "SubState" as NonEmptyStr
Result => "Result" as NonEmptyStr
ExecMainStatus => "ExecMainStatus" as NonEmptyStr
SubState => "SubState" as NonEmptyStr
ExecStartProperty => "ExecStart" as NonEmptyStr
User => "User" as NonEmptyStr
WorkingDirectoryProperty => "WorkingDirectory" as NonEmptyStr
Expand Down
11 changes: 6 additions & 5 deletions dag/gunbc/compiler_frontend_program_status.dag
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ type MissingInstrument
fn missing_instrument_label(i: MissingInstrument) -> String {
match i {
PhaseCargoExecutionFact => "a per-phase cargo-execution fact on gunbc.required_ci_phase_roster"
DeclaringIdentitySpellingCensus => "a census of occurrences not spelled at their declaring identity (XL-3's population)"
RepairInputOriginRosterProducer => "a repair-input origin roster producer: source-declaration carriers plus rendered target-vocabulary carriers, separately typed, over one base, before eligibility or repair disposition (XL-0's population)"
DeclaringIdentitySpellingCensus => "a declaring-identity spelling census that answers over XL-3's usable population on the production ingest route: QUALIFIED cross-module mentions (every position) and bare type names in FIELD position, joined to their declaring identity - the producer v2.compiler.declaring_identity_spelling_census spelling_census_from_ingest exists and answers over the bare same-module classes only, which is not that population (XL-3's population)"
RepairInputOriginRosterProducer => "a repair-input origin roster producer that yields a NON-EMPTY denominator over the tree the production ingest actually yields: source-declaration carriers plus rendered target-vocabulary carriers, separately typed, over one base, before eligibility or repair disposition (XL-0's population)"
ExactOccurrenceResidualCensus => "the exact occurrence and import-declaration residual an XL-2 rehearsal produces (XL-5's population)"
PersistedBehavioralReceipt => "a persisted behavioral receipt over a discriminating corpus"
PersistedPromotionOutcome => "a persisted PromotionOutcome over a named candidate"
Expand Down Expand Up @@ -404,7 +404,8 @@ fn stage_subject_outstanding(stage: NamespaceCutStage) -> List<String> {
// named, observed piece of outstanding work, and reporting it unanswerable hid real known
// work behind the missing-instrument label. The AVAILABLE arm reads the persist outstanding
// fold: v2.workflow.legacy_baseline_persisted_observation holds a capture by its own
// GitObjectId, never a receipts roster, and the live pin is unpinned until ACT-0 names a base.
// GitObjectId, never a receipts roster. Production pin stays PreCutBaseUnpinned until ACT-0
// names B; the AVAILABLE arm is outstanding until then. That is not ACT-0's BaselineCaptureReceipt.
// THE THREE DELETION MILESTONES, DERIVED FROM THE SUBJECT ROSTER SINCE F-0 -- at DECLARED-ROW
// grain, stated at exactly that strength. gunbc.namespace_cut_subject_roster carries every
// authority scheduled to disappear as string-identity probes (not authored citations, which
Expand Down Expand Up @@ -902,7 +903,7 @@ fn stage_status(s: NamespaceCutStage) -> MilestoneStanding {
)
StageXL0Denominator =>
NotDerivable {
why: "XL-0 is the REPAIR-INPUT ORIGIN DENOMINATOR -- source-declaration carriers plus rendered target-vocabulary carriers, separately typed, over one base, before eligibility or repair disposition. XL-0A splits and tags the six producer channels before their compatibility projection, but it deliberately does not claim the source declaration continuity or subject-bound roster that XL-0B-D owe. The arm that used to stand here read gunbc.namespace_cut_subject_roster's unobservable host probes instead, which answered a different question entirely: the subject roster is the cut's ROOT-AUTHORITY denominator, one row per family, and probe observability is a property of the instrument rather than a measure of the denominator's completeness. Deriving XL-0 from it let a join repair read as the denominator being produced. Derivable once the repair-input origin roster producer is complete." as NonEmptyStr,
why: "XL-0 is the REPAIR-INPUT ORIGIN DENOMINATOR, and the producer built for it does not yet answer over the tree production yields. THIS ARM BRIEFLY READ CLEAR OFF A DELIVERY RECEIPT AND THAT WAS WRONG: the receipt was earned against HAND-BUILT Node trees, while a substrate-only fixture driving the real ingest -- v2.compiler.program_assembly module_roots_from_source_root_ingest, projected through v2.compiler.normalized_tree normalized_tree_roots_to_nodes -- showed the collector returning NO sites at all for a module that plainly contains them. Independently reproduced by the XL-4 lane over real .dag files. A stage that reads CLEAR off a green-on-fixtures, empty-on-corpus instrument is reporting a denominator that does not exist, which is DESIGN section 5 silent wrongness rather than an incomplete measurement, so the honest standing is NOT DERIVABLE and the instrument stays outstanding. Re-run rather than trust this sentence: v2.test.claim.namespace_xl0.call_argument_mention_survival. THE MISS IS NOT ONE FACT AND ITS TRIGGER IS NOT ONE TRIGGER. Measured over every ingested root, a bare same-module value reference, a parameter reference and a bare type name in PARAMETER position all reach the producer; a QUALIFIED CROSS-MODULE reference, a call argument, a callee name and a bare type name in FIELD position do not. WRITING THAT AS \"a type-position name\" WOULD BE TOO COARSE AND AN EARLIER REVISION OF THIS ARM WROTE IT THAT WAY: the same bare spelling reaches from a parameter and does not reach from a field, so a trigger written against the merged class retires while half of it stays dead. The cross-module row is why there is no denominator, because an import-to-containment denominator is made of references that cross a module boundary and the surviving population is the part XL-0 cannot use. Two causes were mine and are fixed -- a parse-projection exclusion that blacked out the corpus, and a census that folded the roots while discarding its accumulator and so measured only the last one, which manufactured a reported type-position miss that does not exist. The third is open and deliberately unattributed: a dotted reference in a BODY is not a qualified-name production at all, so the collector never reassembles it, and whether resolution itself reads dotted body access is UNANSWERED because the probe built for it fails its own control. A FOURTH is open and also unattributed, and it is not a dotted case because the spelling that misses carries no dot: the bare FIELD-position miss, reproduced on two routes, where the whole record declaration is findable in the ingested tree as neither an atom nor a named edge while a parameter-type control is present. Cause unestablished on purpose -- if the declaration is absent from the tree then no collector-side trigger could ever fire. Producer: v2.test.claim.namespace_xl0.field_type_tree_presence. So the body-lowering repair (XL-2, gunbc#11207) is NOT this stage's trigger: it restores the call classes and leaves the cross-module class missing, and a trigger naming less than the capability it restores is retired while the capability stays dead (DESIGN section 4b(3)). Derivable once the producer answers non-empty over CROSS-MODULE references on the production route. THE CAPABILITY THIS STAGE WAITS ON IS UNOWNED, AND THAT IS STATED HERE RATHER THAN LEFT TO BE INFERRED FROM THE ABSENCE OF A LANE: the call classes have an owner (XL-2, gunbc#11207) and the cross-module dotted-reference capability -- the only one XL-0 actually needs -- has none. DESIGN section 4b(2) admits a stall only when it is declared, and separates cannot-climb from can-climb-after-one-grounding from can-climb-now-but-unbuilt; this is the THIRD, so the honest reading is not that XL-0 is blocked by physics but that nobody is assigned to it. A stage whose trigger points at unowned work will sit here indefinitely while every carrier around it reads as though progress were scheduled." as NonEmptyStr,
cause: needs(i: RepairInputOriginRosterProducer)
}
StageXL1BaselineCapture =>
Expand All @@ -921,7 +922,7 @@ fn stage_status(s: NamespaceCutStage) -> MilestoneStanding {
)
StageXL3DeclaringIdentitySpelling =>
NotDerivable {
why: "no carrier censuses occurrences not yet spelled at their declaring identity. The wave wall's binding channel keys on leaf segments, deliberately invariant under requalification, so it cannot answer this either. Derivable once the spelling census exists." as NonEmptyStr,
why: "the spelling census producer exists (v2.compiler.declaring_identity_spelling_census spelling_census_from_ingest) over the production ingest route. Frontiers are separate capabilities: BARE value outside a call, parameter reference, and BARE type name in PARAMETER position reach; BARE type name in FIELD position does not (not a qualification fact -- measured by v2.test.claim.declaring_identity_spelling.production_ingest field_vs_parameter); names inside calls are missing (body-lowering, eager-raven / #11207); QUALIFIED/dotted references are missing in every position (dotted-reference gap, not lowering). A qualified field type is absent for both independent reasons and cannot discriminate. kernel Int has no corpus declaration. IdentityUnbound on a same-module ingest census row is an index-path probe, not a compiler fact -- enrolled control v2.test.claim.provenance.cross_file_provenance cfp_own_module_site binds on resolve_reference_provenance. Derivable once the producer answers over qualified mentions; restoring dotted will not restore bare field types. The producer landed with #11201 in gunbc#11461; what remains UNBUILT is the capability the instrument label names, not the producer file." as NonEmptyStr,
cause: needs(i: DeclaringIdentitySpellingCensus)
}
StageXL4ReferenceDerivedGraph =>
Expand Down
200 changes: 200 additions & 0 deletions dag/gunbc/instruments/reference_derived_graph.dag
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
module tools.reference_derived_graph

import std.process { ExitSuccess, ProcessExit, exit_failure }
import std.types { Bool, List, String }
import extdeps.filesystem.filesystem_io
import v2.std.algebra { any, fold_list }
import v2.std.diagnostic { Accepted, Outcome, Rejected }
import v2.lens.module_graph {
ImportResolutionFact,
ModuleDependencyEdge,
dependency_edges_from_import_facts,
import_resolution_facts_live,
reference_derived_resolution_facts,
}

// XL-4 instrument: the reference-derived graph (swap body of v2.lens.module_graph) and its
// typed difference against the import-derived graph, over a named source root.
//
// gunbc run --source-root dag --source-root src/v2 \
// --entry dag/gunbc/instruments/reference_derived_graph.dag --function main
//
// Discriminating run is the fixture root below. Qualified mentions are a declared frontier
// triggered on the dotted-reference capability, not lowering. Call contents are
// eager-raven-113. Bare field types have a tree-side census with UNVERIFIED cause. Collector-only.
// Unused-import-must-not-mint-a-reference-edge still is. It does not swap
// dependency_resolution_facts_live (NAMESPACE-XL STAGE XL-6).

data instrument_source_roots: List<String> = ["dag/test/fixture/reference_derived_graph"]

data instrument_exclude: List<String> = []

data provider_module: String = "test.fixture.reference_derived_graph.provider"

data consumer_reference_only_path: String = "dag/test/fixture/reference_derived_graph/consumer_reference_only.dag"

data consumer_import_only_path: String = "dag/test/fixture/reference_derived_graph/consumer_import_only.dag"

type ReferenceImportEdgeDiff
= SharedEdge { path: String, target_module: String }
| ReferenceOnlyEdge { path: String, target_module: String }
| ImportOnlyEdge { path: String, target_module: String }

type ReferenceDerivedGraphReport {
source_roots: List<String>
reference_edges: List<ModuleDependencyEdge>
import_edges: List<ModuleDependencyEdge>
diffs: List<ReferenceImportEdgeDiff>
}

fn has_identity(edges: List<ModuleDependencyEdge>, path: String, target_module: String) -> Bool {
any(xs: edges, predicate: fn(e) { e.path == path && e.target_module == target_module })
}

fn diff_against_import(
reference_edges: List<ModuleDependencyEdge>,
import_edges: List<ModuleDependencyEdge>
) -> List<ReferenceImportEdgeDiff> {
let from_reference = fold_list(
xs: reference_edges,
empty: [],
cons: fn(acc, edge) {
concat(acc, [
if has_identity(edges: import_edges, path: edge.path, target_module: edge.target_module) {
SharedEdge { path: edge.path, target_module: edge.target_module }
} else {
ReferenceOnlyEdge { path: edge.path, target_module: edge.target_module }
}
])
}
)
fold_list(
xs: import_edges,
empty: from_reference,
cons: fn(acc, edge) {
if has_identity(edges: reference_edges, path: edge.path, target_module: edge.target_module) {
acc
} else {
concat(acc, [ImportOnlyEdge { path: edge.path, target_module: edge.target_module }])
}
}
)
}

fn report(source_roots: List<String>) -> Outcome<ReferenceDerivedGraphReport> {
match reference_derived_resolution_facts(
pool_roots: source_roots,
importer_roots: source_roots,
exclude_substrings: instrument_exclude
) {
Rejected { diagnostics: d } => Rejected { diagnostics: d }
Accepted { value: reference_edges, diagnostics: pending } => {
let import_edges = dependency_edges_from_import_facts(
edges: import_resolution_facts_live(
pool_roots: source_roots,
importer_roots: source_roots,
exclude_substrings: instrument_exclude
)
)
Accepted {
value: ReferenceDerivedGraphReport {
source_roots: source_roots,
reference_edges: reference_edges,
import_edges: import_edges,
diffs: diff_against_import(
reference_edges: reference_edges,
import_edges: import_edges
)
},
diagnostics: pending
}
}
}
}

fn fixture_report() -> Outcome<ReferenceDerivedGraphReport> {
report(source_roots: instrument_source_roots)
}

fn diffs_include_reference_only(diffs: List<ReferenceImportEdgeDiff>, path: String, target: String) -> Bool {
any(xs: diffs, predicate: fn(d) {
match d {
ReferenceOnlyEdge { path: p, target_module: t } => p == path && t == target
SharedEdge { path: _, target_module: _ } => false
ImportOnlyEdge { path: _, target_module: _ } => false
}
})
}

fn diffs_include_import_only(diffs: List<ReferenceImportEdgeDiff>, path: String, target: String) -> Bool {
any(xs: diffs, predicate: fn(d) {
match d {
ImportOnlyEdge { path: p, target_module: t } => p == path && t == target
SharedEdge { path: _, target_module: _ } => false
ReferenceOnlyEdge { path: _, target_module: _ } => false
}
})
}

fn diffs_include_shared(diffs: List<ReferenceImportEdgeDiff>, path: String, target: String) -> Bool {
any(xs: diffs, predicate: fn(d) {
match d {
SharedEdge { path: p, target_module: t } => p == path && t == target
ReferenceOnlyEdge { path: _, target_module: _ } => false
ImportOnlyEdge { path: _, target_module: _ } => false
}
})
}

fn main() -> ProcessExit {
match fixture_report() {
Rejected { diagnostics: _ } =>
exit_failure(
reason: "tools.reference_derived_graph.report refused over the fixture source root"
)
Accepted { value: r, diagnostics: _ } =>
if !(diffs_include_reference_only(
diffs: r.diffs,
path: consumer_reference_only_path,
target: provider_module
) || diffs_include_shared(
diffs: r.diffs,
path: consumer_reference_only_path,
target: provider_module
)) {
exit_failure(
reason: "positive control absent: the reference-only fixture produced no reference-derived edge, so every negative check below would pass on an empty edge set"
)
} else if diffs_include_import_only(
diffs: r.diffs,
path: consumer_reference_only_path,
target: provider_module
) {
exit_failure(
reason: "the reference-only fixture was classified as import-only, so the instrument is reading import syntax"
)
} else if !diffs_include_import_only(
diffs: r.diffs,
path: consumer_import_only_path,
target: provider_module
) {
exit_failure(
reason: "an import with no reference produced a reference-derived edge or dropped the import-only difference"
)
} else if diffs_include_reference_only(
diffs: r.diffs,
path: consumer_import_only_path,
target: provider_module
) || diffs_include_shared(
diffs: r.diffs,
path: consumer_import_only_path,
target: provider_module
) {
exit_failure(
reason: "an unused import minted a reference-derived edge"
)
} else {
ExitSuccess
}
}
}
Loading
Loading