Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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: 1 addition & 1 deletion dag/gunbc/auth/approval_broker_serve.dag
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ fn approval_broker_respond_as(
approval_broker_selection_response(
sel: serve_select_route(table: t, method: m, path: path),
process: process,
request: ServeHttpRequest<TailnetIdentity> {
request: ServeHttpRequest {
method: m,
path: path,
body: body,
Expand Down
22 changes: 22 additions & 0 deletions dag/gunbc/auth/approval_broker_transport_request.dag
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module gunbc.auth.approval_broker_transport_request

import extdeps.http.server { ServeHttpRequest, RequestSecurityContext, AccessPathTailnetProxy, AccessPathDirectHttps, AccessPathLocalDev }
import extdeps.tailscale.identity { TailnetIdentity, TailnetIdentityAbsent }

// The legacy broker consumes the transport observation and independently checks its declared
// identity-header trust, capability and writer authority. Google/service authentication is not
// convertible into a tailnet identity. Keep this adapter explicit until A7 replaces that broker
// admission contract; it does not establish trust or change the broker's decision policy.
fn approval_broker_transport_request<Authentication>(request: ServeHttpRequest<Authentication>) -> ServeHttpRequest<TailnetIdentity> {
ServeHttpRequest {
method: request.method, path: request.path, body: request.body,
security: RequestSecurityContext {
access_path: request.security.access_path,
authentication: match request.security.access_path {
AccessPathTailnetProxy { transport_observation, route_readback: _ } => transport_observation
AccessPathDirectHttps => TailnetIdentityAbsent
AccessPathLocalDev => TailnetIdentityAbsent
},
},
}
}
3 changes: 2 additions & 1 deletion dag/gunbc/instruments/roadmap_denominator_probe.dag
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import std.process { ProcessExit, ExitSuccess, exit_failure }
import extdeps.filesystem.filesystem_io { Filesystem }
import gunbc.roadmap_model { RoadmapNode, WorkItemDispatch, Dispatchable, NotDispatchable }
import gunbc.roadmap_status {
RoadmapItem, TicketLine, SupersededLine, AuthoredLine, PlainLine, DerivableLine,
RoadmapItem, LiveTicketLine, TicketLine, SupersededLine, AuthoredLine, PlainLine, DerivableLine,
line_ticket, item_is_done, signoff_is_present, TicketFields,
}
import gunbc.roadmap_authority {
Expand All @@ -31,6 +31,7 @@ import gunbc.roadmap_authority {
fn line_kind(i: RoadmapItem) -> String {
match i {
TicketLine { done: _, ticket: _ } => "ticket"
LiveTicketLine { source: _, ticket: _ } => "ticket"
SupersededLine { by: _, content: _ } => "superseded"
AuthoredLine { done: _, content: _ } => "authored"
DerivableLine { prs: _, title: _, description: _ } => "derivable"
Expand Down
6 changes: 3 additions & 3 deletions dag/gunbc/roadmap/roadmap_authority.dag
Original file line number Diff line number Diff line change
Expand Up @@ -4653,7 +4653,7 @@ fn roadmap_authority_projection(history: RoadmapAcceptanceEventHistoryLoad) -> R
RoadmapAuthorityProjectionRefused { detail: detail }
FrontierSetsProjected { accepted: accepted, withheld: withheld } =>
RoadmapAuthorityProjected {
doc: RoadmapDocument {
doc: RoadmapDocument { memberships: [],
preamble: preamble(),
lead_lanes: [],
sections: [active_section_for_acceptance(
Expand Down Expand Up @@ -4681,7 +4681,7 @@ fn active_section() -> RoadmapSection {
// view.

fn roadmap_authority_for(focus: RoadmapFocus) -> RoadmapDocument {
RoadmapDocument {
RoadmapDocument { memberships: [],
preamble: preamble(),
lead_lanes: [],
sections: [active_section_for(focus: focus)],
Expand Down Expand Up @@ -5348,7 +5348,7 @@ fn guarantee_ladder_edges() -> List<RoadmapEdge> {
// returns an explicit unavailable document rather than a silent empty active graph.

fn roadmap_authority_refusal_document(detail: String) -> RoadmapDocument {
RoadmapDocument {
RoadmapDocument { memberships: [],
preamble: [
HeadingBlock { level: H1, inlines: [TextInline { text: "gunbc — Roadmap (unavailable)" }] },
ParagraphBlock {
Expand Down
9 changes: 5 additions & 4 deletions dag/gunbc/roadmap/roadmap_belt_actuate.dag
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module gunbc.roadmap_belt_actuate

import gunbc.roadmap_live_projection { roadmap_live_authority_projection }
import gunbc.roadmap.roadmap_submission { CaptureUnreadable }
import gunbc.roadmap.roadmap_fanin { IntegrationReceiptUnreadable }

Expand Down Expand Up @@ -3194,7 +3195,7 @@ fn belt_tick_for_instance(
standing: standing,
state: state,
frontier: frontier,
graph: launch_graph_of_projection(proj: roadmap_authority_projection(history: roadmap_acceptance_event_history_load())),
graph: launch_graph_of_projection(proj: roadmap_live_authority_projection()),
merged: authored_merged_prs(),
)
let spawn_outcomes = belt_tick_spawn_decided(decisions: pass.decisions, workdir: spawn_workdir)
Expand Down Expand Up @@ -3394,7 +3395,7 @@ fn belt_run_once_in(
instance: HostDashboardInstance,
spawn_workdir: String,
) -> BeltTickResult {
match roadmap_authority_projection(history: roadmap_acceptance_event_history_load()) {
match roadmap_live_authority_projection() {
RoadmapAuthorityProjectionRefused { detail: detail } =>
{
let commit_outcomes = belt_commit_attempts_for_instance(instance: instance)
Expand Down Expand Up @@ -6041,7 +6042,7 @@ fn belt_find_node_in(nodes: List<RoadmapNode>, node_id: String) -> BeltNodeLooku
}

fn belt_lookup_node(node_id: String) -> BeltNodeLookup {
match roadmap_authority_projection(history: roadmap_acceptance_event_history_load()) {
match roadmap_live_authority_projection() {
RoadmapAuthorityProjectionRefused { detail: detail } =>
AuthorityProjectionRefused { detail: detail }
RoadmapAuthorityProjected { doc: doc, accepted: _, withheld: _ } =>
Expand Down Expand Up @@ -6322,7 +6323,7 @@ fn belt_dispatch_node_staged(
belt_dispatch_node_staged_over(
instance: instance,
standing: standing,
graph: launch_graph_of_projection(proj: roadmap_authority_projection(history: roadmap_acceptance_event_history_load())),
graph: launch_graph_of_projection(proj: roadmap_live_authority_projection()),
merged: authored_merged_prs(),
node_id: node_id,
)
Expand Down
67 changes: 6 additions & 61 deletions dag/gunbc/roadmap/roadmap_dispatch_actuator.dag
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module gunbc.roadmap_dispatch_actuator

import gunbc.roadmap_dispatch_fields { DispatchBriefFields, carrier_paths_label }
import extdeps.tools.env { env_path_resolved_program }
import std.types { String, NonEmptyStr, Int, Bool, List, FilePath, GitRef }
import v2.std.optional { Present }
Expand Down Expand Up @@ -466,18 +467,7 @@ fn dispatch_capability_program(
}
}

type DispatchBriefFields {
node_id: String
displaced_cost: String
current_state: String
first_slice: String
red_control: String
out_of_scope: String
handback: String
paths: String
commands_to_run: String
expected_artifact: String
}


// DispatchBriefFields contains only fields consumed by fill_dispatch_brief. Sizing remains typed on
// RoadmapNode and is projected only where rendered.
Expand Down Expand Up @@ -1523,44 +1513,8 @@ fn dispatch_tmux_session_scope(
}
}

fn carrier_paths_label(carriers: List<Pointer>, repo: String) -> String {
if count(carriers) == 0 {
concat("dag/gunbc/roadmap/roadmap_dispatch_actuator.dag (repo=", concat(repo, ")"))
} else {
join(map(carriers, p => p.path), " · ")
}
}

fn dispatch_slot_fields(node: RoadmapNode, repo: String) -> DispatchBriefFields {
let title = node_title(item: node.line)
match line_ticket(item: node.line) {
Present { value: t } =>
DispatchBriefFields {
node_id: node.node,
displaced_cost: t.displaced_cost,
current_state: t.current_state,
first_slice: t.first_slice,
red_control: t.red_control,
out_of_scope: t.out_of_scope,
handback: t.handback,
paths: carrier_paths_label(carriers: node.carriers, repo: repo),
commands_to_run: "",
expected_artifact: "",
}
Absent =>
DispatchBriefFields {
node_id: node.node,
displaced_cost: title,
current_state: title,
first_slice: title,
red_control: "drop modeled argv row and witness goes red",
out_of_scope: "see parent roadmap dispatch plan",
handback: "node not ready, foreign lease, or unsupported repo",
paths: carrier_paths_label(carriers: node.carriers, repo: repo),
commands_to_run: "",
expected_artifact: "",
}
}
gunbc.roadmap_dispatch_fields.dispatch_slot_fields(node: node, repo: repo)
}

fn dispatch_brief_fields_for_environment(
Expand All @@ -1575,6 +1529,7 @@ fn dispatch_brief_fields_for_environment(
Dispatchable { repo, acceptance: _ } => {
let f = dispatch_slot_fields(node: node, repo: repo)
DispatchBriefFields {
brief: f.brief,
node_id: f.node_id,
displaced_cost: f.displaced_cost,
current_state: f.current_state,
Expand All @@ -1590,6 +1545,7 @@ fn dispatch_brief_fields_for_environment(
NotDispatchable => {
let f = dispatch_slot_fields(node: node, repo: "")
DispatchBriefFields {
brief: f.brief,
node_id: f.node_id,
displaced_cost: f.displaced_cost,
current_state: f.current_state,
Expand All @@ -1613,18 +1569,7 @@ fn dispatch_brief_fields(node: RoadmapNode) -> DispatchBriefFields {
}

fn fill_dispatch_brief(template: String, fields: DispatchBriefFields) -> String {
template
.replace(from: "<node_id>", to: fields.node_id)
.replace(from: "<displaced cost / what it unblocks>", to: fields.displaced_cost)
.replace(from: "<explicitly out of scope>", to: fields.out_of_scope)
.replace(from: "<prove current state / reproduce the gap>", to: fields.current_state)
.replace(from: "<first implementation slice>", to: fields.first_slice)
.replace(from: "<perturbation that goes red>", to: fields.red_control)
.replace(from: "<execution on the real path>", to: fields.commands_to_run)
.replace(from: "<named hand-back conditions>", to: fields.handback)
.replace(from: "<paths>", to: fields.paths)
.replace(from: "<repro/verify commands>", to: fields.commands_to_run)
.replace(from: "<what comes back even if the fix does not land>", to: fields.expected_artifact)
gunbc.roadmap_dispatch_fields.fill_dispatch_brief(template: template, fields: fields)
}

fn filled_dispatch_brief_for_node(node: RoadmapNode) -> String {
Expand Down
77 changes: 77 additions & 0 deletions dag/gunbc/roadmap/roadmap_dispatch_fields.dag
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
module gunbc.roadmap_dispatch_fields

import std.types { String, List }
import gunbc.roadmap_model { RoadmapNode, RoadmapNodeId, Pointer }
import gunbc.roadmap_status { node_title, line_ticket }

type DispatchBriefFields {
brief: String
node_id: String
displaced_cost: String
current_state: String
first_slice: String
red_control: String
out_of_scope: String
handback: String
paths: String
commands_to_run: String
expected_artifact: String
}

fn carrier_paths_label(carriers: List<Pointer>, repo: String) -> String {
if count(carriers) == 0 {
concat("dag/gunbc/roadmap/roadmap_dispatch_actuator.dag (repo=", concat(repo, ")"))
} else {
join(map(carriers, p => p.path), " · ")
}
}

fn dispatch_slot_fields(node: RoadmapNode, repo: String) -> DispatchBriefFields {
let title = node_title(item: node.line)
match line_ticket(item: node.line) {
Present { value: t } =>
DispatchBriefFields {
brief: t.brief,
node_id: node.node,
displaced_cost: t.displaced_cost,
current_state: t.current_state,
first_slice: t.first_slice,
red_control: t.red_control,
out_of_scope: t.out_of_scope,
handback: t.handback,
paths: carrier_paths_label(carriers: node.carriers, repo: repo),
commands_to_run: "",
expected_artifact: "",
}
Absent =>
DispatchBriefFields {
brief: title,
node_id: node.node,
displaced_cost: title,
current_state: title,
first_slice: title,
red_control: "drop modeled argv row and witness goes red",
out_of_scope: "see parent roadmap dispatch plan",
handback: "node not ready, foreign lease, or unsupported repo",
paths: carrier_paths_label(carriers: node.carriers, repo: repo),
commands_to_run: "",
expected_artifact: "",
}
}
}


fn fill_dispatch_brief(template: String, fields: DispatchBriefFields) -> String {
join(["Issue brief\n", fields.brief, "\n\n", template
.replace(from: "<node_id>", to: fields.node_id)
.replace(from: "<displaced cost / what it unblocks>", to: fields.displaced_cost)
.replace(from: "<explicitly out of scope>", to: fields.out_of_scope)
.replace(from: "<prove current state / reproduce the gap>", to: fields.current_state)
.replace(from: "<first implementation slice>", to: fields.first_slice)
.replace(from: "<perturbation that goes red>", to: fields.red_control)
.replace(from: "<execution on the real path>", to: fields.commands_to_run)
.replace(from: "<named hand-back conditions>", to: fields.handback)
.replace(from: "<paths>", to: fields.paths)
.replace(from: "<repro/verify commands>", to: fields.commands_to_run)
.replace(from: "<what comes back even if the fix does not land>", to: fields.expected_artifact)], "")
}
35 changes: 34 additions & 1 deletion dag/gunbc/roadmap/roadmap_document.dag
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module gunbc.roadmap_document

import std.markdown { MarkdownDocument, MarkdownBlock }
import gunbc.roadmap_model { RoadmapNode, RoadmapEdge, SectionElement }
import gunbc.roadmap_model { RoadmapNode, RoadmapEdge, RoadmapMembership, SectionElement, Prose, Group }
import gunbc.roadmap_emit { project_roadmap_section }

type RoadmapSection {
Expand All @@ -10,6 +10,7 @@ type RoadmapSection {
}

type RoadmapDocument {
memberships: List<RoadmapMembership>
preamble: List<MarkdownBlock>
lead_lanes: List<RoadmapSection>
sections: List<RoadmapSection>
Expand All @@ -33,3 +34,35 @@ fn project_roadmap_to_markdown(doc: RoadmapDocument, merged: List<Int>) -> Markd
})
}
}

fn element_nodes(e: SectionElement) -> List<RoadmapNode> {
match e {
Prose { prose: _ } => []
Group { group } => group.nodes
}
}

fn element_edges(e: SectionElement) -> List<RoadmapEdge> {
match e {
Prose { prose: _ } => []
Group { group } => group.edges
}
}

fn section_nodes(s: RoadmapSection) -> List<RoadmapNode> {
fold(s.elements, init: [], f: (acc, e) => concat(acc, element_nodes(e: e)))
}

fn section_edges(s: RoadmapSection) -> List<RoadmapEdge> {
fold(s.elements, init: [], f: (acc, e) => concat(acc, element_edges(e: e)))
}

fn doc_all_nodes(doc: RoadmapDocument) -> List<RoadmapNode> {
let lane_nodes = fold(doc.lead_lanes, init: [], f: (acc, s) => concat(acc, section_nodes(s: s)))
fold(doc.sections, init: lane_nodes, f: (acc, s) => concat(acc, section_nodes(s: s)))
}

fn doc_all_edges(doc: RoadmapDocument) -> List<RoadmapEdge> {
let lane_edges = fold(doc.lead_lanes, init: [], f: (acc, s) => concat(acc, section_edges(s: s)))
fold(doc.sections, init: lane_edges, f: (acc, s) => concat(acc, section_edges(s: s)))
}
5 changes: 4 additions & 1 deletion dag/gunbc/roadmap/roadmap_emit.dag
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import gunbc.roadmap_model {
SectionElement, Prose, Group, SectionProse, SectionGroup,
}

import gunbc.roadmap_status { RoadmapItem, DerivableLine, AuthoredLine, PlainLine, SupersededLine, TicketFields, item_is_done, item_superseded_by, signoff_accepts, signoff_by }
import gunbc.roadmap_status { LiveTicketLine, RoadmapItem, DerivableLine, AuthoredLine, PlainLine, SupersededLine, TicketFields, item_is_done, item_superseded_by, signoff_accepts, signoff_by }

fn roadmap_max_depth() -> Int { 12 }

Expand Down Expand Up @@ -87,6 +87,8 @@ fn line_inlines(line: RoadmapItem) -> List<MarkdownInline> {
AuthoredLine { done: _, content } => [TextInline { text: content }]
PlainLine { content } => [TextInline { text: content }]
SupersededLine { by, content } => [TextInline { text: concat(concat("~~", content), concat("~~ **superseded →** ", by)) }]
LiveTicketLine { source: _, ticket } =>
[TextInline { text: join(["**", ticket.headline, "** — ", ticket.brief, why_clause(t: ticket)], "") }]
TicketLine { done: _, ticket } =>
[TextInline { text: join(["**", ticket.headline, "** — ", ticket.brief, why_clause(t: ticket)], "") }]
}
Expand All @@ -99,6 +101,7 @@ fn node_is_plain(rn: RoadmapNode) -> Bool {
AuthoredLine { done: _, content: _ } => false
SupersededLine { by: _, content: _ } => false
TicketLine { done: _, ticket: _ } => false
LiveTicketLine { source: _, ticket: _ } => false
}
}

Expand Down
Loading