Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
8b48c67
v2: the reference-site collector resolution_provenance has been missi…
Sep 12, 2026
13f5c67
Deliver XL-4: reference-derived ModuleDependencyEdge producer and ins…
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
9fa970a
Rework XL-4 evidence onto the one collector and a mutant.
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
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
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
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
1635fee
Enroll a bare field-type absence as a fourth class, not a dotted case.
Sep 12, 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
76f8c41
XL-4: withhold the delivery receipt and require a positive control in…
Sep 13, 2026
3057bef
XL-4: refuse an importer absent from the reference pool; compute impo…
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
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
5df20bf
Parse-tree probes measure the collector, not the edge fold
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
9583dd2
Carry the path with the tree out of the assembly fold; delete the pos…
Sep 13, 2026
d6b94c9
Delete the import-syntax switch from the production edge fold; compos…
Sep 13, 2026
b7c2f67
Make the qualified-name shape gate verdict-preserving: a zero-child C…
Sep 13, 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
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
}
}
}
7 changes: 5 additions & 2 deletions dag/gunbc/namespace/namespace_cut_stage.dag
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,11 @@ data required_stage_delivery_evidence_kinds: List<StageDeliveryEvidenceKind> = [
ReferenceGraphInstrumentDelivered,
]

// Empty by construction today: neither instrument exists. A row lands here when the stage that
// owes it delivers it.
// Empty: neither instrument is delivered. XL-4's reference-graph instrument exists, but on the
// production ingest route it emits no reference-derived edge for any fixture, so it has no accepted
// positive control there (review 64925 on gunbc#11202). A receipt discriminated only over hand-built
// roots would inflate the rung (DESIGN 4b(1)). The row lands when tools.reference_derived_graph main
// exits success on the production route, which requires its positive control.
data held_stage_delivery_receipts: List<StageDeliveryReceipt> = []

fn stage_delivery_outstanding(held: List<StageDeliveryReceipt>) -> List<String> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ data shared_precondition_re_derived_once_per_claim_frame: RecurringFailureMode =

"SECOND SPECIMEN, gunbc#11032, arriving by the same recognition rule a day later and diagnosed by a lane that had not read this row. A newly landed family -- the where-refinement parse witnesses from gunbc#10946 -- refused the 500ms line on main with interrupted_before_verdict and nothing failing. Partitioned, the shared precondition dominated: v2.compiler.parse parse_grammar_digest and the production index were re-derived on EVERY PARSE CALL although prepare_grammar had fixed both before the first token, and the shared fixture sources were re-parsed per claim. The producer that named it is the floor's cross-claim demand census (main run 34556223550, required_floor_cross_claim_demand.tsv, row parse_grammar_digest). The repair was the one this row prescribes: carry both facts on the prepared grammar, the seam where the grammar is already resolved, and share the fixture trees warm (v2.workflow.floor_pure_producer_share floor_cross_claim_pure_producers_warm). Its frame is narrower than a claim -- per parse call -- which widens this row's reach rather than founding a neighbour: the question that finds it is still the one above. It also shows the census already locating the class and nothing refusing on it, which is this row's next-rung trigger unmet.",

"XL-4 SPECIMEN, gunbc#11202. Two claim files -- v2.test.claim.reference_derived_graph_call_arg_tree and v2.test.claim.reference_derived_graph_production_ingest -- re-derived the same parse-and-normalize ingest once per claim frame. Floor run 34730467598: verdict=FloorRefused, interrupted_before_verdict=23, ENROLMENT-MARGIN-REFUSED at the 500ms ceiling. Hoisting into module-scope data rows does not help (the claim frame is narrower than the file). The repair is one warm producer, v2.test.claim.reference_derived_graph_fixture.xl4_fixture_trees, consumed by both files. The seam is the ingest, not the collector: the claims name the collector and the edge fold.",

"WHAT THE DIAGNOSTIC OFFERED AND WHY BOTH ARMS WERE WRONG, recorded because two readers took them in turn and neither questioned the frame. The refusal named exactly two remedies -- reduce the cost, or move the row to a lane declaring its own ceiling -- and a cost ladder showed the first unreachable, since the cheapest possible precondition was already 1.45x the line. That made the second arm look forced, and it is worse than it looks: the only off-floor home in the tree is a namespace the floor's own authority describes as NOT COVERED by anything, so routing there would have executed the rows nowhere and greened the gate over four unobserved claims. A diagnostic that enumerates its remedies teaches its reader that the enumeration is exhaustive; here the repair was in neither arm, and the reason is that both arms are about what the cost is ALLOWED to be while the defect was how many times it was paid.",

"RUNG FOUND AT: mitigatable. The gate refuses, typed and located, and contains the harm -- it did not ship a wrong verdict. What it does not do is name the duplication, so the refusal is discovered per family and diagnosed by hand, and on this specimen two readers in sequence reasoned about cost allowance before anyone asked about cost multiplicity.",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module test.fixture.reference_derived_graph.consumer_body_value

import std.types { Int }

fn uses() -> Int {
test.fixture.reference_derived_graph.provider.provided_value
}
8 changes: 8 additions & 0 deletions dag/test/fixture/reference_derived_graph/consumer_both.dag
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module test.fixture.reference_derived_graph.consumer_both

import std.types { Int }
import test.fixture.reference_derived_graph.provider { provided_value }

fn uses_imported_provider() -> Int {
test.fixture.reference_derived_graph.provider.provided_value
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module test.fixture.reference_derived_graph.consumer_call_only

import std.types { Int }

fn sink(x: Int) -> Int { x }

fn uses_only_in_call() -> Int {
sink(x: test.fixture.reference_derived_graph.provider.provided_value)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module test.fixture.reference_derived_graph.consumer_callee_only

import std.types { Int }

fn uses_only_as_callee() -> Int {
test.fixture.reference_derived_graph.provider.provided_fn()
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module test.fixture.reference_derived_graph.consumer_field_bare_local

import std.types { Int }

type LocalFieldOnly

type LocalParamMarker

type LocalWrapper {
f: LocalFieldOnly
}

fn uses(x: LocalParamMarker) -> Int {
1
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module test.fixture.reference_derived_graph.consumer_import_only

import test.fixture.reference_derived_graph.provider { ProvidedMarker }
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module test.fixture.reference_derived_graph.consumer_reference_only

import std.types { Int }

fn uses_provider() -> Int {
test.fixture.reference_derived_graph.provider.provided_value
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module test.fixture.reference_derived_graph.consumer_type_bare_local

import std.types { Int }

type LocalMarker

fn uses(x: LocalMarker) -> Int {
1
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module test.fixture.reference_derived_graph.consumer_type_imported

import std.types { Int }
import test.fixture.reference_derived_graph.provider { ProvidedMarker }

fn uses(x: ProvidedMarker) -> Int {
1
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module test.fixture.reference_derived_graph.consumer_type_only

import std.types { Int }

fn uses(
x: test.fixture.reference_derived_graph.provider.ProvidedMarker
) -> Int {
1
}
9 changes: 9 additions & 0 deletions dag/test/fixture/reference_derived_graph/provider.dag
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module test.fixture.reference_derived_graph.provider

import std.types { Int }

type ProvidedMarker

data provided_value: Int = 1

fn provided_fn() -> Int { 1 }
Loading
Loading