diff --git a/dashboard/site/dashboard-fragments/immediate-profile.json b/dashboard/site/dashboard-fragments/immediate-profile.json index 886f0a343..4bce4688b 100644 --- a/dashboard/site/dashboard-fragments/immediate-profile.json +++ b/dashboard/site/dashboard-fragments/immediate-profile.json @@ -1,6 +1,6 @@ { "description": "Inspect bounded recent gh-aw logs and available rich evidence without a control-plane installation. Missing evidence remains unknown; native maintenance requires trusted terminal approval.", - "audited-dashboard-sha256": "5dd8b4ff57b737ecd5df75a069b50af7485839f782e49d2f0922ed8f31f161c8", + "audited-dashboard-sha256": "47dea1242ac5cdf490e1a61c8bad1da9849501e98581fcddbfad273553eb5eb7", "include-experimental-pages": true, "excluded-pages": [ "wizard", "governance", "configuration", "indexing", diff --git a/dashboard/site/dashboard-fragments/overview.json b/dashboard/site/dashboard-fragments/overview.json index 2d35b453e..07d94bbf9 100644 --- a/dashboard/site/dashboard-fragments/overview.json +++ b/dashboard/site/dashboard-fragments/overview.json @@ -194,8 +194,8 @@ }, { "name": "overview-value-station", - "subject": "Present the observed grader-result count as the legacy Value gains counter.", - "objective": "Restore the Value gains counter while making its observation-count semantics explicit.", + "subject": "Present the observed grader-result count separately from repository Value.", + "objective": "Label grader observations honestly without implying verified outcome gains.", "acceptance": "The count matches overview-value-summary, including zero; grader presence is not proof of improvement and unavailable evidence is not zero.", "from": "overview-value-summary", "compute": [ @@ -275,7 +275,7 @@ }, { "name": "overview-factory-status", - "subject": "Classify the factory heading from compact run and optional value evidence.", + "subject": "Classify the factory heading from compact run and optional grader observations.", "objective": "Provide a bounded Overview heading based on observed run counts and optional grader-record presence.", "acceptance": "The heading matches the declared run-count and optional grader-presence branches; grader presence is not verified value, and the heading does not authorize any policy change.", "from": "overview-run-status-input", @@ -426,7 +426,7 @@ "field": "has-value-gains" }, { - "value": "Your factory is delivering value." + "value": "Your factory has grader observations." }, { "field": "active-heading" diff --git a/dashboard/site/src/agent/catalog.generated.json b/dashboard/site/src/agent/catalog.generated.json index 5ee9ac982..d71ce4a7d 100644 --- a/dashboard/site/src/agent/catalog.generated.json +++ b/dashboard/site/src/agent/catalog.generated.json @@ -12829,8 +12829,8 @@ }, { "id": "overview-value-station", - "subject": "Present the observed grader-result count as the legacy Value gains counter.", - "objective": "Restore the Value gains counter while making its observation-count semantics explicit.", + "subject": "Present the observed grader-result count separately from repository Value.", + "objective": "Label grader observations honestly without implying verified outcome gains.", "acceptance": "The count matches overview-value-summary, including zero; grader presence is not proof of improvement and unavailable evidence is not zero.", "description": "", "parameters": [], @@ -12888,7 +12888,7 @@ }, { "id": "overview-factory-status", - "subject": "Classify the factory heading from compact run and optional value evidence.", + "subject": "Classify the factory heading from compact run and optional grader observations.", "objective": "Provide a bounded Overview heading based on observed run counts and optional grader-record presence.", "acceptance": "The heading matches the declared run-count and optional grader-presence branches; grader presence is not verified value, and the heading does not authorize any policy change.", "description": "", diff --git a/dashboard/site/src/agent/queries.generated.json b/dashboard/site/src/agent/queries.generated.json index f80927ce3..0736114f0 100644 --- a/dashboard/site/src/agent/queries.generated.json +++ b/dashboard/site/src/agent/queries.generated.json @@ -1 +1 @@ -[{"name":"command-queue","subject":"Show the durable local CLI command queue.","objective":"Inspect command lifecycle and reconnect to output without rerunning work.","acceptance":"Preserve persistent command IDs and all six server states; closing output never cancels execution. Unavailable local authority is not an empty queue.","from":"cli-commands","compute":[{"as":"command-action","function":"coalesce","args":[{"field":"actionId"},{"value":""}]},{"as":"command-title","function":"coalesce","args":[{"field":"command"},{"field":"actionId"}]},{"as":"command-target","function":"coalesce","args":[{"field":"repository"},{"field":"campaign"},{"field":"package-source"},{"value":"Local control repository"}]},{"as":"command-created-at","function":"coalesce","args":[{"field":"createdAt"},{"value":null}]},{"as":"command-href","function":"concat","args":[{"value":"#page-command?command="},{"field":"id"}]},{"as":"command-dashboard-link","function":"dashboard-link","args":[{"value":""},{"field":"command-href"},{"field":"command-title"},{"field":"id"}]}]},{"name":"event-base","subject":"Project shared event fields before combining run-owned records.","objective":"Provide the narrow retained event evidence needed for inspection and run import-coverage analysis.","acceptance":"The result unions retained audit, domain, tool, and issue records with their available run identity; an empty or unavailable preview cannot establish zero source activity or complete import coverage.","from":"audits","union":["domains","tools","issues"],"select":[{"field":"organization"},{"field":"repository"},{"field":"workflow"},{"field":"run"},{"field":"run-attempt"},{"field":"event"},{"field":"event-source"},{"field":"event-type"},{"field":"event-summary"},{"field":"event-status"},{"field":"github-entity-type"},{"field":"safe-output-type"},{"field":"safe-output-url"},{"field":"correlation-id"},{"field":"implementation-pull-request-url"},{"field":"event-timestamp"},{"field":"run-link"}]},{"name":"audit-event-runs","subject":"Count imported audit records per run before combining event sources.","objective":"Bound audit evidence for run import-coverage analysis.","acceptance":"Count only retained audit records with event identity by run attempt; missing evidence does not establish zero activity.","from":"audits","aggregate":{"by":["organization","repository","workflow","run","run-attempt"],"values":[{"field":"event","as":"events","reducer":"count"}]}},{"name":"domain-event-runs","subject":"Count imported domain records per run before combining event sources.","objective":"Bound domain evidence for run import-coverage analysis.","acceptance":"Count only retained domain records with event identity by run attempt; missing evidence does not establish zero activity.","from":"domains","aggregate":{"by":["organization","repository","workflow","run","run-attempt"],"values":[{"field":"event","as":"events","reducer":"count"}]}},{"name":"tool-event-runs","subject":"Count imported tool records per run before combining event sources.","objective":"Bound tool evidence for run import-coverage analysis.","acceptance":"Count only retained tool records with event identity by run attempt; missing evidence does not establish zero activity.","from":"tools","aggregate":{"by":["organization","repository","workflow","run","run-attempt"],"values":[{"field":"event","as":"events","reducer":"count"}]}},{"name":"issue-event-runs","subject":"Count imported issue records per run before combining event sources.","objective":"Bound issue evidence for run import-coverage analysis.","acceptance":"Count only retained issue records with event identity by run attempt; missing evidence does not establish zero activity.","from":"issues","aggregate":{"by":["organization","repository","workflow","run","run-attempt"],"values":[{"field":"event","as":"events","reducer":"count"}]}},{"name":"event-runs","subject":"Identify each workflow run that has one or more imported run-owned records.","objective":"Identify run attempts with retained imported records so their presence can be compared with observed runs.","acceptance":"One row per organization, repository, workflow, run, and attempt contains events, the count of matching retained records; no row in an available result does not prove that no event was produced.","description":"Distinct workflow runs represented by imported domain, tool, audit, or issue records.","from":"audit-event-runs","union":["domain-event-runs","tool-event-runs","issue-event-runs"],"aggregate":{"by":["organization","repository","workflow","run","run-attempt"],"values":[{"field":"events","as":"events","reducer":"sum"}]}},{"name":"run-import-status","subject":"Identify observed runs that have one or more imported run-owned records.","objective":"Compare observed run attempts with retained run-owned event evidence to locate import-coverage gaps for investigation.","acceptance":"Keep each observed run and its run-attempt identity; imported-event-count is zero and imported is false without a matching retained event, but missing events alone do not establish an ingestion failure.","description":"Observed runs enriched with imported-record status.","from":"runs","joins":[{"source":"event-runs","type":"left","on":[{"left":"organization","right":"organization"},{"left":"repository","right":"repository"},{"left":"workflow","right":"workflow"},{"left":"run","right":"run"},{"left":"run-attempt","right":"run-attempt"}],"fields":[{"field":"events","as":"imported-events"}]}],"compute":[{"as":"imported-event-count","function":"coalesce","args":[{"field":"imported-events"},{"value":0}]},{"as":"imported","function":"greater-than","args":[{"field":"imported-event-count"},{"value":0}]}]},{"name":"workflow-run-totals","subject":"Summarize observed run counts and imported runs by declared workflow.","objective":"Compare observed run attempts, conclusions, and imported-record coverage for each workflow.","acceptance":"Group by organization, repository, and workflow; report distinct run-attempt totals, successful and failed conclusion counts, and imported-run totals only from retained evidence. Missing run records cannot establish zero execution.","description":"Observed run and imported-run totals for each declared workflow.","from":"run-import-status","compute":[{"as":"run-attempt-identity","function":"concat","args":[{"field":"run"},{"value":":"},{"field":"run-attempt"}]}],"aggregate":{"by":["organization","repository","workflow"],"values":[{"field":"run-attempt-identity","as":"runs","reducer":"distinct-count"},{"field":"run-conclusion","as":"successful-runs","reducer":"count","filter":{"predicates":[{"field":"run-conclusion","equals":"success"}]}},{"field":"run-conclusion","as":"failed-runs","reducer":"count","filter":{"predicates":[{"field":"run-conclusion","in":["failure","startup-failure","stale","timed-out"]}]}},{"field":"imported","as":"imported-runs","reducer":"sum"}]}},{"name":"workflow-aic-run-totals","subject":"Summarize observed run attempts and AI Credits for workflow cost comparison.","objective":"Count retained run attempts and recorded AI Credits without loading imported-event coverage.","acceptance":"Count all distinct retained run attempts, but include only positive recorded AIC in cost totals and cost denominators; zero and missing telemetry cannot skew cost averages.","from":"runs","compute":[{"as":"run-attempt-identity","function":"concat","args":[{"field":"run"},{"value":":"},{"field":"run-attempt"}]},{"as":"positive-aic","function":"greater-than","args":[{"field":"aic-total"},{"value":0}]}],"aggregate":{"by":["organization","repository","workflow"],"values":[{"field":"run-attempt-identity","as":"runs","reducer":"distinct-count"},{"field":"run-attempt-identity","as":"aic-runs","reducer":"distinct-count","filter":{"predicates":[{"field":"positive-aic","equals":true}]}},{"field":"aic-total","as":"aic","reducer":"sum","filter":{"predicates":[{"field":"positive-aic","equals":true}]}}]}},{"name":"workflow-aic-totals","subject":"Summarize observed AI Credit usage by declared workflow.","objective":"Expose retained AI Credit consumption per workflow for bounded cost review alongside observed execution.","acceptance":"Sum only positive recorded aic-total by organization, repository, and workflow; exclude zero and missing costs rather than treating them as free execution.","description":"Observed AI Credit totals for each declared workflow.","from":"workflow-aic-run-totals","filter":{"predicates":[{"field":"aic-runs","gte":1}]},"select":[{"field":"organization"},{"field":"repository"},{"field":"workflow"},{"field":"aic"},{"field":"aic-runs"}]},{"name":"mcp-tool-workflow-totals","subject":"Summarize observed MCP calls by tool and workflow before the tool inventory is materialized.","objective":"Keep MCP inventory intermediates bounded without dropping calls or changing byte totals.","acceptance":"Count retained observation identities and sum request and response bytes per server, tool, and workflow; retain safe-output-server classification for downstream exclusion.","from":"mcp-calls","compute":[{"as":"safe-output-server","function":"equals-any","args":[{"field":"mcp-server"},{"value":"safe_outputs"},{"value":"safeoutputs"}]},{"as":"mcp-tool-label","function":"concat","args":[{"field":"mcp-server"},{"value":"/"},{"field":"mcp-tool"}]},{"as":"workflow-key","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"},{"value":":"},{"field":"workflow"}]}],"aggregate":{"by":["safe-output-server","mcp-tool-label","mcp-server","mcp-tool","workflow-key"],"values":[{"field":"mcp-observation","as":"calls","reducer":"count"},{"field":"request-bytes","as":"request-bytes","reducer":"sum"},{"field":"response-bytes","as":"response-bytes","reducer":"sum"}]}},{"name":"mcp-tool-calls","subject":"Prepare MCP tool calls for aggregation with safe-output-server calls identified for downstream exclusion.","objective":"Identify retained MCP call labels and safe-output-server classification for downstream tool-use investigation.","acceptance":"Preserve each retained call with its workflow key and tool label and mark safe-output-server calls explicitly; downstream exclusion must not be mistaken for absence of those calls or complete tool telemetry.","description":"Observed MCP tool calls labeled with whether they belong to the internal safe outputs server.","from":"mcp-calls","compute":[{"as":"safe-output-server","function":"equals-any","args":[{"field":"mcp-server"},{"value":"safe_outputs"},{"value":"safeoutputs"}]},{"as":"mcp-tool-label","function":"concat","args":[{"field":"mcp-server"},{"value":"/"},{"field":"mcp-tool"}]},{"as":"workflow-key","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"},{"value":":"},{"field":"workflow"}]}]},{"name":"issue-safe-outputs","subject":"List retained GitHub issue safe outputs.","objective":"Inspect retained issue safe outputs and their observed closure state before deciding which items need follow-up.","acceptance":"Include only safe_output.result issue records, not pull requests; preserve issue and run links, timestamps, state, and status detail. Unknown or unobserved closure state must not be presented as closed.","description":"Issue-only projection of retained safe-output items.","from":"issues","filter":{"predicates":[{"field":"event-type","equals":"safe_output.result"},{"field":"is-pull-request","equals":false}]},"joins":[{"source":"runs","type":"left","on":[{"left":"organization","right":"organization"},{"left":"repository","right":"repository"},{"left":"workflow","right":"workflow"},{"left":"run","right":"run"},{"left":"run-attempt","right":"run-attempt"}],"fields":[{"field":"run-link","as":"linked-run"}]}],"compute":[{"as":"_issue-state-open","function":"equals-any","args":[{"field":"issue-state"},{"value":"OPEN"}]},{"as":"_issue-state-closed","function":"equals-any","args":[{"field":"issue-state"},{"value":"CLOSED"}]},{"as":"_issue-open-status","function":"if","args":[{"field":"_issue-state-open"},{"value":"Open"},{"value":"Unknown"}]},{"as":"issue-status","function":"if","args":[{"field":"_issue-state-closed"},{"value":"Closed"},{"field":"_issue-open-status"}]},{"as":"_issue-closing-reason","function":"coalesce","args":[{"field":"issue-state-reason"},{"value":"unknown"}]},{"as":"_issue-closing-reason-normalized","function":"lower","args":[{"field":"_issue-closing-reason"}]},{"as":"issue-closing-status","function":"title-case","args":[{"field":"_issue-closing-reason-normalized"}]},{"as":"_issue-closed-status-detail","function":"concat","args":[{"value":"Closed: "},{"field":"issue-closing-status"}]},{"as":"issue-status-detail","function":"if","args":[{"field":"_issue-state-closed"},{"field":"_issue-closed-status-detail"},{"field":"issue-status"}]}],"select":[{"field":"event-timestamp","as":"observed-at"},{"field":"github-entity-type"},{"field":"is-pull-request"},{"field":"safe-output-type"},{"field":"issue-state"},{"field":"issue-closed"},{"field":"issue-state-reason"},{"field":"issue-status"},{"field":"issue-closing-status"},{"field":"issue-status-detail"},{"field":"issue-closed-at"},{"field":"issue-status-observed-at"},{"field":"event-summary"},{"field":"correlation-id","as":"entity-url"},{"field":"organization"},{"field":"repository"},{"field":"workflow"},{"field":"run"},{"field":"linked-run","as":"run-link"}],"order-by":[{"field":"observed-at","direction":"desc"},{"field":"entity-url","direction":"asc"}]},{"name":"issue-safe-output-label-options","subject":"List observed safe-output badges for the issue list Labels filter.","objective":"Choose retained safe-output types without scanning or filtering presented cards.","acceptance":"Return distinct observed badge values in ascending order; missing evidence is not an empty label inventory.","from":"issue-safe-outputs","aggregate":{"by":["safe-output-type"],"values":[{"field":"entity-url","as":"items","reducer":"count"}]},"order-by":[{"field":"safe-output-type","direction":"asc"}]},{"name":"issue-status-label-options","subject":"List observed status badges for the issue list Status filter.","objective":"Choose retained issue states and closing reasons without inferring resolution.","acceptance":"Return distinct observed status details in ascending order; Unknown remains distinct from Open and Closed.","from":"issue-safe-outputs","aggregate":{"by":["issue-status-detail"],"values":[{"field":"entity-url","as":"items","reducer":"count"}]},"order-by":[{"field":"issue-status-detail","direction":"asc"}]},{"name":"issue-repository-totals","subject":"Rank the ten repositories with the most retained GitHub issue safe outputs.","objective":"Locate repositories with the largest observed issue-safe-output volume for a bounded review of linked records.","acceptance":"Return at most ten repository coordinates ordered by retained issue-record count; ties or missing issue evidence must not imply a complete fleet ranking or unique issue count.","description":"Top repositories by retained issue safe-output count.","from":"issue-safe-outputs","compute":[{"as":"repository-coordinate","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"}]}],"aggregate":{"by":["repository-coordinate"],"values":[{"field":"entity-url","as":"issues","reducer":"count"}]},"order-by":[{"field":"issues","direction":"desc"},{"field":"repository-coordinate","direction":"asc"}],"limit":10},{"name":"campaign-import-audit-count","subject":"Count retained audit identities for campaign inventory source quality.","objective":"Retain audit provenance without reconstructing run coverage.","acceptance":"Count canonical audit IDs; missing evidence stays unavailable and the count is not displayed as import coverage.","from":"audits","aggregate":{"values":[{"field":"id","as":"records","reducer":"count"}]}},{"name":"campaign-import-domain-count","subject":"Count retained domain identities for campaign inventory source quality.","objective":"Retain domain provenance without reconstructing run coverage.","acceptance":"Count canonical domain IDs; missing evidence stays unavailable and the count is not displayed as import coverage.","from":"domains","aggregate":{"values":[{"field":"id","as":"records","reducer":"count"}]}},{"name":"campaign-import-tool-count","subject":"Count retained tool identities for campaign inventory source quality.","objective":"Retain tool provenance without reconstructing run coverage.","acceptance":"Count canonical tool IDs; missing evidence stays unavailable and the count is not displayed as import coverage.","from":"tools","aggregate":{"values":[{"field":"id","as":"records","reducer":"count"}]}},{"name":"campaign-import-issue-count","subject":"Count retained issue identities for campaign inventory source quality.","objective":"Retain issue provenance without reconstructing run coverage.","acceptance":"Count canonical issue IDs; missing evidence stays unavailable and the count is not displayed as import coverage.","from":"issues","aggregate":{"values":[{"field":"id","as":"records","reducer":"count"}]}},{"name":"campaign-workflow-import-evidence","subject":"Compose retained import-source quality for campaign workflow execution totals.","objective":"Preserve all four import dependencies without counting unused per-run or per-workflow coverage.","acceptance":"Compose audit, domain, tool, and issue availability, freshness, and completeness exactly as event-runs. The retained-record count carries source quality only; it is not displayed or used as horizon-specific import coverage, executions, or outcomes. Run and AI Credit totals retain their selected horizon.","from":"campaign-import-audit-count","union":["campaign-import-domain-count","campaign-import-tool-count","campaign-import-issue-count"],"time":{"range":"all"},"compute":[{"as":"import-scope","function":"literal","args":[{"value":"retained"}]}],"aggregate":{"by":["import-scope"],"values":[{"field":"records","as":"events","reducer":"sum"}]}},{"name":"campaign-workflow-execution-base","subject":"Summarize retained run attempts and AI Credits before campaign workflow enrichment.","objective":"Read run identity and recorded AI Credits together instead of enriching every run with import status.","acceptance":"Count distinct run-attempt identities and sum aic-total per organization, repository, and workflow; missing retained evidence is not proof of no execution or cost.","from":"runs","compute":[{"as":"import-scope","function":"literal","args":[{"value":"retained"}]},{"as":"run-attempt-identity","function":"concat","args":[{"field":"run"},{"value":":"},{"field":"run-attempt"}]},{"as":"positive-aic","function":"greater-than","args":[{"field":"aic-total"},{"value":0}]}],"aggregate":{"by":["organization","repository","workflow","import-scope"],"values":[{"field":"run-attempt-identity","as":"runs","reducer":"distinct-count"},{"field":"aic-total","as":"aic","reducer":"sum","filter":{"predicates":[{"field":"positive-aic","equals":true}]}}]}},{"name":"campaign-workflow-execution-totals","subject":"Attach retained import-evidence quality to compact workflow execution totals.","objective":"Preserve the public inventory's run and import availability composition after aggregating run evidence.","acceptance":"Keep runs and AI Credits unchanged; unavailable run evidence fails closed and optional import evidence degrades quality exactly as in run-import-status.","description":"Only source quality is consumed from import evidence. Join its compact retained-source summary after run aggregation; do not build unused run-level import coverage or change horizon-specific execution totals.","from":"campaign-workflow-execution-base","joins":[{"source":"campaign-workflow-import-evidence","type":"left","on":[{"left":"import-scope","right":"import-scope"}],"fields":[{"field":"events","as":"imported-events"}]}],"select":[{"field":"organization"},{"field":"repository"},{"field":"workflow"},{"field":"runs"},{"field":"aic"}]},{"name":"campaign-workflow-declarations","subject":"Project reusable campaign workflow declarations without execution evidence.","objective":"Share declaration display fields between structural topology and execution inventory without joining runs or import evidence.","acceptance":"Preserve raw organization, repository, workflow and declaration fields for joins. Select orchestrator and worker roles once, retaining inactive and unknown declarations; only list consumers select active entries. Display defaults and repository links do not establish execution, enrollment or authority.","from":"workflows","filter":{"predicates":[{"field":"workflow-role","in":["orchestrator","worker"]}]},"compute":[{"as":"repository-slug","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"}]},{"as":"declared-mode","function":"coalesce","args":[{"field":"rollout-mode"},{"value":"unknown"}]},{"as":"declared-registration","function":"coalesce","args":[{"field":"workflow-active"},{"value":"unknown"}]},{"as":"campaign-title","function":"title-case","args":[{"field":"campaign"}]},{"as":"campaign-display-name","function":"coalesce","args":[{"field":"campaign-name"},{"field":"campaign-title"},{"value":"Repository-owned"}]},{"as":"workflow-display-name","function":"coalesce","args":[{"field":"workflow-name"},{"field":"workflow"}]},{"as":"encoded-repository","function":"url-encode","args":[{"field":"repository-slug"}]},{"as":"repository-dashboard-href","function":"concat","args":[{"value":"#page-repository-detail?repository="},{"field":"encoded-repository"}]},{"as":"repository-dashboard-label","function":"concat","args":[{"value":"View "},{"field":"repository-slug"},{"value":" repository dashboard"}]},{"as":"repository-dashboard-link","function":"dashboard-link","args":[{"field":"repository-link"},{"field":"repository-dashboard-href"},{"field":"repository-dashboard-label"},{"field":"repository-slug"}]}],"select":[{"field":"organization"},{"field":"repository"},{"field":"workflow"},{"field":"campaign"},{"field":"campaign-name"},{"field":"workflow-name"},{"field":"workflow-role"},{"field":"rollout-mode"},{"field":"workflow-active"},{"field":"repository-link"},{"field":"workflow-link"},{"field":"repository-slug"},{"field":"declared-mode"},{"field":"declared-registration"},{"field":"campaign-display-name"},{"field":"workflow-display-name"},{"field":"repository-dashboard-link"}]},{"name":"campaign-workflow-inventory","subject":"Project declared campaign workflows with lean execution and configuration evidence.","objective":"Provide campaign totals and lists from shared declarations with separate execution and import-quality evidence.","acceptance":"Keep all declared orchestrators and workers, including inactive and unobserved entries; preserve inventory ordering, configuration defaults, execution totals, and import-evidence quality.","description":"Lean campaign inventory with execution totals that retain the public workflow inventory's evidence-quality dependencies.","from":"campaign-workflow-declarations","joins":[{"source":"campaign-workflow-execution-totals","type":"left","on":[{"left":"organization","right":"organization"},{"left":"repository","right":"repository"},{"left":"workflow","right":"workflow"}],"fields":[{"field":"runs","as":"observed-runs"},{"field":"aic","as":"observed-aic"}]}],"compute":[{"as":"total-runs","function":"coalesce","args":[{"field":"observed-runs"},{"value":0}]},{"as":"total-aic","function":"coalesce","args":[{"field":"observed-aic"},{"value":0}]}],"select":[{"field":"campaign"},{"field":"campaign-name"},{"field":"organization"},{"field":"repository-slug","as":"repository"},{"field":"workflow"},{"field":"workflow-name"},{"field":"workflow-role"},{"field":"declared-mode","as":"rollout-mode"},{"field":"declared-registration","as":"workflow-active"},{"field":"total-runs","as":"runs"},{"field":"total-aic","as":"aic"},{"field":"repository-link"},{"field":"workflow-link"},{"field":"campaign-display-name"},{"field":"workflow-display-name"},{"field":"repository-dashboard-link"}],"order-by":[{"field":"repository","direction":"asc"},{"field":"workflow","direction":"asc"}]},{"name":"workflow-inventory","subject":"List declared workflows with their campaign, repository, configuration, and observed execution totals.","objective":"Compare declared workflow configuration with retained run, import-coverage, and AI Credit evidence to select a workflow for closer inspection.","acceptance":"Keep one row per declared workflow with identity, role, mode, registration, links, observed totals, and ingestion indicator; zero joined totals and missing evidence must not be treated as proof of no execution or complete ingestion.","description":"Central campaign and repository-owned workflow inventory with observed execution totals.","from":"workflows","joins":[{"source":"workflow-run-totals","type":"left","on":[{"left":"organization","right":"organization"},{"left":"repository","right":"repository"},{"left":"workflow","right":"workflow"}],"fields":[{"field":"runs","as":"observed-runs"},{"field":"successful-runs","as":"observed-successful-runs"},{"field":"failed-runs","as":"observed-failed-runs"},{"field":"imported-runs","as":"observed-imported-runs"}]},{"source":"workflow-aic-totals","type":"left","on":[{"left":"organization","right":"organization"},{"left":"repository","right":"repository"},{"left":"workflow","right":"workflow"}],"fields":[{"field":"aic","as":"observed-aic"},{"field":"aic-runs","as":"observed-aic-runs"}]}],"compute":[{"as":"campaign-title","function":"title-case","args":[{"field":"campaign"}]},{"as":"campaign-display-name","function":"coalesce","args":[{"field":"campaign-name"},{"field":"campaign-title"},{"value":"Repository-owned"}]},{"as":"repository-slug","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"}]},{"as":"workflow-display-name","function":"coalesce","args":[{"field":"workflow-name"},{"field":"workflow"}]},{"as":"declared-role","function":"coalesce","args":[{"field":"workflow-role"},{"value":"standalone"}]},{"as":"declared-mode","function":"coalesce","args":[{"field":"rollout-mode"},{"value":"unknown"}]},{"as":"declared-registration","function":"coalesce","args":[{"field":"workflow-active"},{"value":"unknown"}]},{"as":"total-runs","function":"coalesce","args":[{"field":"observed-runs"},{"value":0}]},{"as":"total-successful-runs","function":"coalesce","args":[{"field":"observed-successful-runs"},{"value":0}]},{"as":"has-observed-runs","function":"greater-than","args":[{"field":"total-runs"},{"value":0}]},{"as":"total-failed-runs","function":"coalesce","args":[{"field":"observed-failed-runs"},{"value":0}]},{"as":"total-aic","function":"coalesce","args":[{"field":"observed-aic"},{"value":0}]},{"as":"aic-per-run","function":"quotient","args":[{"field":"total-aic"},{"field":"observed-aic-runs"}]},{"as":"total-imported-runs","function":"coalesce","args":[{"field":"observed-imported-runs"},{"value":0}]},{"as":"ingestion-rate","function":"quotient","args":[{"field":"total-imported-runs"},{"field":"total-runs"}]},{"as":"ingestion","function":"format-percent","args":[{"field":"ingestion-rate"}]},{"as":"encoded-campaign","function":"url-encode","args":[{"field":"campaign"}]},{"as":"campaign-dashboard-href","function":"concat","args":[{"value":"#page-campaign-insights?campaign="},{"field":"encoded-campaign"}]},{"as":"campaign-dashboard-label","function":"concat","args":[{"value":"View "},{"field":"campaign-display-name"},{"value":" campaign dashboard"}]},{"as":"campaign-dashboard-link","function":"dashboard-link","args":[{"field":"repository-link"},{"field":"campaign-dashboard-href"},{"field":"campaign-dashboard-label"},{"field":"campaign"}]},{"as":"encoded-repository","function":"url-encode","args":[{"field":"repository-slug"}]},{"as":"repository-dashboard-href","function":"concat","args":[{"value":"#page-repository-detail?repository="},{"field":"encoded-repository"}]},{"as":"repository-dashboard-label","function":"concat","args":[{"value":"View "},{"field":"repository-slug"},{"value":" repository dashboard"}]},{"as":"repository-dashboard-link","function":"dashboard-link","args":[{"field":"repository-link"},{"field":"repository-dashboard-href"},{"field":"repository-dashboard-label"},{"field":"repository-slug"}]},{"as":"workflow-identity","function":"concat","args":[{"field":"repository-slug"},{"value":":"},{"field":"workflow"}]},{"as":"encoded-workflow","function":"url-encode","args":[{"field":"workflow-identity"}]},{"as":"workflow-dashboard-href","function":"concat","args":[{"value":"#page-workflow-runtime?workflow="},{"field":"encoded-workflow"}]},{"as":"workflow-dashboard-label","function":"concat","args":[{"value":"View "},{"field":"workflow-display-name"},{"value":" workflow dashboard"}]},{"as":"workflow-dashboard-link","function":"dashboard-link","args":[{"field":"workflow-link"},{"field":"workflow-dashboard-href"},{"field":"workflow-dashboard-label"},{"field":"workflow-identity"}]}],"select":[{"field":"campaign"},{"field":"campaign-display-name","as":"campaign-name"},{"field":"organization"},{"field":"repository-slug","as":"repository"},{"field":"workflow"},{"field":"workflow-display-name","as":"workflow-name"},{"field":"workflow-identity","as":"workflow-label"},{"field":"declared-role","as":"workflow-role"},{"field":"declared-mode","as":"rollout-mode"},{"field":"declared-registration","as":"workflow-active"},{"field":"total-aic","as":"aic"},{"field":"total-runs","as":"runs"},{"field":"total-successful-runs","as":"successful-runs"},{"field":"total-failed-runs","as":"failed-runs"},{"field":"aic-per-run"},{"field":"has-observed-runs"},{"field":"ingestion"},{"field":"campaign-dashboard-link","as":"campaign-link"},{"field":"repository-dashboard-link","as":"repository-link"},{"field":"workflow-dashboard-link","as":"workflow-link"}],"order-by":[{"field":"repository","direction":"asc"},{"field":"workflow","direction":"asc"}]},{"name":"repository-run-statistics","subject":"Reduce run counts, conclusions, and positive AI Credits before repository enrichment.","objective":"Share one row-local run aggregate between repository execution and cost summaries.","acceptance":"Keep organization/repository grain, distinct run IDs, existing failure and approval counts, and positive recorded AIC. Reduce before joins; missing evidence is not zero activity or free execution.","from":"runs","compute":[{"as":"positive-aic","function":"greater-than","args":[{"field":"aic-total"},{"value":0}]}],"aggregate":{"by":["organization","repository"],"values":[{"field":"run","as":"runs","reducer":"distinct-count"},{"field":"run-conclusion","as":"failed","reducer":"count","filter":{"predicates":[{"field":"run-conclusion","in":["failure","startup-failure","timed-out"]}]}},{"field":"run-conclusion","as":"action-required","reducer":"count","filter":{"predicates":[{"field":"run-conclusion","equals":"action-required"}]}},{"field":"run","as":"aic-runs","reducer":"count","filter":{"predicates":[{"field":"positive-aic","equals":true}]}},{"field":"aic-total","as":"aic","reducer":"sum","filter":{"predicates":[{"field":"positive-aic","equals":true}]}}]}},{"name":"repository-aic-totals","subject":"Summarize observed AI Credit usage by repository.","objective":"Provide repository-level retained AI Credit totals for comparing observed usage with run activity.","acceptance":"Sum only positive recorded aic-total by organization and repository; exclude zero and missing costs rather than treating them as free execution.","description":"Observed AI Credit totals for each repository.","from":"repository-run-statistics","filter":{"predicates":[{"field":"aic-runs","gte":1}]},"select":[{"field":"organization"},{"field":"repository"},{"field":"aic"}]},{"name":"maintenance-campaign-packages","subject":"Installed campaign packages with retained source coordinates and update evidence.","objective":"Show installed/current source revisions and gate update actions on exact retained provenance.","acceptance":"Return every package. Set campaign-update-action-visible only for update-available rows with a non-empty source; missing provenance stays visible and non-actionable.","from":"campaigns","compute":[{"as":"campaign-source-unavailable","function":"equals-any","args":[{"field":"campaign-source"},{"value":""},{"value":"unknown"},{"value":null}]},{"as":"campaign-action-state","function":"if","args":[{"field":"campaign-source-unavailable"},{"value":"unknown"},{"field":"campaign-update-state"}]},{"as":"campaign-update-action-visible","function":"equals-any","args":[{"field":"campaign-action-state"},{"value":"update-available"}]}],"select":[{"field":"campaign"},{"field":"campaign-name"},{"field":"campaign-description"},{"field":"campaign-icon"},{"field":"campaign-source"},{"field":"campaign-version"},{"field":"campaign-current-version"},{"field":"campaign-update-state"},{"field":"campaign-registration"},{"field":"campaign-update-action-visible"}],"order-by":[{"field":"campaign-name","direction":"asc"}]},{"name":"maintenance-standalone-workflows","subject":"Standalone workflows with retained upstream provenance and update evidence.","objective":"Represent source-managed and local workflows without synthetic campaign membership.","acceptance":"Retain exact coordinates and revisions for source-managed rows; keep local or incomplete rows visible and non-actionable with an explicit reason.","from":"workflows","filter":{"predicates":[{"field":"workflow-role","equals":"standalone"},{"field":"workflow-source-kind","in":["source-managed","local"]}]},"compute":[{"as":"workflow-source-installed-unavailable","function":"equals-any","args":[{"field":"workflow-source-version"},{"value":""},{"value":"unknown"},{"value":null}]},{"as":"workflow-source-latest-unavailable","function":"equals-any","args":[{"field":"workflow-source-current-version"},{"value":""},{"value":"unknown"},{"value":null}]},{"as":"workflow-is-local","function":"equals-any","args":[{"field":"workflow-source-kind"},{"value":"local"}]},{"as":"workflow-source-state","function":"if","args":[{"field":"workflow-is-local"},{"value":"local"},{"field":"workflow-source-update-state"}]},{"as":"workflow-source-update-available","function":"equals-any","args":[{"field":"workflow-source-state"},{"value":"update-available"}]},{"as":"workflow-source-update-unknown","function":"equals-any","args":[{"field":"workflow-source-state"},{"value":"unknown"}]},{"as":"workflow-update-state-known","function":"if","args":[{"field":"workflow-source-update-available"},{"value":"Update available"},{"value":"Current"}]},{"as":"workflow-update-state-with-unknown","function":"if","args":[{"field":"workflow-source-update-unknown"},{"value":"Update status unavailable"},{"field":"workflow-update-state-known"}]},{"as":"workflow-update-state","function":"if","args":[{"field":"workflow-is-local"},{"value":"Local workflow"},{"field":"workflow-update-state-with-unknown"}]},{"as":"workflow-update-reason-installed","function":"if","args":[{"field":"workflow-source-installed-unavailable"},{"value":"Installed source revision unavailable."},{"value":"Installed and upstream source revisions are available."}]},{"as":"workflow-update-reason-latest","function":"if","args":[{"field":"workflow-source-latest-unavailable"},{"value":"Latest upstream source revision unavailable."},{"field":"workflow-update-reason-installed"}]},{"as":"workflow-update-status-reason","function":"if","args":[{"field":"workflow-is-local"},{"value":"No upstream source coordinate was retained; update manually."},{"field":"workflow-update-reason-latest"}]},{"as":"workflow-update-action-visible","function":"equals-any","args":[{"field":"workflow-source-state"},{"value":"update-available"}]}],"select":[{"field":"organization"},{"field":"repository"},{"field":"workflow"},{"field":"workflow-name"},{"field":"workflow-source-kind"},{"field":"workflow-source"},{"field":"workflow-source-version"},{"field":"workflow-source-current-version"},{"field":"workflow-source-update-state"},{"field":"workflow-update-state"},{"field":"workflow-update-status-reason"},{"field":"workflow-update-action-visible"}],"order-by":[{"field":"workflow-update-action-visible","direction":"desc"},{"field":"workflow-name","direction":"asc"}]},{"name":"maintenance-repository-versions","subject":"Group installed and current gh-aw compiler versions and upgrade evidence by repository.","objective":"Identify repositories with declared Markdown workflows whose retained compiler-version evidence warrants upgrade review.","acceptance":"Group Markdown workflow declarations by repository coordinate and return distinct known installed/current version lists, distinct counts, upgrade-required evidence, and separate missing-installed/missing-latest flags. Never infer unavailable versions.","from":"workflows","filter":{"predicates":[{"field":"workflow","includes":".md"}]},"compute":[{"as":"repository-coordinate","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"}]},{"as":"installed-version-unavailable","function":"equals-any","args":[{"field":"gh-aw-version"},{"value":""},{"value":"unknown"},{"value":null}]},{"as":"current-version-unavailable","function":"equals-any","args":[{"field":"gh-aw-current-version"},{"value":""},{"value":"unknown"},{"value":null}]},{"as":"known-installed-version","function":"if","args":[{"field":"installed-version-unavailable"},{"value":null},{"field":"gh-aw-version"}]},{"as":"known-current-version","function":"if","args":[{"field":"current-version-unavailable"},{"value":null},{"field":"gh-aw-current-version"}]},{"as":"installed-version-unavailable-value","function":"if","args":[{"field":"installed-version-unavailable"},{"value":1},{"value":0}]},{"as":"current-version-unavailable-value","function":"if","args":[{"field":"current-version-unavailable"},{"value":1},{"value":0}]},{"as":"compiler-versions-match","function":"equals-any","args":[{"field":"gh-aw-version"},{"field":"gh-aw-current-version"}]},{"as":"upgrade-candidate-value","function":"if","args":[{"field":"compiler-versions-match"},{"value":0},{"value":1}]},{"as":"upgrade-with-current-evidence","function":"if","args":[{"field":"current-version-unavailable"},{"value":0},{"field":"upgrade-candidate-value"}]},{"as":"upgrade-required-value","function":"if","args":[{"field":"installed-version-unavailable"},{"value":0},{"field":"upgrade-with-current-evidence"}]}],"aggregate":{"by":["repository-coordinate"],"values":[{"field":"known-installed-version","as":"gh-aw-version","reducer":"distinct-list"},{"field":"known-current-version","as":"gh-aw-current-version","reducer":"distinct-list"},{"field":"known-installed-version","as":"installed-version-count","reducer":"distinct-count"},{"field":"known-current-version","as":"current-version-count","reducer":"distinct-count"},{"field":"upgrade-required-value","as":"upgrade-required","reducer":"max"},{"field":"installed-version-unavailable-value","as":"installed-version-unavailable","reducer":"max"},{"field":"current-version-unavailable-value","as":"current-version-unavailable","reducer":"max"}]}},{"name":"maintenance-repositories","subject":"List each repository with recorded compiler versions and computed upgrade state.","objective":"Expose recorded compiler versions, computed upgrade state, and a concise evidence diagnostic per repository, with its GitHub home URL for inspection.","acceptance":"Return repository, repository-url, known version lists, upgrade-required, upgrade-state, upgrade-status-reason, and upgrade-action-visible. Show Upgrade only when known evidence establishes an outdated compiler; missing or conflicting evidence stays visible and non-actionable.","from":"maintenance-repository-versions","compute":[{"as":"repository-url","function":"concat","args":[{"value":"https://github.com/"},{"field":"repository-coordinate"}]},{"as":"should-upgrade","function":"equals-any","args":[{"field":"upgrade-required"},{"value":1}]},{"as":"installed-version-mixed","function":"greater-than","args":[{"field":"installed-version-count"},{"value":1}]},{"as":"current-version-conflicting","function":"greater-than","args":[{"field":"current-version-count"},{"value":1}]},{"as":"installed-version-missing","function":"equals-any","args":[{"field":"installed-version-unavailable"},{"value":1}]},{"as":"current-version-missing","function":"equals-any","args":[{"field":"current-version-unavailable"},{"value":1}]},{"as":"latest-version-evidence-unavailable","function":"if","args":[{"field":"current-version-missing"},{"value":true},{"field":"current-version-conflicting"}]},{"as":"upgrade-status-unavailable","function":"if","args":[{"field":"installed-version-missing"},{"value":true},{"field":"latest-version-evidence-unavailable"}]},{"as":"current-or-unavailable","function":"if","args":[{"field":"should-upgrade"},{"value":true},{"field":"upgrade-status-unavailable"}]},{"as":"upgrade-state-known","function":"if","args":[{"field":"should-upgrade"},{"value":"Upgrade recommended"},{"value":"Current"}]},{"as":"upgrade-state","function":"if","args":[{"field":"upgrade-status-unavailable"},{"value":"Upgrade status unavailable"},{"field":"upgrade-state-known"}]},{"as":"upgrade-reason-known","function":"if","args":[{"field":"should-upgrade"},{"value":"At least one retained workflow uses an older gh-aw compiler version."},{"value":"All retained workflow compiler versions match the latest stable gh-aw release."}]},{"as":"upgrade-reason-mixed","function":"if","args":[{"field":"installed-version-mixed"},{"value":"Mixed installed gh-aw compiler versions were retained; at least one upgrade is recommended."},{"field":"upgrade-reason-known"}]},{"as":"upgrade-reason-installed","function":"if","args":[{"field":"installed-version-missing"},{"value":"Installed gh-aw compiler version unavailable for one or more workflows."},{"field":"upgrade-reason-mixed"}]},{"as":"upgrade-reason-current","function":"if","args":[{"field":"current-version-missing"},{"value":"Latest stable gh-aw release unavailable."},{"field":"upgrade-reason-installed"}]},{"as":"both-compiler-versions-missing","function":"if","args":[{"field":"installed-version-missing"},{"field":"current-version-missing"},{"value":false}]},{"as":"upgrade-reason-both","function":"if","args":[{"field":"both-compiler-versions-missing"},{"value":"Installed compiler version and latest stable gh-aw release are unavailable."},{"field":"upgrade-reason-current"}]},{"as":"upgrade-status-reason","function":"if","args":[{"field":"current-version-conflicting"},{"value":"Conflicting latest gh-aw release evidence was retained."},{"field":"upgrade-reason-both"}]},{"as":"upgrade-action-visible","function":"if","args":[{"field":"upgrade-status-unavailable"},{"value":false},{"field":"should-upgrade"}]},{"as":"installed-version-available","function":"greater-than","args":[{"field":"installed-version-count"},{"value":0}]},{"as":"current-version-available","function":"greater-than","args":[{"field":"current-version-count"},{"value":0}]},{"as":"gh-aw-version-label","function":"if","args":[{"field":"installed-version-available"},{"field":"gh-aw-version"},{"value":"unknown"}]},{"as":"gh-aw-current-version-label","function":"if","args":[{"field":"current-version-available"},{"field":"gh-aw-current-version"},{"value":"unknown"}]}],"select":[{"field":"repository-coordinate","as":"repository"},{"field":"repository-url"},{"field":"gh-aw-version-label","as":"gh-aw-version"},{"field":"gh-aw-current-version-label","as":"gh-aw-current-version"},{"field":"upgrade-required"},{"field":"upgrade-action-visible"},{"field":"upgrade-state"},{"field":"upgrade-status-reason"}],"order-by":[{"field":"repository","direction":"asc"}]},{"name":"maintenance-campaign-updates","subject":"Expose at most one CAO package update row for the Updates navigation indicator.","objective":"Determine whether retained campaign metadata contains an update-available signal for the Updates indicator.","acceptance":"Return zero or one campaign-update-state row only when it equals update-available; an empty result means no matching retained signal, not that every campaign is current.","from":"maintenance-campaign-packages","filter":{"predicates":[{"field":"campaign-update-action-visible","equals":true}]},"select":[{"field":"campaign-update-action-visible"}],"limit":1},{"name":"maintenance-standalone-updates","subject":"Expose at most one standalone workflow source update row for the Updates navigation indicator.","objective":"Determine whether retained source-managed standalone workflow metadata contains an actionable update signal for the Updates indicator.","acceptance":"Return zero or one workflow-update-action-visible row only when it is true; unmanaged local workflows and incomplete source evidence do not activate the indicator.","from":"maintenance-standalone-workflows","filter":{"predicates":[{"field":"workflow-update-action-visible","equals":true}]},"select":[{"field":"workflow-update-action-visible"}],"limit":1},{"name":"maintenance-repository-upgrades","subject":"Expose at most one gh-aw compiler upgrade row for the Updates navigation indicator.","objective":"Determine whether repository compiler metadata contains an upgrade-required signal for the Updates indicator.","acceptance":"Return zero or one upgrade-action-visible row only when known retained evidence establishes an outdated compiler; missing evidence remains non-actionable and does not activate the indicator.","from":"maintenance-repositories","filter":{"predicates":[{"field":"upgrade-action-visible","equals":true}]},"select":[{"field":"upgrade-action-visible"}],"limit":1},{"name":"run-incomplete-outcomes","subject":"Project retained report-incomplete terminal outcomes as concise run diagnoses.","objective":"Find recorded report_incomplete terminal outcomes that can explain a specific run's incomplete reporting.","acceptance":"Include only runs with a recorded report_incomplete terminal outcome, preserving run-attempt identity, outcome kind, and recorded diagnosis; absence is not proof that reporting completed.","description":"One retained incomplete-evidence diagnosis per workflow Run when the agent explicitly reported that required evidence or access was unavailable.","from":"runs","filter":{"predicates":[{"field":"terminal-outcome","equals":"report_incomplete"}]},"select":[{"field":"organization"},{"field":"repository"},{"field":"workflow"},{"field":"run"},{"field":"run-attempt"},{"field":"terminal-outcome","as":"outcome-kind"},{"field":"terminal-outcome-detail","as":"outcome-diagnosis"}]},{"name":"campaign-runs","subject":"Project workflow runs with campaign attribution and retained failure evidence.","objective":"Connect retained run status and failure details to declared campaign/workflow identity for run-level diagnosis.","acceptance":"Expose run and attempt identity, declared attribution, runtime and target repositories, status, failure and incomplete-outcome evidence, timestamps, and drill-down links; do not infer an outcome from runtime success or missing details.","description":"Canonical workflow runs joined to their declared campaign and workflow identity.","from":"runs","joins":[{"source":"workflows","type":"left","on":[{"left":"organization","right":"organization"},{"left":"repository","right":"repository"},{"left":"workflow","right":"workflow"}],"fields":[{"field":"campaign","as":"declared-campaign"},{"field":"campaign-name","as":"declared-campaign-name"},{"field":"workflow-name","as":"declared-workflow-name"},{"field":"workflow-role","as":"declared-workflow-role"},{"field":"workflow-link","as":"declared-workflow-link"}]},{"source":"run-incomplete-outcomes","type":"left","on":[{"left":"organization","right":"organization"},{"left":"repository","right":"repository"},{"left":"workflow","right":"workflow"},{"left":"run","right":"run"},{"left":"run-attempt","right":"run-attempt"}],"fields":[{"field":"outcome-kind","as":"outcome-kind"},{"field":"outcome-diagnosis","as":"outcome-diagnosis"}]}],"compute":[{"as":"status","function":"coalesce","args":[{"field":"run-conclusion"},{"field":"run-status"},{"value":"unknown"}]},{"as":"effective-outcome-kind","function":"coalesce","args":[{"field":"outcome-kind"},{"field":"terminal-outcome"},{"value":""}]},{"as":"is-incomplete-outcome","function":"equals-any","args":[{"field":"effective-outcome-kind"},{"value":"report_incomplete"}]},{"as":"diagnosis-kind","function":"if","args":[{"field":"is-incomplete-outcome"},{"value":"incomplete_evidence"},{"value":""}]},{"as":"error-signature","function":"coalesce","args":[{"field":"diagnosis-kind"},{"field":"failure-kind"},{"field":"classification"},{"field":"status"}]},{"as":"_error-signature-default-label","function":"title-case","args":[{"field":"error-signature"}]},{"as":"_is-driver-exit","function":"equals-any","args":[{"field":"error-signature"},{"value":"driver_exit"},{"value":"driver-exit"}]},{"as":"error-signature-label","function":"if","args":[{"field":"_is-driver-exit"},{"value":"Agent process exited unexpectedly"},{"field":"_error-signature-default-label"}]},{"as":"status-detail","function":"coalesce","args":[{"field":"outcome-diagnosis"},{"field":"terminal-outcome-detail"},{"field":"failure-detail"},{"field":"failure-message"},{"field":"failure-step"},{"field":"admission-reason"},{"value":""}]},{"as":"runtime-repository","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"}]},{"as":"is-worker","function":"equals-any","args":[{"field":"declared-workflow-role"},{"value":"worker"}]},{"as":"is-orchestrator","function":"equals-any","args":[{"field":"declared-workflow-role"},{"value":"orchestrator"}]},{"as":"root-dispatch-type","function":"if","args":[{"field":"is-orchestrator"},{"value":"Campaign orchestrator"},{"value":"Standalone workflow"}]},{"as":"dispatch-type","function":"if","args":[{"field":"is-worker"},{"value":"Campaign worker"},{"field":"root-dispatch-type"}]},{"as":"campaign-display-name","function":"coalesce","args":[{"field":"declared-campaign-name"},{"field":"declared-campaign"}]},{"as":"workflow-display-name","function":"coalesce","args":[{"field":"declared-workflow-name"},{"field":"workflow"}]},{"as":"encoded-campaign","function":"url-encode","args":[{"field":"declared-campaign"}]},{"as":"campaign-dashboard-href","function":"concat","args":[{"value":"#page-campaign-insights?campaign="},{"field":"encoded-campaign"}]},{"as":"campaign-dashboard-label","function":"concat","args":[{"value":"View "},{"field":"campaign-display-name"},{"value":" campaign dashboard"}]},{"as":"campaign-dashboard-link","function":"dashboard-link","args":[{"field":"repository-link"},{"field":"campaign-dashboard-href"},{"field":"campaign-dashboard-label"},{"field":"declared-campaign"}]},{"as":"encoded-repository","function":"url-encode","args":[{"field":"runtime-repository"}]},{"as":"repository-dashboard-href","function":"concat","args":[{"value":"#page-repository-detail?repository="},{"field":"encoded-repository"}]},{"as":"repository-dashboard-label","function":"concat","args":[{"value":"View "},{"field":"runtime-repository"},{"value":" repository dashboard"}]},{"as":"repository-dashboard-link","function":"dashboard-link","args":[{"field":"repository-link"},{"field":"repository-dashboard-href"},{"field":"repository-dashboard-label"},{"field":"runtime-repository"}]},{"as":"workflow-identity","function":"concat","args":[{"field":"runtime-repository"},{"value":":"},{"field":"workflow"}]},{"as":"encoded-workflow","function":"url-encode","args":[{"field":"workflow-identity"}]},{"as":"workflow-dashboard-href","function":"concat","args":[{"value":"#page-workflow-runtime?workflow="},{"field":"encoded-workflow"}]},{"as":"workflow-dashboard-label","function":"concat","args":[{"value":"View "},{"field":"workflow-display-name"},{"value":" workflow dashboard"}]},{"as":"workflow-dashboard-link","function":"dashboard-link","args":[{"field":"workflow-link"},{"field":"workflow-dashboard-href"},{"field":"workflow-dashboard-label"},{"field":"workflow-identity"}]}],"select":[{"field":"started-at"},{"field":"dispatch-type"},{"field":"declared-campaign","as":"campaign"},{"field":"declared-campaign-name","as":"campaign-name"},{"field":"declared-workflow-name","as":"workflow-name"},{"field":"run"},{"field":"run-attempt"},{"field":"run-title"},{"field":"event"},{"field":"runtime-repository"},{"field":"target-repository"},{"field":"rollout-mode"},{"field":"status"},{"field":"run-status"},{"field":"error-signature"},{"field":"error-signature-label"},{"field":"status-detail"},{"field":"outcome-kind"},{"field":"outcome-diagnosis"},{"field":"declared-workflow-role","as":"workflow-role"},{"field":"failure-job"},{"field":"failure-message"},{"field":"failure-step"},{"field":"failure-log"},{"field":"engine"},{"field":"engine-version"},{"field":"gh-aw-version"},{"field":"requested-model"},{"field":"resolved-model"},{"field":"aic-total"},{"field":"safe-items-count"},{"field":"resource-reset-at","as":"status-detail-at"},{"field":"organization"},{"field":"repository"},{"field":"workflow"},{"field":"declared-workflow-link","as":"workflow-source-link"},{"field":"run-link"},{"field":"campaign-dashboard-link","as":"campaign-link"},{"field":"repository-dashboard-link","as":"repository-link"},{"field":"workflow-dashboard-link","as":"workflow-link"}],"order-by":[{"field":"started-at","direction":"desc"}]},{"name":"campaign-runtime-health-runs","subject":"Project only the run and workflow fields required to classify current campaign runtime health.","objective":"Provide the retained run identity, timing, role, dispatch type, repository, and status needed to assess campaign runtime-health groups.","acceptance":"Project the selected fields from overview-runs without converting missing statuses or unattributed workflows into failures; unavailable run history leaves health assessment incomplete.","description":"A bounded runtime-health input that excludes audit outcomes and presentation-only campaign run fields.","from":"overview-runs","compute":[{"as":"status","function":"coalesce","args":[{"field":"run-conclusion"},{"field":"run-status"},{"value":"unknown"}]},{"as":"runtime-repository","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"}]},{"as":"is-worker","function":"equals-any","args":[{"field":"workflow-role"},{"value":"worker"}]},{"as":"is-orchestrator","function":"equals-any","args":[{"field":"workflow-role"},{"value":"orchestrator"}]},{"as":"root-dispatch-type","function":"if","args":[{"field":"is-orchestrator"},{"value":"Campaign orchestrator"},{"value":"Standalone workflow"}]},{"as":"dispatch-type","function":"if","args":[{"field":"is-worker"},{"value":"Campaign worker"},{"field":"root-dispatch-type"}]}],"select":[{"field":"started-at"},{"field":"campaign"},{"field":"campaign-name"},{"field":"workflow"},{"field":"workflow-name"},{"field":"workflow-role"},{"field":"dispatch-type"},{"field":"runtime-repository"},{"field":"run"},{"field":"run-status"},{"field":"status"}]},{"name":"campaign-runtime-health-groups","subject":"Compute each campaign workflow and runtime repository's latest consecutive failure streak in the selected horizon.","objective":"Locate campaign workflow/runtime-repository groups whose most recent retained completed runs have consecutive runtime failures.","acceptance":"Group completed runs by campaign, workflow, role, dispatch type, and runtime repository; failure-count is the latest retained failure streak, not a rate or a claim about runs outside the available horizon.","description":"Current retained failure streaks grouped by campaign workflow and runtime repository, considering only concluded Runs so an in-flight retry cannot mask an active failure streak.","from":"campaign-runtime-health-runs","filter":{"predicates":[{"field":"run-status","equals":"completed"}]},"compute":[{"as":"is-runtime-failure","function":"equals-any","args":[{"field":"status"},{"value":"failure"},{"value":"startup-failure"},{"value":"stale"},{"value":"timed-out"}]},{"as":"runtime-failure-streak-point","function":"failure-streak-point","args":[{"field":"started-at"},{"field":"run"},{"field":"is-runtime-failure"}]}],"aggregate":{"by":["campaign","campaign-name","workflow","workflow-name","workflow-role","dispatch-type","runtime-repository"],"values":[{"field":"runtime-failure-streak-point","as":"failure-count","reducer":"latest-failure-streak"}]}},{"name":"workflow-run-observation-counts","subject":"Count retained Runs for each workflow identity in the selected horizon.","objective":"Measure retained run presence by workflow identity to compare with active orchestrator declarations.","acceptance":"Count overview-runs by organization, repository, and workflow; a missing group indicates no retained matching run in the available horizon, not proof of no executions.","description":"One row per organization, repository, and workflow with retained Run counts, safe to join without row multiplication.","from":"overview-runs","aggregate":{"by":["organization","repository","workflow"],"values":[{"field":"run","as":"observed-run-count","reducer":"count"}]}},{"name":"campaign-active-orchestrator-run-presence","subject":"Count retained Runs for each active campaign orchestrator in the selected horizon.","objective":"Compare active orchestrator declarations with retained run observations to identify missing visibility.","acceptance":"Keep only workflows declared active with orchestrator role and expose their identity, runtime repository, and observed-run-count; a zero joined count means no retained match, not necessarily a stopped schedule.","description":"Active campaign orchestrators annotated with retained Run presence.","from":"workflows","joins":[{"source":"workflow-run-observation-counts","type":"left","on":[{"left":"organization","right":"organization"},{"left":"repository","right":"repository"},{"left":"workflow","right":"workflow"}],"fields":[{"field":"observed-run-count","as":"joined-observed-run-count"}]}],"filter":{"predicates":[{"field":"workflow-role","equals":"orchestrator"},{"field":"workflow-active","equals":"true"}]},"compute":[{"as":"runtime-repository","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"}]},{"as":"observed-run-count","function":"coalesce","args":[{"field":"joined-observed-run-count"},{"value":0}]}],"select":[{"field":"campaign"},{"field":"campaign-name"},{"field":"workflow"},{"field":"workflow-name"},{"field":"workflow-role"},{"field":"runtime-repository"},{"field":"observed-run-count"}]},{"name":"campaign-unobserved-orchestrator-candidates","subject":"Mark active campaign orchestrators with no retained Runs in the selected horizon.","objective":"Mark active orchestrators lacking retained run evidence for bounded telemetry or schedule review.","acceptance":"Preserve active orchestrator identity and observed-run-count; is-unobserved marks zero retained matches and must not be interpreted as a runtime failure or evidence that dispatch was expected.","description":"Active orchestrators annotated with whether runtime evidence is absent.","from":"campaign-active-orchestrator-run-presence","compute":[{"as":"is-unobserved","function":"equals-any","args":[{"field":"observed-run-count"},{"value":0}]},{"as":"failure-count","function":"sum","args":[{"value":0},{"value":0}]},{"as":"dispatch-type","function":"coalesce","args":[{"value":"Campaign orchestrator"},{"value":"Campaign orchestrator"}]},{"as":"problem-kind","function":"coalesce","args":[{"value":"not-observed"},{"value":"not-observed"}]}]},{"name":"campaign-unobserved-orchestrators","subject":"Show active campaign orchestrators with no retained Runs in the selected horizon.","objective":"List active orchestrator declarations with no retained run observations for follow-up on evidence availability.","acceptance":"Return only is-unobserved candidates with their workflow and repository identity; an empty result does not certify run completeness or scheduler health.","description":"Active campaign orchestrators whose runtime state cannot be established from retained evidence.","from":"campaign-unobserved-orchestrator-candidates","filter":{"predicates":[{"field":"is-unobserved","equals":true}]}},{"name":"dispatches","subject":"Select workflow-dispatch runs from campaign-attributed workflow run evidence.","objective":"Inspect retained workflow_dispatch runs attributed to campaigns before comparing campaign dispatch activity.","acceptance":"Include only campaign-runs with event workflow_dispatch and preserve run, attempt, attribution, status, and time; absence does not establish that no dispatch occurred beyond retained evidence.","description":"Canonical workflow runs whose authoritative trigger is workflow_dispatch.","from":"campaign-runs","filter":{"predicates":[{"field":"event","equals":"workflow_dispatch"}]},"order-by":[{"field":"started-at","direction":"desc"}]},{"name":"campaign-dispatch-inventory","subject":"Project retained dispatch identity and campaign attribution before campaign counting.","objective":"Count dispatches without materializing run diagnoses and presentation links.","acceptance":"Keep workflow_dispatch runs in timestamp order with declared campaign attribution; preserve workflow and incomplete-outcome join quality and duplicate-key failure behavior.","description":"Lean dispatch-count input; the incomplete-outcome join preserves the full campaign run source's evidence quality and fail-closed validation.","from":"runs","joins":[{"source":"workflows","type":"left","on":[{"left":"organization","right":"organization"},{"left":"repository","right":"repository"},{"left":"workflow","right":"workflow"}],"fields":[{"field":"campaign","as":"declared-campaign"}]},{"source":"run-incomplete-outcomes","type":"left","on":[{"left":"organization","right":"organization"},{"left":"repository","right":"repository"},{"left":"workflow","right":"workflow"},{"left":"run","right":"run"},{"left":"run-attempt","right":"run-attempt"}],"fields":[{"field":"outcome-kind","as":"outcome-kind"}]}],"filter":{"predicates":[{"field":"event","equals":"workflow_dispatch"}]},"select":[{"field":"declared-campaign","as":"campaign"},{"field":"run"},{"field":"started-at"}],"order-by":[{"field":"started-at","direction":"desc"}]},{"name":"campaign-dispatch-totals","subject":"Summarize observed workflow dispatches for each centrally managed campaign.","objective":"Compare retained workflow_dispatch run counts across attributed campaigns.","acceptance":"Count distinct run identifiers per campaign from dispatches; do not treat missing campaign attribution or unretained dispatches as zero actual activity.","description":"Observed workflow-dispatch run totals grouped by campaign.","from":"campaign-dispatch-inventory","aggregate":{"by":["campaign"],"values":[{"field":"run","as":"dispatches","reducer":"distinct-count"}]}},{"name":"campaign-workflow-totals","subject":"Summarize observed workflow and execution totals for each centrally managed campaign.","objective":"Compare declared orchestrator/worker composition, rollout registration, observed runs, and AI Credit usage by campaign.","acceptance":"Group only orchestrator and worker workflow-inventory rows by campaign; retain workflow count, distinct roles/modes/registration and summed observed runs and AIC, without inferring successful outcomes.","description":"Observed workflow, rollout, run, and AI Credit totals grouped by campaign.","from":"campaign-workflow-inventory","aggregate":{"by":["campaign"],"values":[{"field":"workflow","as":"workflows","reducer":"count"},{"field":"workflow-role","as":"roles","reducer":"distinct-list"},{"field":"rollout-mode","as":"modes","reducer":"distinct-list"},{"field":"workflow-active","as":"registration","reducer":"distinct-list"},{"field":"runs","as":"runs","reducer":"sum"},{"field":"aic","as":"aic","reducer":"sum"}]}},{"name":"campaign-repository-coverage","subject":"Count distinct registered target repositories reached by successful worker dispatches for each campaign.","objective":"Estimate observed campaign target reach from successful worker workflow_dispatch runs joined to registered repositories.","acceptance":"Count distinct matched target-repository values per campaign only for successful worker dispatches; this is observed reach, not verified target outcomes or complete fleet coverage.","description":"Campaign repository coverage derived from successful worker dispatch runs in the selected horizon.","from":"runs","joins":[{"source":"workflows","type":"inner","on":[{"left":"organization","right":"organization"},{"left":"repository","right":"repository"},{"left":"workflow","right":"workflow"}],"fields":[{"field":"campaign","as":"campaign"},{"field":"workflow-role","as":"workflow-role"}]},{"source":"repositories","type":"inner","on":[{"left":"target-repository","right":"repository-coordinate"}],"fields":[{"field":"repository-coordinate","as":"registered-target-repository"}]}],"filter":{"predicates":[{"field":"event","equals":"workflow_dispatch"},{"field":"run-conclusion","equals":"success"},{"field":"workflow-role","equals":"worker"}]},"aggregate":{"by":["campaign"],"values":[{"field":"target-repository","as":"covered-repositories","reducer":"distinct-count"}]}},{"name":"campaign-inventory-preview","subject":"Show declared campaigns before execution evidence is evaluated.","objective":"Expose campaign identities and navigation links while observed totals remain pending.","acceptance":"Preserve every declared campaign and its dashboard link without reporting missing execution totals as zero.","from":"campaigns","compute":[{"as":"encoded-campaign","function":"url-encode","args":[{"field":"campaign"}]},{"as":"campaign-dashboard-href","function":"concat","args":[{"value":"#page-campaign-insights?campaign="},{"field":"encoded-campaign"}]},{"as":"campaign-dashboard-label","function":"concat","args":[{"value":"View "},{"field":"campaign-name"},{"value":" campaign dashboard"}]},{"as":"campaign-dashboard-link","function":"dashboard-link","args":[{"value":""},{"field":"campaign-dashboard-href"},{"field":"campaign-dashboard-label"},{"field":"campaign"}]}],"select":[{"field":"campaign"},{"field":"campaign-name"},{"field":"campaign-dashboard-link"}],"order-by":[{"field":"campaign-name","direction":"asc"}]},{"name":"campaign-inventory","subject":"List centrally managed campaigns with their observed workflow and execution totals.","objective":"Compare declared campaigns with retained workflow composition, dispatches, target reach, runs, and AIC to choose an evidence-backed drill-down.","acceptance":"Keep declared campaigns with campaign identity and link plus joined totals; defaulted zero values mean no matching retained evidence and cannot certify no activity, complete coverage, or successful outcomes.","description":"Canonical campaign inventory enriched with observed workflow, rollout, run, repository coverage, and AI Credit totals.","from":"campaigns","joins":[{"source":"campaign-workflow-totals","type":"left","on":[{"left":"campaign","right":"campaign"}],"fields":[{"field":"workflows","as":"observed-workflows"},{"field":"roles","as":"observed-roles"},{"field":"modes","as":"observed-modes"},{"field":"registration","as":"observed-registration"},{"field":"runs","as":"observed-runs"},{"field":"aic","as":"observed-aic"}]},{"source":"campaign-dispatch-totals","type":"left","on":[{"left":"campaign","right":"campaign"}],"fields":[{"field":"dispatches","as":"observed-dispatches"}]},{"source":"campaign-repository-coverage","type":"left","on":[{"left":"campaign","right":"campaign"}],"fields":[{"field":"covered-repositories","as":"observed-covered-repositories"}]}],"compute":[{"as":"workflows","function":"coalesce","args":[{"field":"observed-workflows"},{"value":0}]},{"as":"roles","function":"coalesce","args":[{"field":"observed-roles"},{"value":""}]},{"as":"modes","function":"coalesce","args":[{"field":"observed-modes"},{"field":"campaign-mode"}]},{"as":"registration","function":"coalesce","args":[{"field":"observed-registration"},{"field":"campaign-registration"}]},{"as":"runs","function":"coalesce","args":[{"field":"observed-runs"},{"value":0}]},{"as":"dispatches","function":"coalesce","args":[{"field":"observed-dispatches"},{"value":0}]},{"as":"covered-repositories","function":"coalesce","args":[{"field":"observed-covered-repositories"},{"value":0}]},{"as":"aic","function":"coalesce","args":[{"field":"observed-aic"},{"value":0}]},{"as":"encoded-campaign","function":"url-encode","args":[{"field":"campaign"}]},{"as":"campaign-dashboard-href","function":"concat","args":[{"value":"#page-campaign-insights?campaign="},{"field":"encoded-campaign"}]},{"as":"campaign-dashboard-label","function":"concat","args":[{"value":"View "},{"field":"campaign-name"},{"value":" campaign dashboard"}]},{"as":"campaign-dashboard-link","function":"dashboard-link","args":[{"value":""},{"field":"campaign-dashboard-href"},{"field":"campaign-dashboard-label"},{"field":"campaign"}]}],"select":[{"field":"campaign"},{"field":"campaign-name"},{"field":"campaign-dashboard-link"},{"field":"workflows"},{"field":"roles"},{"field":"modes"},{"field":"registration"},{"field":"runs"},{"field":"dispatches"},{"field":"covered-repositories"},{"field":"aic"}],"order-by":[{"field":"campaign-name","direction":"asc"}]},{"name":"firewall-domain-totals","subject":"Show each observed firewall domain with the number of runs and total accepted and blocked requests.","objective":"Identify domains with observed denied requests for a closer review of firewall evidence.","acceptance":"Report distinct observed runs and native accepted and blocked request totals by domain; a denied request alone does not justify allowing egress, and no row does not prove no requests occurred.","description":"Distinct runs and accepted and blocked request totals by firewall domain.","from":"firewall-observations","filter":{"predicates":[{"field":"decision","in":["allowed","denied"]}]},"aggregate":{"by":["domain"],"values":[{"field":"run","as":"run","reducer":"distinct-count"},{"field":"request-count","as":"accepted","reducer":"sum","filter":{"predicates":[{"field":"decision","equals":"allowed"}]}},{"field":"request-count","as":"blocked","reducer":"sum","filter":{"predicates":[{"field":"decision","equals":"denied"}]}}]},"order-by":[{"field":"blocked","direction":"desc"},{"field":"accepted","direction":"desc"},{"field":"domain","direction":"asc"}]},{"name":"firewall-most-blocked-domains","subject":"Highlight the domains with the most blocked firewall requests.","objective":"Prioritize up to ten observed domains by blocked request total for investigation.","acceptance":"Rank by observed blocked totals and inspect underlying domain/workflow evidence before deciding whether a block needs attention; the ranking is not a policy authorization or an incidence rate.","description":"The ten domains with the highest observed blocked request totals.","from":"firewall-domain-totals","order-by":[{"field":"blocked","direction":"desc"},{"field":"domain","direction":"asc"}],"limit":10},{"name":"firewall-domain-workflows","subject":"Show workflows that allowed or blocked requests to each observed firewall domain.","objective":"Locate which observed workflows contributed accepted or denied requests for a domain.","acceptance":"Preserve workflow scope, source link, distinct runs, and native accepted and blocked totals; investigate the run and egress context rather than assuming a denied request is a failure or grounds for wider access.","description":"Workflow-level accepted and blocked request totals by firewall domain.","from":"firewall-observations","filter":{"predicates":[{"field":"decision","in":["allowed","denied"]}]},"compute":[{"as":"workflow-source-url","function":"link-href","args":[{"field":"workflow-link"}]}],"aggregate":{"by":["domain","organization","repository","workflow","workflow-source-url"],"values":[{"field":"run","as":"runs","reducer":"distinct-count"},{"field":"request-count","as":"accepted","reducer":"sum","filter":{"predicates":[{"field":"decision","equals":"allowed"}]}},{"field":"request-count","as":"blocked","reducer":"sum","filter":{"predicates":[{"field":"decision","equals":"denied"}]}}]},"order-by":[{"field":"blocked","direction":"desc"},{"field":"accepted","direction":"desc"},{"field":"repository","direction":"asc"},{"field":"workflow","direction":"asc"}]},{"name":"mcp-tool-totals","subject":"Group observed MCP activity by tool and count calls and calling workflows, excluding the internal safe outputs server.","objective":"Expose tool-level call, workflow, and byte totals to investigate observed MCP usage.","acceptance":"Group only observed non-safe-output-server calls by server and tool, preserving counts and byte totals; lack of calls does not establish no access, and call volume does not establish value or permission.","description":"Observed MCP tool-call totals grouped by MCP server and tool, with the number of distinct calling workflows.","from":"mcp-tool-workflow-totals","filter":{"predicates":[{"field":"safe-output-server","equals":false}]},"aggregate":{"by":["mcp-tool-label","mcp-server","mcp-tool"],"values":[{"field":"calls","as":"calls","reducer":"sum"},{"field":"workflow-key","as":"workflows","reducer":"distinct-count"},{"field":"request-bytes","as":"request-bytes","reducer":"sum"},{"field":"response-bytes","as":"response-bytes","reducer":"sum"}]},"select":[{"field":"mcp-tool-label"},{"field":"mcp-tool"},{"field":"mcp-server"},{"field":"calls"},{"field":"workflows"},{"field":"request-bytes"},{"field":"response-bytes"}],"order-by":[{"field":"calls","direction":"desc"},{"field":"mcp-tool-label","direction":"asc"}]},{"name":"mcp-top-tools","subject":"Show the ten most frequently called MCP tools.","objective":"Identify up to ten tools with the highest observed non-safe-output-server call counts for inspection.","acceptance":"Rank observed calls by tool label and inspect grouped tool evidence before drawing conclusions; do not treat popularity as effectiveness or authority to add tools.","description":"The ten MCP tools with the most observed calls, excluding the internal safe outputs server.","from":"mcp-tool-totals","order-by":[{"field":"calls","direction":"desc"},{"field":"mcp-tool-label","direction":"asc"}],"limit":10},{"name":"steering-events","subject":"Prepare observed gateway steering warnings for aggregation by steering type and workflow.","objective":"Expose warning identity, run context, type, and timestamp for downstream steering diagnostics.","acceptance":"Project recorded gateway steering events with workflow and run attribution where available; a warning is not a completed budget overrun, failure, or reason to increase limits.","description":"Gateway steering warnings emitted when a run approaches its AI Credit budget, time limit, or another declared limit, labelled with a readable steering type.","from":"audits","filter":{"predicates":[{"field":"event-type","equals":"firewall.steering"}]},"joins":[{"source":"workflows","type":"left","on":[{"left":"organization","right":"organization"},{"left":"repository","right":"repository"},{"left":"workflow","right":"workflow"}],"fields":[{"field":"campaign","as":"campaign"},{"field":"workflow-name","as":"workflow-name"}]}],"compute":[{"as":"steering-code","function":"coalesce","args":[{"field":"code"},{"field":"event-status"},{"value":"unknown"}]},{"as":"_token-steering","function":"equals-any","args":[{"field":"steering-code"},{"value":"token_steering"}]},{"as":"_timeout-steering","function":"equals-any","args":[{"field":"steering-code"},{"value":"timeout_steering"}]},{"as":"_turn-steering","function":"equals-any","args":[{"field":"steering-code"},{"value":"turn_steering"},{"value":"max_turns_steering"}]},{"as":"_turn-steering-type","function":"if","args":[{"field":"_turn-steering"},{"value":"Running out of turns"},{"field":"steering-code"}]},{"as":"_timeout-steering-type","function":"if","args":[{"field":"_timeout-steering"},{"value":"Running out of time"},{"field":"_turn-steering-type"}]},{"as":"steering-type","function":"if","args":[{"field":"_token-steering"},{"value":"Running out of tokens"},{"field":"_timeout-steering-type"}]},{"as":"workflow-coordinate","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"},{"value":":"},{"field":"workflow"}]},{"as":"workflow-label","function":"coalesce","args":[{"field":"workflow-name"},{"field":"workflow-coordinate"}]}],"select":[{"field":"id"},{"field":"organization"},{"field":"repository"},{"field":"workflow"},{"field":"workflow-name"},{"field":"workflow-coordinate"},{"field":"workflow-label"},{"field":"campaign"},{"field":"run"},{"field":"run-link"},{"field":"steering-code"},{"field":"steering-type"},{"field":"event-summary"},{"field":"observed-at"}]},{"name":"steering-type-totals","subject":"Show how often each kind of steering warning occurred.","objective":"Identify steering warning categories to inspect in their run context.","acceptance":"Report observed event totals and distinct runs and workflows by type; confirm underlying warnings before interpreting frequency, and do not infer actual limit breaches.","description":"Observed gateway steering warnings grouped by steering type with the number of affected runs and workflows.","from":"steering-events","aggregate":{"by":["steering-type","steering-code"],"values":[{"field":"id","as":"events","reducer":"count"},{"field":"run","as":"runs","reducer":"distinct-count"},{"field":"workflow-coordinate","as":"workflows","reducer":"distinct-count"}]},"select":[{"field":"steering-type"},{"field":"steering-code"},{"field":"events"},{"field":"runs"},{"field":"workflows"}],"order-by":[{"field":"events","direction":"desc"},{"field":"steering-type","direction":"asc"}]},{"name":"steering-workflow-totals","subject":"Count steering warnings for each workflow.","objective":"Expose workflow-level warning totals and token/time warning breakdowns for downstream review.","acceptance":"Count recorded events and distinct runs by workflow, retaining the declared token/time categories; other types remain in total events and no warning alone establishes a failure.","description":"Gateway steering warnings grouped by workflow, split into token-budget and time-limit warnings.","from":"steering-events","aggregate":{"by":["workflow-coordinate","organization","repository","workflow","workflow-label","campaign"],"values":[{"field":"id","as":"events","reducer":"count"},{"field":"run","as":"runs","reducer":"distinct-count"},{"field":"id","as":"token-events","reducer":"count","filter":{"predicates":[{"field":"steering-code","equals":"token_steering"}]}},{"field":"id","as":"time-events","reducer":"count","filter":{"predicates":[{"field":"steering-code","equals":"timeout_steering"}]}},{"field":"steering-type","as":"steering-types","reducer":"distinct-count"}]},"order-by":[{"field":"events","direction":"desc"},{"field":"workflow-coordinate","direction":"asc"}]},{"name":"steering-workflows","subject":"Present workflow steering totals with a link to each workflow dashboard.","objective":"Show observed workflow steering totals with navigation to the affected run context.","acceptance":"Keep workflow identity, link, events, runs, and warning breakdowns tied to their grouped evidence; use drill-through before recommending changes, not warning counts as a basis to widen budgets.","description":"Workflow steering totals labelled with a link to the workflow runtime page.","from":"steering-workflow-totals","compute":[{"as":"encoded-workflow","function":"url-encode","args":[{"field":"workflow-coordinate"}]},{"as":"workflow-dashboard-href","function":"concat","args":[{"value":"#page-workflow-runtime?workflow="},{"field":"encoded-workflow"}]},{"as":"workflow-dashboard-label","function":"concat","args":[{"value":"View "},{"field":"workflow-coordinate"},{"value":" workflow dashboard"}]},{"as":"workflow-dashboard-link","function":"dashboard-link","args":[{"value":""},{"field":"workflow-dashboard-href"},{"field":"workflow-dashboard-label"},{"field":"workflow-label"}]}],"select":[{"field":"workflow-coordinate"},{"field":"workflow-label"},{"field":"workflow-dashboard-link"},{"field":"organization"},{"field":"repository"},{"field":"campaign"},{"field":"events"},{"field":"runs"},{"field":"token-events"},{"field":"time-events"},{"field":"steering-types"}],"order-by":[{"field":"events","direction":"desc"},{"field":"workflow-coordinate","direction":"asc"}]},{"name":"steering-top-workflows","subject":"Highlight the workflows with the most steering warnings.","objective":"Prioritize up to ten workflows by observed warning count for investigation.","acceptance":"Rank recorded warning totals with workflow context, checking underlying events and telemetry coverage; a high rank neither proves overrun nor justifies a limit change.","description":"The ten workflows with the highest observed gateway steering warning totals.","from":"steering-workflows","order-by":[{"field":"events","direction":"desc"},{"field":"workflow-coordinate","direction":"asc"}],"limit":10},{"name":"entity-workflow-run-totals","subject":"Summarize run outcomes and AI Credit consumption for reusable workflow cards.","objective":"Compare retained run-attempt activity, recorded conclusions, and AI Credit usage per workflow card.","acceptance":"Group by organization, repository, and workflow; expose distinct run-attempt count, success/failure conclusion counts, and sum of recorded AIC, without treating missing run history as zero actual activity.","from":"runs","compute":[{"as":"run-attempt-identity","function":"concat","args":[{"field":"run"},{"value":":"},{"field":"run-attempt"}]},{"as":"positive-aic","function":"greater-than","args":[{"field":"aic-total"},{"value":0}]}],"aggregate":{"by":["organization","repository","workflow"],"values":[{"field":"run-attempt-identity","as":"runs","reducer":"distinct-count"},{"field":"run-attempt-identity","as":"aic-runs","reducer":"distinct-count","filter":{"predicates":[{"field":"positive-aic","equals":true}]}},{"field":"run-conclusion","as":"successful-runs","reducer":"count","filter":{"predicates":[{"field":"run-conclusion","equals":"success"}]}},{"field":"run-conclusion","as":"failed-runs","reducer":"count","filter":{"predicates":[{"field":"run-conclusion","in":["failure","startup-failure","stale","timed-out"]}]}},{"field":"aic-total","as":"aic","reducer":"sum","filter":{"predicates":[{"field":"positive-aic","equals":true}]}}]}},{"name":"entity-workflows","subject":"Project workflow entities for reusable workflow cards and repository drill-down.","objective":"Relate declared workflows to observed run and AIC totals for workflow-level drill-down.","acceptance":"Keep declared workflow identity, role, registration, campaign, link, and joined totals; a missing run match defaults to displayed zeros but does not establish no executions or outcomes.","from":"workflows","joins":[{"source":"entity-workflow-run-totals","type":"left","on":[{"left":"organization","right":"organization"},{"left":"repository","right":"repository"},{"left":"workflow","right":"workflow"}],"fields":[{"field":"runs","as":"observed-runs"},{"field":"successful-runs","as":"observed-successful-runs"},{"field":"failed-runs","as":"observed-failed-runs"},{"field":"aic","as":"observed-aic"},{"field":"aic-runs","as":"observed-aic-runs"}]}],"compute":[{"as":"runs","function":"coalesce","args":[{"field":"observed-runs"},{"value":0}]},{"as":"successful-runs","function":"coalesce","args":[{"field":"observed-successful-runs"},{"value":0}]},{"as":"failed-runs","function":"coalesce","args":[{"field":"observed-failed-runs"},{"value":0}]},{"as":"aic","function":"coalesce","args":[{"field":"observed-aic"},{"value":0}]},{"as":"aic-per-run","function":"quotient","args":[{"field":"aic"},{"field":"observed-aic-runs"}]}],"select":[{"field":"organization"},{"field":"repository"},{"field":"workflow"},{"field":"workflow-name"},{"field":"workflow-role"},{"field":"workflow-active"},{"field":"campaign-name"},{"field":"observed-at"},{"field":"runs"},{"field":"successful-runs"},{"field":"failed-runs"},{"field":"aic-per-run"},{"field":"workflow-link"}],"order-by":[{"field":"repository","direction":"asc"},{"field":"workflow","direction":"asc"}]},{"name":"repository-runs","subject":"Project canonical runs into repository-addressable run evidence.","objective":"Expose retained run chronology and status for a selected repository's drill-down.","acceptance":"Retain repository coordinate, workflow, run identity, title, event, start time, conclusion, mode, AIC, and run link; absent details or runs do not establish a healthy or idle repository.","description":"Workflow runs with a stable repository route key.","from":"runs","compute":[{"as":"repository-coordinate","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"}]}],"select":[{"field":"repository-coordinate"},{"field":"workflow"},{"field":"run"},{"field":"run-title"},{"field":"event"},{"field":"started-at"},{"field":"run-status"},{"field":"run-conclusion"},{"field":"rollout-mode"},{"field":"aic-total"},{"field":"run-link"}],"order-by":[{"field":"started-at","direction":"desc"},{"field":"run","direction":"desc"}]},{"name":"repository-workflow-totals","subject":"Summarize declared and disabled workflow counts by repository.","objective":"Compare declared and disabled workflow counts for each repository in the retained workflow inventory.","acceptance":"Count declared workflows and workflow-active=false entries by organization and repository; missing declarations must not be interpreted as a complete zero-workflow inventory.","description":"Declared and disabled workflow totals for each repository.","from":"workflows","aggregate":{"by":["organization","repository"],"values":[{"field":"workflow","as":"workflows","reducer":"count"},{"field":"workflow","as":"disabled","reducer":"count","filter":{"predicates":[{"field":"workflow-active","equals":"false"}]}}]}},{"name":"repository-report-totals","subject":"Summarize published outcome report counts by repository.","objective":"Show retained outcome-report volume per repository for comparison with observed execution.","acceptance":"Count retained outcome rows by organization and repository; a missing aggregate does not prove no reports were published or that reported outcomes succeeded.","description":"Published report totals for each repository.","from":"outcomes","aggregate":{"by":["organization","repository"],"values":[{"field":"repository","as":"reports","reducer":"count"}]}},{"name":"repository-run-identities","subject":"Project the run-attempt identities needed to match imported evidence.","objective":"Keep import-coverage joins narrow without carrying run details, links, or costs.","acceptance":"Preserve each selected run attempt and its organization, repository, workflow, run, and attempt keys. Do not deduplicate attempts or change selected-horizon semantics.","from":"runs","select":[{"field":"organization"},{"field":"repository"},{"field":"workflow"},{"field":"run"},{"field":"run-attempt"}]},{"name":"repository-import-totals","subject":"Count selected run attempts with matching retained imported records.","objective":"Join compact run identities to already reduced event evidence, then reduce import coverage by repository.","acceptance":"Match all five run-attempt keys and count each selected run row once when events are positive. Preserve optional-evidence quality and horizon filters; records for unselected runs do not establish coverage.","from":"repository-run-identities","joins":[{"source":"event-runs","type":"left","on":[{"left":"organization","right":"organization"},{"left":"repository","right":"repository"},{"left":"workflow","right":"workflow"},{"left":"run","right":"run"},{"left":"run-attempt","right":"run-attempt"}],"fields":[{"field":"events","as":"imported-events"}]}],"compute":[{"as":"imported","function":"greater-than","args":[{"field":"imported-events"},{"value":0}]}],"aggregate":{"by":["organization","repository"],"values":[{"field":"imported","as":"imported-runs","reducer":"sum"}]}},{"name":"repository-run-totals","subject":"Summarize distinct runs, failures, and approval-required runs by repository.","objective":"Join already reduced run statistics and import coverage at repository grain.","acceptance":"Group by organization and repository; preserve distinct run IDs, configured failure/action-required conclusion counts, and imported-run sums. Missing enrichment or run history must not be treated as complete coverage.","description":"Distinct run and conclusion totals for each repository.","from":"repository-run-statistics","joins":[{"source":"repository-import-totals","type":"left","on":[{"left":"organization","right":"organization"},{"left":"repository","right":"repository"}],"fields":[{"field":"imported-runs","as":"imported-runs"}]}],"select":[{"field":"organization"},{"field":"repository"},{"field":"runs"},{"field":"failed"},{"field":"action-required"},{"field":"imported-runs"}]},{"name":"repository-activity-preview","subject":"List repository identities before execution metrics are computed.","objective":"Show retained repository identities and drill links while activity metrics are pending.","acceptance":"List repositories by organization with repository drill links; this preview does not establish activity totals or outcomes.","description":"Fast repository inventory with drill links; activity fields remain pending.","from":"repositories","compute":[{"as":"repository-slug","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"}]},{"as":"encoded-repository","function":"url-encode","args":[{"field":"repository-slug"}]},{"as":"repository-dashboard-href","function":"concat","args":[{"value":"#page-repository-detail?repository="},{"field":"encoded-repository"}]},{"as":"repository-dashboard-label","function":"concat","args":[{"value":"View "},{"field":"repository-slug"},{"value":" repository dashboard"}]},{"as":"repository-dashboard-link","function":"dashboard-link","args":[{"field":"repository-link"},{"field":"repository-dashboard-href"},{"field":"repository-dashboard-label"},{"field":"repository-slug"}]}],"select":[{"field":"organization"},{"field":"repository-slug","as":"repository"},{"field":"repository-dashboard-link","as":"repository-link"}],"order-by":[{"field":"repository","direction":"asc"}]},{"name":"repository-activity-core","subject":"Join each repository with its workflow, report, and run totals.","objective":"Attach retained workflow, report, and run aggregates to each repository for bounded inventory review.","acceptance":"Preserve each repository and the available joined aggregates by organization and repository; unmatched metrics remain missing evidence, not confirmed zero activity or evaluated outcomes.","description":"Repository inventory joined with workflow, report, evaluation, and run totals.","from":"repositories","joins":[{"source":"repository-workflow-totals","type":"left","on":[{"left":"organization","right":"organization"},{"left":"repository","right":"repository"}],"fields":[{"field":"workflows","as":"observed-workflows"},{"field":"disabled","as":"observed-disabled"}]},{"source":"repository-report-totals","type":"left","on":[{"left":"organization","right":"organization"},{"left":"repository","right":"repository"}],"fields":[{"field":"reports","as":"observed-reports"}]},{"source":"repository-run-totals","type":"left","on":[{"left":"organization","right":"organization"},{"left":"repository","right":"repository"}],"fields":[{"field":"runs","as":"observed-runs"},{"field":"failed","as":"observed-failed"},{"field":"action-required","as":"observed-action-required"},{"field":"imported-runs","as":"observed-imported-runs"}]}]},{"name":"repository-activity","subject":"Show repository-level execution health, outcome activity, and AI Credit usage in an actionable inventory.","objective":"Prioritize repository drill-down using declared workflows, observed runs, reports, failures, import coverage, and AIC.","acceptance":"Return repository identity and link with retained counts, ingestion indicator, failure summary, AIC, and computed status; statuses describe retained evidence only, and an empty or unavailable preview cannot verify health, outcomes, or zero activity.","description":"Repository-local execution health and attributed outcome totals.","from":"repository-activity-core","joins":[{"source":"repository-aic-totals","type":"left","on":[{"left":"organization","right":"organization"},{"left":"repository","right":"repository"}],"fields":[{"field":"aic","as":"observed-aic"}]}],"compute":[{"as":"repository-slug","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"}]},{"as":"workflows","function":"coalesce","args":[{"field":"observed-workflows"},{"value":0}]},{"as":"disabled","function":"coalesce","args":[{"field":"observed-disabled"},{"value":0}]},{"as":"runs","function":"coalesce","args":[{"field":"observed-runs"},{"value":0}]},{"as":"failed","function":"coalesce","args":[{"field":"observed-failed"},{"value":0}]},{"as":"imported-runs","function":"coalesce","args":[{"field":"observed-imported-runs"},{"value":0}]},{"as":"ingestion-rate","function":"quotient","args":[{"field":"imported-runs"},{"field":"runs"}]},{"as":"ingestion","function":"format-percent","args":[{"field":"ingestion-rate"}]},{"as":"action-required","function":"coalesce","args":[{"field":"observed-action-required"},{"value":0}]},{"as":"aic","function":"coalesce","args":[{"field":"observed-aic"},{"value":0}]},{"as":"has-failures","function":"greater-than","args":[{"field":"failed"},{"value":0}]},{"as":"has-action-required","function":"greater-than","args":[{"field":"action-required"},{"value":0}]},{"as":"has-runs","function":"greater-than","args":[{"field":"runs"},{"value":0}]},{"as":"has-disabled","function":"greater-than","args":[{"field":"disabled"},{"value":0}]},{"as":"outcomes-observed","function":"coalesce","args":[{"field":"observed-reports"},{"value":0}]},{"as":"has-outcomes","function":"greater-than","args":[{"field":"outcomes-observed"},{"value":0}]},{"as":"failure-rate","function":"quotient","args":[{"field":"failed"},{"field":"runs"}]},{"as":"failure-percent","function":"format-percent","args":[{"field":"failure-rate"}]},{"as":"failure-count","function":"format-count","args":[{"field":"failed"}]},{"as":"observed-failure-summary","function":"concat","args":[{"field":"failure-percent"},{"value":" · "},{"field":"failure-count"},{"value":" failed"}]},{"as":"failure-summary","function":"if","args":[{"field":"has-runs"},{"field":"observed-failure-summary"},{"value":"—"}]},{"as":"outcome-status","function":"if","args":[{"field":"has-outcomes"},{"value":"Outcomes observed"},{"value":"No recent activity"}]},{"as":"disabled-status","function":"if","args":[{"field":"has-disabled"},{"value":"Disabled workflows"},{"field":"outcome-status"}]},{"as":"run-status","function":"if","args":[{"field":"has-runs"},{"value":"No failures observed"},{"field":"disabled-status"}]},{"as":"action-status","function":"if","args":[{"field":"has-action-required"},{"value":"Approval required"},{"field":"run-status"}]},{"as":"status","function":"if","args":[{"field":"has-failures"},{"value":"Needs attention"},{"field":"action-status"}]},{"as":"encoded-repository","function":"url-encode","args":[{"field":"repository-slug"}]},{"as":"repository-dashboard-href","function":"concat","args":[{"value":"#page-repository-detail?repository="},{"field":"encoded-repository"}]},{"as":"repository-dashboard-label","function":"concat","args":[{"value":"View "},{"field":"repository-slug"},{"value":" repository dashboard"}]},{"as":"repository-dashboard-link","function":"dashboard-link","args":[{"field":"repository-link"},{"field":"repository-dashboard-href"},{"field":"repository-dashboard-label"},{"field":"repository-slug"}]}],"select":[{"field":"organization"},{"field":"repository","as":"repository-name"},{"field":"repository-slug","as":"repository"},{"field":"workflows"},{"field":"observed-reports","as":"reports"},{"field":"runs"},{"field":"ingestion"},{"field":"failure-summary"},{"field":"aic"},{"field":"status"},{"field":"repository-dashboard-link","as":"repository-link"},{"field":"failed"}],"order-by":[{"field":"failed","direction":"desc"},{"field":"runs","direction":"desc"},{"field":"repository","direction":"asc"}]},{"name":"repository-daily-run-buckets","subject":"Select repository run counts by whole UTC start-day buckets.","objective":"Keep count selection independent of retained Run detail.","acceptance":"Use UTC midnight and request bounds, matching the Runs daily chart; do not fabricate sub-day totals or missing days.","from":"daily-run-counts","compute":[{"as":"day-midnight","function":"concat","args":[{"field":"day"},{"value":"T00:00:00Z"}]},{"as":"day-ms","function":"timestamp","args":[{"field":"day-midnight"}]},{"as":"start-ms","function":"timestamp","args":[{"context":"time-start"}]},{"as":"end-ms","function":"timestamp","args":[{"context":"time-end"}]},{"as":"before-start","function":"greater-than","args":[{"field":"start-ms"},{"field":"day-ms"}]},{"as":"before-end","function":"greater-than","args":[{"field":"end-ms"},{"field":"day-ms"}]}]},{"name":"repository-observed-run-counts","subject":"Count observed logical Runs by repository from persistent daily buckets.","objective":"Supply the run-volume chart without computing activity health, ingestion coverage, or workflow costs.","acceptance":"Sum daily totals, not attempts or retained detail. Select whole UTC start-day buckets by midnight and preserve partial or unavailable coverage.","from":"repository-daily-run-buckets","filter":{"predicates":[{"field":"before-start","in":[false,null]},{"field":"before-end","in":[true,null]}]},"compute":[{"as":"repository-coordinate","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"}]}],"aggregate":{"by":["organization","repository-coordinate"],"values":[{"field":"total","as":"runs","reducer":"sum"}]}},{"name":"repository-run-inventory","subject":"Registered repositories and observed daily logical Run counts.","objective":"Compare repository execution volume and choose repositories for drill-down.","acceptance":"Keep top 100 identities and drill links with stable count and repository ordering. Zero means no admitted dated Runs in selected UTC buckets, not inactivity. Preserve partial coverage; unavailable daily evidence must not produce zeros. Table keeps full inventory.","from":"repository-activity-preview","joins":[{"source":"repository-observed-run-counts","type":"left","on":[{"left":"organization","right":"organization"},{"left":"repository","right":"repository-coordinate"}],"fields":[{"field":"runs","as":"observed-runs"}]}],"compute":[{"as":"runs","function":"coalesce","args":[{"field":"observed-runs"},{"value":0}]}],"select":[{"field":"organization"},{"field":"repository"},{"field":"runs"},{"field":"repository-link"}],"order-by":[{"field":"runs","direction":"desc"},{"field":"repository","direction":"asc"}],"limit":100},{"name":"workflow-route-record","subject":"Project the selected workflow's identity and registration for its route shell.","objective":"Identify the workflow and its recorded campaign registration before inspecting route-specific evidence.","acceptance":"Preserve organization, repository, workflow identity, recorded role, activation, campaign, rollout mode, and source link; absent registration is not inferred from runs, and displayed activation does not grant execution authority.","from":"workflows","select":[{"field":"organization"},{"field":"repository"},{"field":"workflow"},{"field":"workflow-name"},{"field":"workflow-role"},{"field":"workflow-active"},{"field":"campaign"},{"field":"campaign-name"},{"field":"rollout-mode"},{"field":"workflow-link"}]},{"name":"workflow-runtime-health-summary","subject":"Sum daily runtime conclusion counts for the selected workflow.","objective":"Inspect observed dated runs independently of retained detail.","acceptance":"Sum by organization/repository/workflow without adding detail; successful, failed, approval, pending, and other sum to total. Dates use UTC run start; undated evidence is incomplete and missing projection is unavailable. Pending is last-observed state, success is not a verified outcome, and sub-day filters are unsupported.","from":"daily-run-counts","aggregate":{"by":["organization","repository","workflow"],"values":[{"field":"total","as":"total","reducer":"sum"},{"field":"successful","as":"successful","reducer":"sum"},{"field":"failed","as":"failed","reducer":"sum"},{"field":"approval","as":"approval","reducer":"sum"},{"field":"pending","as":"pending","reducer":"sum"},{"field":"other","as":"other","reducer":"sum"}]}},{"name":"workflow-runtime-usage-summary","subject":"Sum retained AI Credits and count telemetry rows for the selected workflow without transferring runs.","objective":"Inspect a workflow's observed AI Credit consumption together with the amount of retained usage telemetry.","acceptance":"AI Credits sum the retained aic values within each organization, repository, and workflow, and telemetry-count counts its usage records; absent telemetry does not establish zero cost or complete run coverage.","from":"usage","compute":[{"as":"positive-aic","function":"greater-than","args":[{"field":"aic"},{"value":0}]}],"aggregate":{"by":["organization","repository","workflow"],"values":[{"field":"aic","as":"aic","reducer":"sum","filter":{"predicates":[{"field":"positive-aic","equals":true}]}},{"field":"run","as":"telemetry-count","reducer":"count"}]}},{"name":"outcome-route-record","subject":"Project the selected safe-output record for the outcome route and its sections.","objective":"Inspect a retained safe output's recorded disposition and follow its durable evidence links.","acceptance":"Preserve safe-output and run identity, title, category, disposition, summary, timestamps, rollout mode, workflow context, and retained links; missing fields stay unknown and a recorded disposition is not independently verified operational impact.","from":"outcomes","select":[{"field":"safe-output"},{"field":"run"},{"field":"outcome-title"},{"field":"outcome-number"},{"field":"outcome-category"},{"field":"outcome-status"},{"field":"outcome-state"},{"field":"outcome-summary"},{"field":"published-at"},{"field":"observed-at"},{"field":"rollout-mode"},{"field":"workflow"},{"field":"workflow-name"},{"field":"workflow-link"},{"field":"external-link"},{"field":"issue-link"},{"field":"pull-request-link"},{"field":"run-link"}]},{"name":"entity-runs","subject":"Project run entities for reusable run cards and workflow drill-down.","objective":"Expose retained run-attempt identity, execution timing, conclusion, and link for a bounded workflow-run inspection.","acceptance":"Keep organization, repository, workflow, run and attempt with status, conclusion, event, branch, duration, timestamps, and run link; missing timing or conclusion remains unknown rather than inferred success.","from":"runs","select":[{"field":"organization"},{"field":"repository"},{"field":"workflow"},{"field":"target-repository"},{"field":"run"},{"field":"run-attempt"},{"field":"run-title"},{"field":"run-status"},{"field":"run-conclusion"},{"field":"event"},{"field":"branch"},{"field":"duration"},{"field":"started-at"},{"field":"ended-at"},{"field":"run-link"}],"order-by":[{"field":"started-at","direction":"desc"}]},{"name":"workflow-runs","subject":"Project canonical runs into route-addressable workflow run evidence.","objective":"Trace retained runs and recorded failure evidence for a selected workflow route.","acceptance":"Preserve workflow route, run identity, timing, recorded Actions minutes and AI Credits, status, conclusion, failure fields, mode, engine/model metadata, and run link; missing failure details do not prove success or rule out incomplete import.","description":"Workflow runs with a stable repository and workflow route key.","from":"runs","compute":[{"as":"repository-coordinate","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"}]},{"as":"workflow-route","function":"concat","args":[{"field":"repository-coordinate"},{"value":":"},{"field":"workflow"}]}],"select":[{"field":"workflow-route"},{"field":"organization"},{"field":"repository"},{"field":"workflow"},{"field":"run"},{"field":"run-title"},{"field":"event"},{"field":"started-at"},{"field":"ended-at"},{"field":"action-minutes"},{"field":"aic-total"},{"field":"run-status"},{"field":"run-conclusion"},{"field":"failure-job"},{"field":"failure-message"},{"field":"failure-step"},{"field":"failure-log"},{"field":"rollout-mode"},{"field":"engine"},{"field":"engine-version"},{"field":"gh-aw-version"},{"field":"requested-model"},{"field":"resolved-model"},{"field":"run-link"}],"order-by":[{"field":"started-at","direction":"desc"},{"field":"run","direction":"desc"}]},{"name":"workflow-failure-trend","subject":"Show recent failure counts and their change for each workflow.","objective":"Spot a change in observed workflow failure activity without treating unknown conclusions as failures.","acceptance":"Each observed failure counts once within its own workflow; the first change is undefined and the seven-observation window is not a seven-day calendar interval.","from":"workflow-runs","compute":[{"as":"is-failure","function":"equals-any","args":[{"field":"run-conclusion"},{"value":"failure"},{"value":"timed_out"}]},{"as":"failure-count","function":"if","args":[{"field":"is-failure"},{"value":1},{"value":0}]}],"window":[{"operation":"rolling","field":"failure-count","as":"recent-failure-count","frame":7,"reducer":"sum","order-by":[{"field":"started-at","direction":"asc"},{"field":"run","direction":"asc"}],"groupby":["workflow-route"]},{"operation":"change","field":"recent-failure-count","as":"failure-count-change","mode":"absolute","order-by":[{"field":"started-at","direction":"asc"},{"field":"run","direction":"asc"}],"groupby":["workflow-route"]}]},{"name":"workflow-reports","subject":"Project retained outcomes into route-addressable workflow reports.","objective":"Review retained workflow outcome reports separately from execution status before interpreting operational results.","acceptance":"Keep route, safe output, report title and summary, recorded status, category, observation time, metadata, and external link; missing reports or status do not imply success or no work.","description":"Workflow outcome reports with stable route keys and disposition fields.","from":"outcomes","compute":[{"as":"report-repository","function":"coalesce","args":[{"field":"runtime-repository"},{"field":"repository"}]},{"as":"workflow-route","function":"concat","args":[{"field":"report-repository"},{"value":":"},{"field":"workflow"}]},{"as":"report-status","function":"coalesce","args":[{"field":"outcome-status"},{"field":"outcome-state"},{"value":"unknown"}]}],"select":[{"field":"workflow-route"},{"field":"safe-output"},{"field":"outcome-title"},{"field":"outcome-summary"},{"field":"report-status","as":"outcome-status"},{"field":"rollout-mode"},{"field":"engine"},{"field":"engine-version"},{"field":"requested-model"},{"field":"resolved-model"},{"field":"outcome-category"},{"field":"observed-at"},{"field":"external-link"}],"order-by":[{"field":"observed-at","direction":"desc"},{"field":"outcome-title","direction":"asc"}]},{"name":"value-measurement-facts","subject":"Original native primary and diagnostic observations from reviewed batch evaluators.","objective":"Keep periods, native units, evaluator identity and missingness inspectable without inventing delivery events.","acceptance":"Null is unavailable, not zero. Interval measurements are not snapshots or cumulative accepted contributions.","from":"workflow-value-measurements","time":{"range":"all"},"compute":[{"as":"measurement-marker","function":"literal","args":[{"value":1}]},{"as":"measurement-missing","function":"equals-any","args":[{"field":"value"},{"value":null}]},{"as":"known-measurement","function":"concat","args":[{"field":"value"},{"value":" "},{"field":"metric-unit"}]},{"as":"measurement-label","function":"if","args":[{"field":"measurement-missing"},{"value":"Not measured"},{"field":"known-measurement"}]},{"as":"measurement-context","function":"concat","args":[{"field":"repository"},{"value":" · "},{"field":"workflow-name"}]}]},{"name":"value-measurement-order","subject":"Latest assessment of each workflow measure, including unavailable assessments.","objective":"Do not let an older numeric value hide a newer incomplete period.","acceptance":"Choose latest cutoff and assessment before considering value or coverage; preserve evaluator digest.","from":"value-measurement-facts","window":[{"operation":"change","field":"measurement-marker","as":"older-measurement","mode":"absolute","groupby":["repository","workflow-route","workflow-slug","campaign","value-id"],"order-by":[{"field":"window-end","direction":"desc"},{"field":"observed-at","direction":"desc"}]}]},{"name":"value-current-measurements","subject":"Latest native primary measurements, separately from event-ledger reports.","objective":"Expose ordinary reviewed batch results on the same Value surface.","acceptance":"Do not infer healthy outcomes, accepted implementations or complete coverage from a non-null value.","from":"value-measurement-order","filter":{"predicates":[{"field":"older-measurement","equals":"unknown"},{"field":"metric-role","equals":"primary"}]}},{"name":"value-evidence-facts","subject":"Published original evidence for frozen workflow value contracts.","objective":"Keep report identity, target repository, workflow and capture together.","acceptance":"Read canonical evidence only. No GitHub acquisition, HTML loading or fabricated evidence on navigation.","from":"operational-value-evidence","time":{"range":"all"}},{"name":"value-contracts","subject":"One retained contract per repository, workflow and versioned native measure.","objective":"Compute each report independently before selecting current workflow results.","acceptance":"Preserve separate versions and exact report identity. Latest-version selection belongs to the workflow result query.","from":"value-evidence-facts","filter":{"predicates":[{"field":"fact-kind","equals":"contract"}]},"compute":[{"as":"report-marker","function":"literal","args":[{"value":1}]}]},{"name":"value-measurement-captures","subject":"Accepted complete native batch assessments, separately from collection decisions.","objective":"Expose actual retained capture clocks without advancing them on failure or partial data.","acceptance":"Only mature complete non-null primary assessments establish an accepted capture; zero remains valid.","from":"value-measurement-facts","filter":{"predicates":[{"field":"metric-role","equals":"primary"},{"field":"measurement-missing","equals":false},{"field":"coverage-status","equals":"complete"},{"field":"maturity-status","equals":"matured"}]},"compute":[{"as":"report-marker","function":"literal","args":[{"value":1}]}],"select":[{"field":"workflow-route"},{"field":"observed-at"},{"field":"window-end"},{"field":"id","as":"capture-id"},{"field":"report-marker"}]},{"name":"value-contract-captures","subject":"Original capture clocks from accepted rich evidence packets.","objective":"Align capture metadata without merging measured populations.","acceptance":"This union is capture metadata only, never combined metric totals.","from":"value-contracts","select":[{"field":"workflow-route"},{"field":"observed-at"},{"field":"window-end"},{"field":"report-id","as":"capture-id"},{"field":"report-marker"}]},{"name":"value-capture-order","subject":"Actual captures across the retained measures of each workflow.","objective":"Expose the last accepted capture independently of collection decisions.","acceptance":"Select by original capture time. A deferred or failed check cannot advance evidence clocks.","from":"value-contract-captures","union":["value-measurement-captures"],"window":[{"operation":"change","field":"report-marker","as":"later-capture","mode":"absolute","groupby":["workflow-route"],"order-by":[{"field":"observed-at","direction":"desc"},{"field":"capture-id","direction":"desc"}]}]},{"name":"value-latest-capture","subject":"One last accepted capture per workflow, not a freshness claim.","objective":"Join capture and cutoff without multiplying collection registrations.","acceptance":"Missing packets remain unavailable, never zero or an inferred successful collection.","from":"value-capture-order","filter":{"predicates":[{"field":"later-capture","equals":"unknown"}]}},{"name":"value-collection-health","subject":"Reviewed registration and authoritative collection decisions, with independently retained evidence.","objective":"Explain disabled, unconfigured, deferred, failed and not-yet-captured workflows.","acceptance":"Use published collector facts, not missing result cards. Preserve decision, attempt, capture and cutoff as distinct clocks.","from":"workflow-value-collections","time":{"range":"all"},"joins":[{"source":"value-latest-capture","type":"left","on":[{"left":"workflow-route","right":"workflow-route"}],"fields":[{"field":"observed-at","as":"captured-at"},{"field":"window-end","as":"evidence-cutoff"}]}],"compute":[{"as":"workflow-context","function":"concat","args":[{"field":"workflow"},{"value":" · "},{"field":"organization"},{"value":"/"},{"field":"repository"}]},{"as":"capture-missing","function":"equals-any","args":[{"field":"captured-at"},{"value":null}]},{"as":"evidence-state","function":"if","args":[{"field":"capture-missing"},{"value":"No retained capture"},{"value":"Retained evidence available"}]}],"order-by":[{"field":"organization","direction":"asc"},{"field":"repository","direction":"asc"},{"field":"workflow","direction":"asc"}]},{"name":"value-snapshots","subject":"Independent repository-state observations and exact item drill-downs.","objective":"Keep everyone's changes separate from workflow-linked delivery.","acceptance":"Retain observed native values, dates and immutable references. Do not invent intermediate observations.","from":"value-evidence-facts","filter":{"predicates":[{"field":"fact-kind","equals":"snapshot"}]},"compute":[{"as":"snapshot-marker","function":"literal","args":[{"value":1}]},{"as":"encoded-snapshot","function":"url-encode","args":[{"field":"snapshot-route"}]},{"as":"snapshot-href","function":"concat","args":[{"value":"#page-value-snapshot?snapshot="},{"field":"encoded-snapshot"}]}],"order-by":[{"field":"at","direction":"asc"},{"field":"fact-id","direction":"asc"}]},{"name":"value-first-snapshot-order","subject":"First independently observed repository state.","objective":"Name the actual first-snapshot reference rather than an invented baseline.","acceptance":"Strictly use retained snapshot time. A post-adoption snapshot is not a pre-adoption baseline.","from":"value-snapshots","window":[{"operation":"change","field":"snapshot-marker","as":"earlier-snapshot","mode":"absolute","groupby":["report-id","workflow-route"],"order-by":[{"field":"at","direction":"asc"}]}]},{"name":"value-first-snapshot","subject":"First retained snapshot per report.","objective":"Provide the explicit reference value and date.","acceptance":"No retained reference means no comparison.","from":"value-first-snapshot-order","filter":{"predicates":[{"field":"earlier-snapshot","equals":"unknown"}]}},{"name":"value-last-snapshot-order","subject":"Latest independently observed repository state.","objective":"Show the actual last measurement rather than an extrapolation.","acceptance":"Preserve the latest retained snapshot even if unchanged.","from":"value-snapshots","window":[{"operation":"change","field":"snapshot-marker","as":"later-snapshot","mode":"absolute","groupby":["report-id","workflow-route"],"order-by":[{"field":"at","direction":"desc"}]}]},{"name":"value-last-snapshot","subject":"Last retained snapshot per report.","objective":"Provide the current native observation.","acceptance":"One snapshot establishes state, not movement.","from":"value-last-snapshot-order","filter":{"predicates":[{"field":"later-snapshot","equals":"unknown"}]}},{"name":"value-output-counts","subject":"Retained safe outputs and applied creation receipts.","objective":"Describe output activity without treating it as accepted value.","acceptance":"Count distinct validated output facts. Tracking corroboration is not an applied receipt.","from":"value-evidence-facts","filter":{"predicates":[{"field":"fact-kind","equals":"output"}]},"aggregate":{"by":["report-id","workflow-route"],"values":[{"field":"fact-id","as":"retained-outputs","reducer":"count"},{"field":"fact-id","as":"receipt-outputs","reducer":"count","filter":{"predicates":[{"field":"origin","equals":"receipt-verified"}]}}]}},{"name":"value-implementation-counts","subject":"Distinct accepted implementations and their measured native effects.","objective":"Count each accepted implementation once, including zero and negative effects.","acceptance":"Validated implementation identities are unique; many-to-many output edges must not multiply value. Complete coverage is checked separately.","from":"value-evidence-facts","filter":{"predicates":[{"field":"fact-kind","equals":"implementation"}]},"compute":[{"as":"accepted-ms","function":"timestamp","args":[{"field":"at"}]},{"as":"cutoff-ms","function":"timestamp","args":[{"field":"window-end"}]},{"as":"current-start","function":"difference","args":[{"field":"cutoff-ms"},{"value":2419200000}]},{"as":"previous-start","function":"difference","args":[{"field":"cutoff-ms"},{"value":4838400000}]},{"as":"before-current","function":"greater-than","args":[{"field":"current-start"},{"field":"accepted-ms"}]},{"as":"before-previous","function":"greater-than","args":[{"field":"previous-start"},{"field":"accepted-ms"}]},{"as":"current-effect","function":"if","args":[{"field":"before-current"},{"value":0},{"field":"value"}]},{"as":"previous-candidate","function":"if","args":[{"field":"before-previous"},{"value":0},{"field":"value"}]},{"as":"previous-effect","function":"if","args":[{"field":"before-current"},{"field":"previous-candidate"},{"value":0}]}],"aggregate":{"by":["report-id","workflow-route"],"values":[{"field":"fact-id","as":"accepted-implementations","reducer":"count"},{"field":"value","as":"known-result","reducer":"sum"},{"field":"current-effect","as":"known-recent","reducer":"sum"},{"field":"previous-effect","as":"known-previous","reducer":"sum"}]}},{"name":"value-covered-durations","subject":"Explicit complete evidence durations in the report and adjacent 28-day delivery periods.","objective":"Distinguish known zero from gaps or incomplete evidence.","acceptance":"The producer validates non-overlapping bounded coverage. Count only complete intervals, clipped to each exact half-open period.","from":"value-evidence-facts","filter":{"predicates":[{"field":"fact-kind","equals":"coverage"},{"field":"coverage-status","equals":"complete"}]},"compute":[{"as":"left-ms","function":"timestamp","args":[{"field":"at"}]},{"as":"right-ms","function":"timestamp","args":[{"field":"end-at"}]},{"as":"cutoff-ms","function":"timestamp","args":[{"field":"window-end"}]},{"as":"current-start","function":"difference","args":[{"field":"cutoff-ms"},{"value":2419200000}]},{"as":"previous-start","function":"difference","args":[{"field":"cutoff-ms"},{"value":4838400000}]},{"as":"after-current","function":"greater-than","args":[{"field":"left-ms"},{"field":"current-start"}]},{"as":"after-previous","function":"greater-than","args":[{"field":"left-ms"},{"field":"previous-start"}]},{"as":"before-current-end","function":"greater-than","args":[{"field":"current-start"},{"field":"right-ms"}]},{"as":"current-left","function":"if","args":[{"field":"after-current"},{"field":"left-ms"},{"field":"current-start"}]},{"as":"previous-left","function":"if","args":[{"field":"after-previous"},{"field":"left-ms"},{"field":"previous-start"}]},{"as":"previous-right","function":"if","args":[{"field":"before-current-end"},{"field":"right-ms"},{"field":"current-start"}]},{"as":"duration","function":"difference","args":[{"field":"right-ms"},{"field":"left-ms"}]},{"as":"current-duration","function":"difference","args":[{"field":"right-ms"},{"field":"current-left"}]},{"as":"previous-duration","function":"difference","args":[{"field":"previous-right"},{"field":"previous-left"}]},{"as":"positive-current","function":"greater-than","args":[{"field":"current-duration"},{"value":0}]},{"as":"positive-previous","function":"greater-than","args":[{"field":"previous-duration"},{"value":0}]},{"as":"covered-current","function":"if","args":[{"field":"positive-current"},{"field":"current-duration"},{"value":0}]},{"as":"covered-previous","function":"if","args":[{"field":"positive-previous"},{"field":"previous-duration"},{"value":0}]}],"aggregate":{"by":["report-id","workflow-route"],"values":[{"field":"duration","as":"covered-duration","reducer":"sum"},{"field":"covered-current","as":"covered-current","reducer":"sum"},{"field":"covered-previous","as":"covered-previous","reducer":"sum"}]}},{"name":"value-report-delivery","subject":"Evidence-qualified output and accepted-contribution totals.","objective":"Keep populations and native units separate without an implied conversion rate.","acceptance":"Absent output context is unknown. Missing coverage withholds complete totals and recent zero, retaining labelled known subtotals.","from":"value-contracts","joins":[{"source":"value-output-counts","type":"left","on":[{"left":"report-id","right":"report-id"},{"left":"workflow-route","right":"workflow-route"}],"fields":[{"field":"retained-outputs","as":"retained-outputs"},{"field":"receipt-outputs","as":"retained-receipts"}]},{"source":"value-implementation-counts","type":"left","on":[{"left":"report-id","right":"report-id"},{"left":"workflow-route","right":"workflow-route"}],"fields":[{"field":"accepted-implementations","as":"retained-implementations"},{"field":"known-result","as":"known-result"},{"field":"known-recent","as":"known-recent"},{"field":"known-previous","as":"known-previous"}]},{"source":"value-covered-durations","type":"left","on":[{"left":"report-id","right":"report-id"},{"left":"workflow-route","right":"workflow-route"}],"fields":[{"field":"covered-duration","as":"covered-duration"},{"field":"covered-current","as":"covered-current"},{"field":"covered-previous","as":"covered-previous"}]}],"compute":[{"as":"start-ms","function":"timestamp","args":[{"field":"window-start"}]},{"as":"end-ms","function":"timestamp","args":[{"field":"window-end"}]},{"as":"report-duration","function":"difference","args":[{"field":"end-ms"},{"field":"start-ms"}]},{"as":"complete-report","function":"equals-any","args":[{"field":"covered-duration"},{"field":"report-duration"}]},{"as":"complete-current","function":"equals-any","args":[{"field":"covered-current"},{"value":2419200000}]},{"as":"complete-previous","function":"equals-any","args":[{"field":"covered-previous"},{"value":2419200000}]},{"as":"show-workflow-trail","function":"equals-any","args":[{"field":"measurement-basis"},{"value":"workflow-contribution"}]},{"as":"known-output-count","function":"coalesce","args":[{"field":"retained-outputs"},{"value":0}]},{"as":"known-receipt-count","function":"coalesce","args":[{"field":"retained-receipts"},{"value":0}]},{"as":"receipt-outputs","function":"if","args":[{"field":"outputs-available"},{"field":"known-receipt-count"},{"value":null}]},{"as":"accepted-implementations","function":"coalesce","args":[{"field":"retained-implementations"},{"value":0}]},{"as":"output-count","function":"if","args":[{"field":"outputs-available"},{"field":"known-output-count"},{"value":null}]},{"as":"native-result","function":"coalesce","args":[{"field":"known-result"},{"value":0}]},{"as":"current-subtotal","function":"coalesce","args":[{"field":"known-recent"},{"value":0}]},{"as":"previous-subtotal","function":"coalesce","args":[{"field":"known-previous"},{"value":0}]},{"as":"recent-result","function":"if","args":[{"field":"complete-current"},{"field":"current-subtotal"},{"value":null}]},{"as":"previous-result","function":"if","args":[{"field":"complete-previous"},{"field":"previous-subtotal"},{"value":null}]}]},{"name":"value-report-summary","subject":"Shared native card and report comparison against the first retained snapshot.","objective":"Show signed repository-wide movement, the goal direction and the exact comparison dates.","acceptance":"This first/last snapshot comparison is not the adjacent-period alert policy, a pre-adoption baseline or causal workflow credit. One snapshot is not zero change.","from":"value-report-delivery","joins":[{"source":"value-first-snapshot","type":"left","on":[{"left":"report-id","right":"report-id"},{"left":"workflow-route","right":"workflow-route"}],"fields":[{"field":"value","as":"reference-value"},{"field":"at","as":"reference-at"}]},{"source":"value-last-snapshot","type":"left","on":[{"left":"report-id","right":"report-id"},{"left":"workflow-route","right":"workflow-route"}],"fields":[{"field":"value","as":"current-value"},{"field":"at","as":"current-at"},{"field":"snapshot-href","as":"current-snapshot-href"}]}],"compute":[{"as":"same-snapshot","function":"equals-any","args":[{"field":"reference-at"},{"field":"current-at"}]},{"as":"raw-change","function":"difference","args":[{"field":"current-value"},{"field":"reference-value"}]},{"as":"native-change","function":"if","args":[{"field":"same-snapshot"},{"value":null},{"field":"raw-change"}]},{"as":"change-missing","function":"equals-any","args":[{"field":"native-change"},{"value":null}]},{"as":"rising","function":"greater-than","args":[{"field":"native-change"},{"value":0}]},{"as":"falling","function":"greater-than","args":[{"value":0},{"field":"native-change"}]},{"as":"unchanged","function":"equals-any","args":[{"field":"native-change"},{"value":0}]},{"as":"decrease-goal","function":"equals-any","args":[{"field":"snapshot-direction"},{"value":"decrease"}]},{"as":"increase-goal","function":"equals-any","args":[{"field":"snapshot-direction"},{"value":"increase"}]},{"as":"increase-movement","function":"if","args":[{"field":"rising"},{"value":"Better"},{"value":"Worse"}]},{"as":"decrease-movement","function":"if","args":[{"field":"falling"},{"value":"Better"},{"value":"Worse"}]},{"as":"directed-movement","function":"if","args":[{"field":"decrease-goal"},{"field":"decrease-movement"},{"field":"increase-movement"}]},{"as":"known-movement","function":"if","args":[{"field":"unchanged"},{"value":"Unchanged"},{"field":"directed-movement"}]},{"as":"movement","function":"if","args":[{"field":"change-missing"},{"value":"Comparison unavailable"},{"field":"known-movement"}]},{"as":"increase-direction-label","function":"if","args":[{"field":"increase-goal"},{"value":"↑ Higher is better"},{"value":"Direction not retained"}]},{"as":"direction-label","function":"if","args":[{"field":"decrease-goal"},{"value":"↓ Lower is better"},{"field":"increase-direction-label"}]},{"as":"change-arrow","function":"if","args":[{"field":"rising"},{"value":"↑ +"},{"value":"↓ "}]},{"as":"change-number","function":"format-count","args":[{"field":"native-change"}]},{"as":"directional-delta","function":"concat","args":[{"field":"change-arrow"},{"field":"change-number"},{"value":" "},{"field":"snapshot-unit"}]},{"as":"known-delta","function":"if","args":[{"field":"unchanged"},{"value":"Unchanged"},{"field":"directional-delta"}]},{"as":"delta-label","function":"if","args":[{"field":"change-missing"},{"value":"Comparison unavailable"},{"field":"known-delta"}]},{"as":"signed-change","function":"concat","args":[{"field":"change-arrow"},{"field":"change-number"},{"value":" "},{"field":"snapshot-unit"},{"value":" · "},{"field":"movement"}]},{"as":"unchanged-change","function":"if","args":[{"field":"unchanged"},{"value":"Unchanged"},{"field":"signed-change"}]},{"as":"change-label","function":"if","args":[{"field":"change-missing"},{"value":"Comparison unavailable"},{"field":"unchanged-change"}]},{"as":"reference-day","function":"date-day","args":[{"field":"reference-at"}]},{"as":"known-comparison-label","function":"concat","args":[{"value":"Since "},{"field":"reference-day"},{"value":" · Everyone's work"}]},{"as":"comparison-label","function":"if","args":[{"field":"change-missing"},{"value":"No earlier snapshot for comparison"},{"field":"known-comparison-label"}]},{"as":"workflow-label","function":"coalesce","args":[{"field":"workflow-name"},{"field":"workflow"}]},{"as":"workflow-context","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"},{"value":" · "},{"field":"workflow-label"}]},{"as":"encoded-workflow","function":"url-encode","args":[{"field":"workflow-route"}]},{"as":"workflow-value-href","function":"concat","args":[{"value":"#page-workflow-value?workflow="},{"field":"encoded-workflow"}]},{"as":"encoded-report","function":"url-encode","args":[{"field":"report-id"}]},{"as":"report-href","function":"concat","args":[{"value":"#page-value-report?report="},{"field":"encoded-report"}]}]},{"name":"value-workflow-result-order","subject":"Version ordering after independently computing each report.","objective":"Keep exact report queries partition-local without changing latest-version selection.","acceptance":"Rank cutoffs then captures within each workflow and measure. Explicit report links do not need other report facts.","from":"value-report-summary","window":[{"operation":"change","field":"report-marker","as":"older-report","mode":"absolute","groupby":["organization","repository","workflow","workflow-route","metric-id"],"order-by":[{"field":"window-end","direction":"desc"},{"field":"observed-at","direction":"desc"},{"field":"report-id","direction":"desc"}]}]},{"name":"value-workflow-results","subject":"Current published report results per native measure.","objective":"Expose the latest coherent packet on the workflow Value tab.","acceptance":"Never replace missing facts with an older measured version. Explicit report links retain their own version.","from":"value-workflow-result-order","filter":{"predicates":[{"field":"older-report","equals":"unknown"}]}},{"name":"value-workflow-headline-order","subject":"Most recent current report across the measures of each workflow.","objective":"Give each workflow and repository one headline result; other measures stay on the workflow page.","acceptance":"Select by cutoff then capture. Never replace a missing result with an older or zero value.","from":"value-workflow-results","window":[{"operation":"change","field":"report-marker","as":"older-headline","mode":"absolute","groupby":["workflow-route"],"order-by":[{"field":"window-end","direction":"desc"},{"field":"observed-at","direction":"desc"},{"field":"report-id","direction":"desc"}]}]},{"name":"value-workflow-headlines","subject":"One headline result per workflow and repository.","objective":"Join cleanly to collection health without multiplying rows.","acceptance":"Exactly one row per workflow route.","from":"value-workflow-headline-order","filter":{"predicates":[{"field":"older-headline","equals":"unknown"}]}},{"name":"value-native-headline-order","subject":"Most recent primary native measurement for each repository and workflow.","objective":"Let ordinary batch Value functions participate in the universal Value inventory without requiring a rich report packet.","acceptance":"Select by evidence cutoff then assessment time. A newer unavailable assessment remains current and must not reveal an older numeric value.","from":"value-current-measurements","compute":[{"as":"headline-marker","function":"literal","args":[{"value":1}]}],"window":[{"operation":"change","field":"headline-marker","as":"older-native-headline","mode":"absolute","groupby":["workflow-route"],"order-by":[{"field":"window-end","direction":"desc"},{"field":"observed-at","direction":"desc"},{"field":"value-id","direction":"asc"}]}]},{"name":"value-native-headlines","subject":"One current primary native measurement per repository and workflow.","objective":"Supply a bounded workflow headline when no richer evidence report exists.","acceptance":"Keep missing value, coverage, maturity, native unit and campaign context unchanged.","from":"value-native-headline-order","filter":{"predicates":[{"field":"older-native-headline","equals":"unknown"}]}},{"name":"value-rich-headline-overview","subject":"Rich evidence report headlines normalized for universal Value subject selection.","objective":"Reuse the existing repository movement result without changing its evidence identity or comparison.","acceptance":"Retain the report route and first-to-last native movement; campaign context remains unknown unless another canonical source supplies it.","from":"value-workflow-headlines","compute":[{"as":"repository-coordinate","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"}]},{"as":"headline-campaign","function":"literal","args":[{"value":null}]},{"as":"headline-evidence","function":"literal","args":[{"value":"Rich evidence retained"}]},{"as":"headline-priority","function":"literal","args":[{"value":2}]},{"as":"headline-marker","function":"literal","args":[{"value":1}]}],"select":[{"field":"report-id","as":"headline-id"},{"field":"workflow-route"},{"field":"repository-coordinate"},{"field":"workflow-label"},{"field":"headline-campaign"},{"field":"observed-at","as":"headline-captured"},{"field":"window-end","as":"headline-cutoff"},{"field":"change-label","as":"headline-trend-label"},{"field":"movement","as":"headline-trend-movement"},{"field":"snapshot-name","as":"headline-trend-measure"},{"field":"headline-evidence"},{"field":"report-href","as":"headline-href"},{"field":"headline-priority"},{"field":"headline-marker"}]},{"name":"value-native-headline-overview","subject":"Native batch measurements normalized for universal Value subject selection.","objective":"Expose the current native result while keeping comparison unavailable unless a reviewed comparison exists.","acceptance":"A numeric measurement is not a trend or causal result. Missing remains unavailable and routes to workflow detail.","from":"value-native-headlines","compute":[{"as":"workflow-label","function":"coalesce","args":[{"field":"workflow-name"},{"field":"workflow-slug"}]},{"as":"headline-trend-movement","function":"if","args":[{"field":"measurement-missing"},{"value":"Measurement unavailable"},{"value":"Native value retained"}]},{"as":"headline-evidence","function":"if","args":[{"field":"measurement-missing"},{"value":"Latest assessment unavailable"},{"value":"Native measurement retained"}]},{"as":"encoded-workflow","function":"url-encode","args":[{"field":"workflow-route"}]},{"as":"headline-href","function":"concat","args":[{"value":"#page-workflow-value?workflow="},{"field":"encoded-workflow"}]},{"as":"headline-priority","function":"literal","args":[{"value":1}]}],"select":[{"field":"id","as":"headline-id"},{"field":"workflow-route"},{"field":"repository","as":"repository-coordinate"},{"field":"workflow-label"},{"field":"campaign","as":"headline-campaign"},{"field":"observed-at","as":"headline-captured"},{"field":"window-end","as":"headline-cutoff"},{"field":"measurement-label","as":"headline-trend-label"},{"field":"headline-trend-movement"},{"field":"metric-name","as":"headline-trend-measure"},{"field":"headline-evidence"},{"field":"headline-href"},{"field":"headline-priority"},{"field":"headline-marker"}]},{"name":"value-headline-candidates","subject":"Rich and native headline candidates for one exact repository and workflow deployment.","objective":"Choose one current drill target without combining unlike measurements.","acceptance":"Order by evidence cutoff and capture before preferring richer presentation. Never aggregate headline values.","from":"value-rich-headline-overview","union":["value-native-headline-overview"]},{"name":"value-headline-order","subject":"Current headline ordering for each exact repository and workflow deployment.","objective":"Prefer the newest evidence, then a rich evidence route when timestamps are equal.","acceptance":"A newer unavailable native assessment remains current. Rich presentation priority cannot cross an evidence-time gap.","from":"value-headline-candidates","window":[{"operation":"change","field":"headline-marker","as":"older-headline-candidate","mode":"absolute","groupby":["workflow-route"],"order-by":[{"field":"headline-cutoff","direction":"desc"},{"field":"headline-captured","direction":"desc"},{"field":"headline-priority","direction":"desc"},{"field":"headline-id","direction":"asc"}]}]},{"name":"value-headlines","subject":"One current Value headline per exact repository and workflow deployment.","objective":"Join current evidence to collection health and workflow topology without multiplying subjects.","acceptance":"Exactly one row per workflow route, with no cross-metric aggregation.","from":"value-headline-order","filter":{"predicates":[{"field":"older-headline-candidate","equals":"unknown"}]}},{"name":"value-workflow-topology","subject":"Canonical workflow deployment topology for Value grouping.","objective":"Classify exact workflow identities as campaign workers, orchestrators or standalone workflows without copying topology into evidence.","acceptance":"Campaign and role come only from canonical workflow inventory. The inventory identity is the paged subject grain.","from":"workflow-subject-topology","compute":[{"as":"repository-coordinate","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"}]},{"as":"workflow-route","function":"concat","args":[{"field":"repository-coordinate"},{"value":":"},{"field":"workflow"}]},{"as":"workflow-label","function":"coalesce","args":[{"field":"workflow-name"},{"field":"workflow"}]}],"select":[{"field":"repositoryId"},{"field":"path"},{"field":"id"},{"field":"workflow-route"},{"field":"repository-coordinate"},{"field":"workflow-label"},{"field":"workflow-label","as":"declared-workflow-label"},{"field":"workflow-role","as":"declared-workflow-role"},{"field":"campaign","as":"declared-campaign"},{"field":"campaign-name","as":"declared-campaign-name"},{"field":"campaign-icon","as":"declared-campaign-icon"}],"order-by":[{"field":"repositoryId","direction":"asc"},{"field":"path","direction":"asc"},{"field":"id","direction":"asc"}]},{"name":"value-workflow-overview","subject":"One universal row per repository and workflow deployment with topology, collection health and current Value evidence.","objective":"Compare campaign and standalone Value subjects through one honest card contract.","acceptance":"Every canonical workflow remains visible. Missing health is unknown and missing evidence is unavailable; neither becomes zero or inferred success.","from":"value-workflow-topology","joins":[{"source":"value-collection-health","type":"left","on":[{"left":"workflow-route","right":"workflow-route"}],"fields":[{"field":"registration","as":"collection-registration"},{"field":"collection-state","as":"collection-state"},{"field":"reason","as":"collection-reason"},{"field":"evidence-state","as":"health-evidence-state"},{"field":"captured-at","as":"health-captured"},{"field":"evidence-cutoff","as":"health-cutoff"}]},{"source":"value-headlines","type":"left","on":[{"left":"workflow-route","right":"workflow-route"}],"fields":[{"field":"headline-id","as":"headline-id"},{"field":"workflow-label","as":"headline-workflow-label"},{"field":"headline-campaign","as":"headline-campaign"},{"field":"headline-captured","as":"headline-captured"},{"field":"headline-cutoff","as":"headline-cutoff"},{"field":"headline-trend-label","as":"headline-trend-label"},{"field":"headline-trend-movement","as":"headline-trend-movement"},{"field":"headline-trend-measure","as":"headline-trend-measure"},{"field":"headline-evidence","as":"headline-evidence"},{"field":"headline-href","as":"headline-href"}]}],"compute":[{"as":"preferred-workflow-label","function":"coalesce","args":[{"field":"declared-workflow-label"},{"field":"headline-workflow-label"}]},{"as":"overview-workflow-label","function":"coalesce","args":[{"field":"preferred-workflow-label"},{"field":"workflow-label"}]},{"as":"overview-title","function":"concat","args":[{"field":"repository-coordinate"},{"value":" · "},{"field":"overview-workflow-label"}]},{"as":"registration","function":"coalesce","args":[{"field":"collection-registration"},{"value":"unknown"}]},{"as":"overview-state","function":"coalesce","args":[{"field":"collection-state"},{"value":"unknown"}]},{"as":"overview-reason","function":"coalesce","args":[{"field":"collection-reason"},{"value":"Collection status unavailable"}]},{"as":"overview-captured","function":"coalesce","args":[{"field":"headline-captured"},{"field":"health-captured"}]},{"as":"overview-cutoff","function":"coalesce","args":[{"field":"headline-cutoff"},{"field":"health-cutoff"}]},{"as":"headline-missing","function":"equals-any","args":[{"field":"headline-id"},{"value":null}]},{"as":"missing-evidence-label","function":"coalesce","args":[{"field":"health-evidence-state"},{"value":"No retained result"}]},{"as":"overview-evidence","function":"if","args":[{"field":"headline-missing"},{"field":"missing-evidence-label"},{"field":"headline-evidence"}]},{"as":"trend-label","function":"if","args":[{"field":"headline-missing"},{"value":"No retained result"},{"field":"headline-trend-label"}]},{"as":"trend-movement","function":"if","args":[{"field":"headline-missing"},{"value":"No result to compare"},{"field":"headline-trend-movement"}]},{"as":"trend-measure","function":"if","args":[{"field":"headline-missing"},{"value":"Not available"},{"field":"headline-trend-measure"}]},{"as":"encoded-workflow","function":"url-encode","args":[{"field":"workflow-route"}]},{"as":"workflow-href","function":"concat","args":[{"value":"#page-workflow-value?workflow="},{"field":"encoded-workflow"}]},{"as":"overview-href","function":"if","args":[{"field":"headline-missing"},{"field":"workflow-href"},{"field":"headline-href"}]},{"as":"workflow-role","function":"coalesce","args":[{"field":"declared-workflow-role"},{"value":"unknown"}]},{"as":"campaign","function":"coalesce","args":[{"field":"declared-campaign"},{"field":"headline-campaign"}]},{"as":"campaign-name","function":"coalesce","args":[{"field":"declared-campaign-name"},{"field":"campaign"}]},{"as":"campaign-icon","function":"coalesce","args":[{"field":"declared-campaign-icon"},{"value":"goal"}]},{"as":"standalone-workflow","function":"equals-any","args":[{"field":"workflow-role"},{"value":"standalone"}]},{"as":"campaign-missing","function":"equals-any","args":[{"field":"campaign"},{"value":null}]},{"as":"campaign-scope","function":"if","args":[{"field":"campaign-missing"},{"value":"Unclassified"},{"value":"Campaign"}]},{"as":"value-scope","function":"if","args":[{"field":"standalone-workflow"},{"value":"Standalone"},{"field":"campaign-scope"}]},{"as":"configured-registration","function":"equals-any","args":[{"field":"registration"},{"value":"enabled"},{"value":"disabled"}]},{"as":"configured-value","function":"if","args":[{"field":"configured-registration"},{"value":1},{"value":0}]},{"as":"unconfigured-state","function":"equals-any","args":[{"field":"overview-state"},{"value":"unconfigured"}]},{"as":"unconfigured-value","function":"if","args":[{"field":"unconfigured-state"},{"value":1},{"value":0}]},{"as":"deferred-state","function":"equals-any","args":[{"field":"overview-state"},{"value":"deferred"}]},{"as":"deferred-value","function":"if","args":[{"field":"deferred-state"},{"value":1},{"value":0}]},{"as":"failed-state","function":"equals-any","args":[{"field":"overview-state"},{"value":"failed"}]},{"as":"failed-value","function":"if","args":[{"field":"failed-state"},{"value":1},{"value":0}]},{"as":"current-evidence-value","function":"if","args":[{"field":"headline-missing"},{"value":0},{"value":1}]},{"as":"worse-movement","function":"equals-any","args":[{"field":"trend-movement"},{"value":"Worse"}]},{"as":"attention-state","function":"equals-any","args":[{"field":"overview-state"},{"value":"unconfigured"},{"value":"deferred"},{"value":"failed"}]},{"as":"state-or-missing-review","function":"if","args":[{"field":"attention-state"},{"value":true},{"field":"headline-missing"}]},{"as":"needs-review","function":"if","args":[{"field":"worse-movement"},{"value":true},{"field":"state-or-missing-review"}]},{"as":"missing-attention-reason","function":"if","args":[{"field":"headline-missing"},{"value":"No retained Value result"},{"value":"No review triggered"}]},{"as":"state-attention-reason","function":"if","args":[{"field":"attention-state"},{"field":"overview-reason"},{"field":"missing-attention-reason"}]},{"as":"attention-reason","function":"if","args":[{"field":"worse-movement"},{"value":"Measured outcome worsened"},{"field":"state-attention-reason"}]},{"as":"review-value","function":"if","args":[{"field":"needs-review"},{"value":1},{"value":0}]}],"order-by":[{"field":"overview-title","direction":"asc"}]},{"name":"value-campaign-complete-topology","subject":"Complete canonical campaign workflow topology.","objective":"Provide unpaged workflow routes for complete campaign coverage aggregation.","acceptance":"Every canonical workflow remains at its exact repository and workflow identity.","from":"workflows","compute":[{"as":"repository-coordinate","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"}]},{"as":"workflow-route","function":"concat","args":[{"field":"repository-coordinate"},{"value":":"},{"field":"workflow"}]},{"as":"campaign-missing","function":"equals-any","args":[{"field":"campaign"},{"value":null}]}]},{"name":"value-campaign-complete-deployments","subject":"Complete canonical campaign workflow deployment population with collection and current evidence state.","objective":"Keep campaign coverage aggregates complete while workflow card lists use request-scoped subject pages.","acceptance":"Every declared campaign workflow is included once. Missing health or evidence remains explicit and no paged cohort is used.","from":"value-campaign-complete-topology","joins":[{"source":"value-collection-health","type":"left","on":[{"left":"workflow-route","right":"workflow-route"}],"fields":[{"field":"registration","as":"collection-registration"},{"field":"collection-state","as":"collection-state"}]},{"source":"value-headlines","type":"left","on":[{"left":"workflow-route","right":"workflow-route"}],"fields":[{"field":"headline-id","as":"headline-id"},{"field":"headline-trend-movement","as":"headline-trend-movement"}]}],"compute":[{"as":"registration","function":"coalesce","args":[{"field":"collection-registration"},{"value":"unknown"}]},{"as":"overview-state","function":"coalesce","args":[{"field":"collection-state"},{"value":"unknown"}]},{"as":"headline-missing","function":"equals-any","args":[{"field":"headline-id"},{"value":null}]},{"as":"configured-registration","function":"equals-any","args":[{"field":"registration"},{"value":"enabled"},{"value":"disabled"}]},{"as":"configured-value","function":"if","args":[{"field":"configured-registration"},{"value":1},{"value":0}]},{"as":"unconfigured-state","function":"equals-any","args":[{"field":"overview-state"},{"value":"unconfigured"}]},{"as":"unconfigured-value","function":"if","args":[{"field":"unconfigured-state"},{"value":1},{"value":0}]},{"as":"deferred-state","function":"equals-any","args":[{"field":"overview-state"},{"value":"deferred"}]},{"as":"deferred-value","function":"if","args":[{"field":"deferred-state"},{"value":1},{"value":0}]},{"as":"failed-state","function":"equals-any","args":[{"field":"overview-state"},{"value":"failed"}]},{"as":"failed-value","function":"if","args":[{"field":"failed-state"},{"value":1},{"value":0}]},{"as":"current-evidence-value","function":"if","args":[{"field":"headline-missing"},{"value":0},{"value":1}]},{"as":"worse-movement","function":"equals-any","args":[{"field":"headline-trend-movement"},{"value":"Worse"}]},{"as":"attention-state","function":"equals-any","args":[{"field":"overview-state"},{"value":"unconfigured"},{"value":"deferred"},{"value":"failed"}]},{"as":"state-or-missing-review","function":"if","args":[{"field":"attention-state"},{"value":true},{"field":"headline-missing"}]},{"as":"needs-review","function":"if","args":[{"field":"worse-movement"},{"value":true},{"field":"state-or-missing-review"}]},{"as":"review-value","function":"if","args":[{"field":"needs-review"},{"value":1},{"value":0}]}],"filter":{"predicates":[{"field":"campaign-missing","equals":false}]},"select":[{"field":"workflow-route"},{"field":"repository-coordinate"},{"field":"campaign"},{"field":"campaign-name"},{"field":"campaign-icon"},{"field":"configured-value"},{"field":"current-evidence-value"},{"field":"unconfigured-value"},{"field":"deferred-value"},{"field":"failed-value"},{"field":"review-value"}]},{"name":"value-campaign-coverage-deployments","subject":"Universal Value deployments grouped under a declared campaign.","objective":"Support complete campaign coverage without creating a separate evidence system.","acceptance":"Only rows with canonical campaign context are included. Unclassified deployments remain visible in All and Needs review.","from":"value-campaign-complete-deployments"},{"name":"value-campaign-totals","subject":"Campaign Value coverage and attention summary over exact workflow deployments.","objective":"Aggregate campaign coverage and attention counts before presentation fields are derived.","acceptance":"Counts describe deployment coverage and attention only. They do not average native outcomes or create a campaign score.","from":"value-campaign-coverage-deployments","aggregate":{"by":["campaign","campaign-name","campaign-icon"],"values":[{"field":"workflow-route","as":"value-deployments","reducer":"count"},{"field":"repository-coordinate","as":"value-repositories","reducer":"distinct-count"},{"field":"configured-value","as":"configured-deployments","reducer":"sum"},{"field":"current-evidence-value","as":"current-evidence-deployments","reducer":"sum"},{"field":"unconfigured-value","as":"unconfigured-deployments","reducer":"sum"},{"field":"deferred-value","as":"deferred-deployments","reducer":"sum"},{"field":"failed-value","as":"failed-deployments","reducer":"sum"},{"field":"review-value","as":"review-deployments","reducer":"sum"}]}},{"name":"value-campaign-overview","subject":"Campaign Value coverage and attention presentation.","objective":"Find campaigns requiring evidence or outcome review before drilling into their workers.","acceptance":"Presentation fields derive only from bounded campaign deployment counts. No native outcome values are combined.","from":"value-campaign-totals","compute":[{"as":"review-present","function":"greater-than","args":[{"field":"review-deployments"},{"value":0}]},{"as":"review-count-label","function":"format-count","args":[{"field":"review-deployments"}]},{"as":"review-status-label","function":"concat","args":[{"field":"review-count-label"},{"value":" need review"}]},{"as":"campaign-value-status","function":"if","args":[{"field":"review-present"},{"field":"review-status-label"},{"value":"No review triggered"}]},{"as":"encoded-campaign","function":"url-encode","args":[{"field":"campaign"}]},{"as":"campaign-value-href","function":"concat","args":[{"value":"#page-campaign-value?campaign="},{"field":"encoded-campaign"}]}],"order-by":[{"field":"review-deployments","direction":"desc"},{"field":"campaign-name","direction":"asc"}]},{"name":"value-campaign-deployments","subject":"Paged exact Value deployments for one declared campaign.","objective":"Support campaign workflow drilldown through the bounded universal workflow card path.","acceptance":"Only rows with canonical campaign context are included. Every row preserves its exact collection and evidence state.","from":"value-workflow-overview","filter":{"predicates":[{"field":"value-scope","equals":"Campaign"}]}},{"name":"value-standalone-overview","subject":"Standalone workflow Value deployments.","objective":"Inspect standalone workflows through the same collection, outcome and evidence contract as campaign workers.","acceptance":"Standalone is a canonical workflow role, not inferred from missing campaign evidence.","from":"value-workflow-overview","filter":{"predicates":[{"field":"value-scope","equals":"Standalone"}]}},{"name":"value-review-overview","subject":"Value deployments with measured deterioration or incomplete collection/evidence state.","objective":"Prioritize exact deployments needing outcome or evidence investigation.","acceptance":"Each row preserves its explicit reason. Missing evidence, failed collection and worsening outcome are not interchangeable.","from":"value-workflow-overview","filter":{"predicates":[{"field":"needs-review","equals":true}]},"order-by":[{"field":"attention-reason","direction":"asc"},{"field":"overview-title","direction":"asc"}]},{"name":"value-intent-sources","subject":"Immutable extracted workflow intent sources.","objective":"Let readers inspect the original goal and requirements.","acceptance":"Only retained HTTPS evidence is linked; workflow text remains untrusted.","from":"value-evidence-facts","filter":{"predicates":[{"field":"fact-kind","equals":"intent-source"}]}},{"name":"value-requirements","subject":"Original full acceptance requirements.","objective":"Distinguish the measured structural facet from all workflow safeguards.","acceptance":"Requirements are source text, not proof they passed.","from":"value-evidence-facts","filter":{"predicates":[{"field":"fact-kind","equals":"requirement"}]}},{"name":"value-outputs","subject":"Retained safe-output lifecycle facts.","objective":"Show receipts, current-at-cutoff state and originating evidence.","acceptance":"A closed output is not automatically an accepted implementation; absence of a link is unknown.","from":"value-evidence-facts","filter":{"predicates":[{"field":"fact-kind","equals":"output"}]},"order-by":[{"field":"at","direction":"desc"},{"field":"fact-id","direction":"asc"}]},{"name":"value-output-origin-evidence","subject":"Retained producer and applied safe-output evidence.","objective":"Let readers distinguish receipt-confirmed creation from corroborated tracking.","acceptance":"Tracking identities locate outputs but do not establish accepted value. Keep unavailable producer evidence explicit.","from":"value-evidence-facts","filter":{"predicates":[{"field":"fact-kind","equals":"output-evidence"}]},"joins":[{"source":"value-outputs","type":"inner","on":[{"left":"report-id","right":"report-id"},{"left":"parent-id","right":"fact-id"}],"fields":[{"field":"label","as":"output-label"},{"field":"url","as":"output-url"}]}]},{"name":"value-implementations","subject":"Accepted implementations and native before/after effects.","objective":"Expose delivery time and immutable acceptance evidence.","acceptance":"Do not equate acceptance with full quality verification or omit negative effects.","from":"value-evidence-facts","filter":{"predicates":[{"field":"fact-kind","equals":"implementation"}]},"order-by":[{"field":"at","direction":"desc"},{"field":"fact-id","direction":"asc"}]},{"name":"value-output-trails","subject":"Explicit output-to-implementation edges.","objective":"Make the trail from a proposal to an accepted measured change inspectable.","acceptance":"Use retained dated edges only. Many-to-many links do not duplicate headline counts or values.","from":"value-evidence-facts","filter":{"predicates":[{"field":"fact-kind","equals":"output-implementation"}]},"joins":[{"source":"value-outputs","type":"inner","on":[{"left":"report-id","right":"report-id"},{"left":"parent-id","right":"fact-id"}],"fields":[{"field":"label","as":"output-label"},{"field":"url","as":"output-url"}]},{"source":"value-implementations","type":"inner","on":[{"left":"report-id","right":"report-id"},{"left":"related-id","right":"fact-id"}],"fields":[{"field":"label","as":"implementation-label"},{"field":"url","as":"implementation-url"},{"field":"value","as":"implementation-value"},{"field":"at","as":"trail-accepted-at"}]}]},{"name":"value-implementation-files","subject":"Measured implementation files and retained lineage sources.","objective":"Link to exact Git facts rather than only a repository tree.","acceptance":"No URL is reconstructed from an unrelated revision. Preserve before, after and replacement file evidence.","from":"value-evidence-facts","filter":{"predicates":[{"field":"fact-kind","in":["implementation-evidence","implementation-lineage"]}]},"joins":[{"source":"value-implementations","type":"inner","on":[{"left":"report-id","right":"report-id"},{"left":"parent-id","right":"fact-id"}],"fields":[{"field":"label","as":"implementation-label"},{"field":"url","as":"implementation-url"}]}]},{"name":"value-quality-checks","subject":"Explicit independent verification checks.","objective":"Keep unverified behavior, tests and other safeguards visible.","acceptance":"Missing or not-verified is not a passing check.","from":"value-evidence-facts","filter":{"predicates":[{"field":"fact-kind","equals":"quality-check"}]}},{"name":"value-limitations","subject":"Retained evidence and attribution limitations.","objective":"Qualify claims without inventing completeness.","acceptance":"Treat source limitations as untrusted text and never suppress them.","from":"value-evidence-facts","filter":{"predicates":[{"field":"fact-kind","equals":"limitation"}]}},{"name":"value-snapshot-items","subject":"Actual counted items at an independent immutable snapshot.","objective":"Open exact per-item evidence from the plotted observation.","acceptance":"Only retained items are shown. Missing item evidence must not look like an empty measured population.","from":"value-evidence-facts","filter":{"predicates":[{"field":"fact-kind","equals":"snapshot-item"}]},"joins":[{"source":"value-snapshots","type":"inner","on":[{"left":"report-id","right":"report-id"},{"left":"parent-id","right":"fact-id"},{"left":"snapshot-route","right":"snapshot-route"}],"fields":[{"field":"at","as":"snapshot-at"}]}]},{"name":"campaign-navigation-availability","subject":"Detect available campaign inventory for dashboard navigation.","objective":"Enable Campaigns only when collected campaign information is present.","acceptance":"Return at most one canonical campaign identity; missing or empty inventory does not enable Campaigns, and partial inventory does not imply complete campaign coverage.","from":"campaigns","select":[{"field":"campaign"}],"limit":1},{"name":"audit-event-summary-buckets","subject":"Aggregate high- and medium-severity audit events with the same severity and summary by workflow.","objective":"Select recurring high- or medium-severity audit summaries for run-level investigation.","acceptance":"Each bucket's event count is traceable to retained audit or tool observations with the same campaign, severity, workflow, and summary; missing workflow attribution stays unknown, and a count alone does not verify impact.","description":"High- and medium-severity audit event counts grouped by severity, workflow, and shared summary.","from":"audits","union":["tools"],"filter":{"predicates":[{"field":"event-type","in":["audit.finding","audit.observability","audit.recommendation","audit.missing_tool","audit.missing_data","audit.noop","audit.mcp_failure","skill.invoked"]},{"field":"event-status","in":["high","medium"]}]},"joins":[{"source":"workflows","type":"left","on":[{"left":"organization","right":"organization"},{"left":"repository","right":"repository"},{"left":"workflow","right":"workflow"}],"fields":[{"field":"campaign","as":"campaign"}]}],"aggregate":{"by":["campaign","event-status","workflow","event-summary"],"values":[{"field":"event","as":"events","reducer":"count"}]},"select":[{"field":"campaign"},{"field":"event-status"},{"field":"workflow"},{"field":"event-summary"},{"field":"events"}],"order-by":[{"field":"event-status","direction":"asc"},{"field":"events","direction":"desc"},{"field":"workflow","direction":"asc"},{"field":"event-summary","direction":"asc"}]},{"name":"campaign-workflows","subject":"List campaign-owned orchestrator and worker workflows with database-backed execution totals.","objective":"Choose an active campaign workflow whose observed execution warrants inspection.","acceptance":"Listed workflows match active declared orchestrator or worker inventory entries; runs and AI Credits agree with the selected-horizon inventory, and absence is not evidence of disabled authority or no executions. Rollout mode is context, not permission to change policy.","description":"Campaign workflows projected from lean canonical inventory, with shared declaration names and active-only workflow drill-down links.","from":"campaign-workflow-inventory","filter":{"predicates":[{"field":"workflow-active","equals":"true"}]},"compute":[{"as":"workflow-identity","function":"concat","args":[{"field":"repository"},{"value":":"},{"field":"workflow"}]},{"as":"encoded-workflow","function":"url-encode","args":[{"field":"workflow-identity"}]},{"as":"workflow-dashboard-href","function":"concat","args":[{"value":"#page-workflow-runtime?workflow="},{"field":"encoded-workflow"}]},{"as":"workflow-dashboard-label","function":"concat","args":[{"value":"View "},{"field":"workflow-display-name"},{"value":" workflow dashboard"}]},{"as":"workflow-dashboard-link","function":"dashboard-link","args":[{"field":"workflow-link"},{"field":"workflow-dashboard-href"},{"field":"workflow-dashboard-label"},{"field":"workflow-identity"}]}],"select":[{"field":"campaign"},{"field":"campaign-display-name","as":"campaign-name"},{"field":"organization"},{"field":"repository"},{"field":"workflow"},{"field":"workflow-display-name","as":"workflow-name"},{"field":"workflow-role"},{"field":"rollout-mode"},{"field":"workflow-active"},{"field":"runs"},{"field":"aic"},{"field":"repository-dashboard-link","as":"repository-link"},{"field":"workflow-dashboard-link","as":"workflow-link"}],"order-by":[{"field":"campaign-name","direction":"asc"},{"field":"workflow-role","direction":"asc"},{"field":"workflow-name","direction":"asc"}]},{"name":"campaign-repository-declarations","subject":"List active declared campaign workflows and their owning repositories without execution evidence.","objective":"Inspect campaign repository topology without computing unused run totals or import coverage.","acceptance":"Preserve active orchestrator and worker identities, display names, rollout context, links, and ordering. Declaration counts are not target enrollment, dispatch coverage, or execution totals. Empty inventory and unavailable workflow evidence remain distinct.","description":"Declaration-only repository topology. Run totals and import-evidence quality belong to execution views, not this inventory.","from":"campaign-workflow-declarations","filter":{"predicates":[{"field":"workflow-active","equals":"true"}]},"select":[{"field":"campaign"},{"field":"campaign-display-name","as":"campaign-name"},{"field":"organization"},{"field":"repository-slug","as":"repository"},{"field":"workflow"},{"field":"workflow-display-name","as":"workflow-name"},{"field":"workflow-role"},{"field":"declared-mode","as":"rollout-mode"},{"field":"workflow-active"},{"field":"repository-dashboard-link","as":"repository-link"}],"order-by":[{"field":"repository","direction":"asc"},{"field":"workflow","direction":"asc"}]},{"name":"campaign-repository-inventory","subject":"Present declared campaign repository topology in workflow display order.","objective":"Filter and search projected repository coordinates and workflow names without time-filtering structural declarations.","acceptance":"Preserve the campaign workflow list's stable ordering and declaration-only evidence quality; runtime horizons must not remove declared workflows.","from":"campaign-repository-declarations","order-by":[{"field":"campaign-name","direction":"asc"},{"field":"workflow-role","direction":"asc"},{"field":"workflow-name","direction":"asc"}]},{"name":"campaign-reports","subject":"Project retained outcomes into campaign-addressable report evidence.","objective":"Identify a campaign report whose durable outcome record needs follow-up.","acceptance":"Each report's campaign, title, source link, observation time, and disposition match its retained outcome; missing status is labeled unknown rather than accepted or resolved, and report production is not verified impact.","description":"Campaign outcome reports with database-backed disposition fields.","from":"outcomes","compute":[{"as":"report-status","function":"coalesce","args":[{"field":"outcome-status"},{"field":"outcome-state"},{"value":"unknown"}]}],"select":[{"field":"campaign"},{"field":"safe-output"},{"field":"outcome-title"},{"field":"outcome-summary"},{"field":"report-status","as":"outcome-status"},{"field":"rollout-mode"},{"field":"engine"},{"field":"engine-version"},{"field":"requested-model"},{"field":"resolved-model"},{"field":"outcome-category"},{"field":"observed-at"},{"field":"external-link"}],"order-by":[{"field":"observed-at","direction":"desc"},{"field":"outcome-title","direction":"asc"}]},{"name":"campaign-worker-issues","subject":"Project issue outcomes created by campaign worker workflows.","objective":"Choose a campaign worker issue whose current recorded disposition needs review.","acceptance":"Include only issues whose producing run joins declared worker inventory on organization, repository, and workflow, even when the issue lands elsewhere. Preserve campaign and role across Activity imports. Retain run and status evidence; missing closure details stay unknown and closure is not proof of resolution.","description":"Campaign-addressable issue outcomes restricted to declared worker workflows.","from":"outcomes","joins":[{"source":"workflows","type":"inner","on":[{"left":"organization","right":"organization"},{"left":"repository","right":"repository"},{"left":"workflow","right":"workflow"}],"fields":[{"field":"workflow-role","as":"declared-workflow-role"}]}],"filter":{"predicates":[{"field":"outcome-category","equals":"issue"},{"field":"declared-workflow-role","equals":"worker"}]},"select":[{"field":"campaign"},{"field":"organization"},{"field":"repository"},{"field":"safe-output"},{"field":"outcome-number"},{"field":"outcome-title","as":"event-summary"},{"field":"outcome-title"},{"field":"outcome-summary"},{"field":"outcome-status"},{"field":"outcome-state"},{"field":"issue-state"},{"field":"issue-closed"},{"field":"issue-state-reason"},{"field":"issue-status"},{"field":"issue-closing-status"},{"field":"issue-status-detail"},{"field":"issue-closed-at"},{"field":"issue-status-observed-at"},{"field":"outcome-category","as":"safe-output-type"},{"field":"workflow"},{"field":"workflow-name"},{"field":"run"},{"field":"observed-at"},{"field":"issue-link"},{"field":"external-link"},{"field":"run-link"}],"order-by":[{"field":"observed-at","direction":"desc"}]},{"name":"campaign-issue-tab-counts","subject":"Count the retained worker issues available for each campaign Reports tab.","objective":"Decide whether a campaign has retained worker issue reports to inspect.","acceptance":"For each returned campaign, items equals the number of rows in campaign-worker-issues for that campaign in the same horizon; missing campaigns are not treated as zero issues or verified resolution.","description":"One campaign row with the number of retained issue outcomes produced by campaign workers.","from":"campaign-worker-issues","aggregate":{"by":["campaign"],"values":[{"field":"campaign","as":"items","reducer":"count"}]}},{"name":"campaign-readme-orchestrators","subject":"Resolve one repository link for each campaign README from its declared orchestrator workflow.","objective":"Locate the declared orchestrator repository to contextualize a campaign README.","acceptance":"Each returned campaign and repository link traces to a declared orchestrator workflow; missing or multiple declarations are reported as uncertain rather than inventing a canonical repository.","from":"workflows","filter":{"predicates":[{"field":"workflow-role","equals":"orchestrator"}]},"select":[{"field":"campaign"},{"field":"repository-link"}]},{"name":"campaign-readme-details","subject":"Present retained campaign README content with its repository-relative link context.","objective":"Open the campaign's retained README in its declared repository context before relying on its guidance.","acceptance":"The README text and path match the campaign record and any repository link resolves through a declared orchestrator; absent content or repository linkage remains unavailable, not inferred.","from":"campaigns","joins":[{"source":"campaign-readme-orchestrators","type":"left","on":[{"left":"campaign","right":"campaign"}],"fields":[{"field":"repository-link","as":"repository-link"}]}],"select":[{"field":"campaign"},{"field":"campaign-readme"},{"field":"campaign-readme-path"},{"field":"repository-link"}]},{"name":"campaign-memory-campaigns","subject":"Provide the registered campaigns whose repository memory can be browsed together.","objective":"Choose a registered campaign for repository-memory inspection.","acceptance":"Each campaign identity and display name matches the retained campaign registry in the selected scope; listing a campaign does not establish that memory observations exist or are complete.","description":"Registered campaigns ordered for the all-campaign repository-memory browser.","from":"campaigns","select":[{"field":"campaign"},{"field":"campaign-name"}],"order-by":[{"field":"campaign-name","direction":"asc"}]},{"name":"campaign-performance-baseline-totals","subject":"Establish a selected-horizon campaign baseline from concluded run attempts while keeping reliability, unverified production, and efficiency as separate facts.","objective":"Select campaigns whose retained run reliability, output production, or AI Credit efficiency merits closer examination.","acceptance":"Concluded and successful attempts, outputs, and mean AI Credits reconcile to filtered retained runs; absent denominators or costs stay unknown. Produced outputs are unverified, not operational value.","description":"Canonical campaign run attempts aggregated into bounded selected-horizon baseline totals without treating runtime success or produced outputs as operational value.","from":"campaign-runs","compute":[{"as":"run-attempt-identity","function":"concat","args":[{"field":"run"},{"value":":"},{"field":"run-attempt"}]},{"as":"positive-aic","function":"greater-than","args":[{"field":"aic-total"},{"value":0}]}],"aggregate":{"by":["campaign"],"values":[{"field":"run-attempt-identity","as":"concluded-runs","reducer":"count","filter":{"predicates":[{"field":"status","in":["success","failure","cancelled","timed-out","action-required","neutral","skipped","stale","startup-failure"]}]}},{"field":"run-attempt-identity","as":"successful-runs","reducer":"count","filter":{"predicates":[{"field":"status","equals":"success"}]}},{"field":"safe-items-count","as":"runs-with-output-evidence","reducer":"count","filter":{"predicates":[{"field":"status","equals":"success"}]}},{"field":"safe-items-count","as":"produced-outputs","reducer":"sum","filter":{"predicates":[{"field":"status","equals":"success"}]}},{"field":"aic-total","as":"aic-per-successful-run","reducer":"mean","filter":{"predicates":[{"field":"status","equals":"success"},{"field":"positive-aic","equals":true}]}}]}},{"name":"campaign-run-status-counts","subject":"Count retained workflow runs by observed status for each campaign.","objective":"Show the distribution of run statuses so failed or stalled campaign runs can be identified.","acceptance":"Each count reconciles to campaign-runs rows with a start time for the same campaign and status; an empty result is not proof of healthy execution.","description":"Worker-side status distribution of campaign-attributed workflow runs.","from":"campaign-runs","aggregate":{"by":["campaign","status"],"values":[{"field":"started-at","as":"runs","reducer":"count"}]}},{"name":"campaign-dispatch-failure-reasons","subject":"Count retained failed workflow dispatches by failure reason for each campaign.","objective":"Prioritize which failure reasons need investigation first.","acceptance":"Each count reconciles to failed, startup-failure, timed-out, or stale dispatches for the same campaign and reason; missing reasons stay unknown and an empty result is not proof of healthy dispatch.","description":"Worker-side distribution of failure reasons across campaign workflow dispatches.","from":"dispatches","filter":{"predicates":[{"field":"status","in":["failure","startup-failure","timed-out","stale"]}]},"aggregate":{"by":["campaign","status-detail"],"values":[{"field":"run","as":"failed-dispatches","reducer":"count"}]},"order-by":[{"field":"failed-dispatches","direction":"desc"}]},{"name":"campaign-performance-baseline","subject":"Turn each campaign's selected-horizon baseline totals into deterministic reliability and production signals with an explicit successful-run efficiency fact.","objective":"Decide which campaign baseline signal needs run- or output-level verification next.","acceptance":"Success-rate and signal labels follow the retained totals and their explicit denominators; no concluded attempts or output evidence is distinguished from zero verified impact, and AI Credits per successful run remain a separate cost fact rather than a value score.","description":"A bounded, explainable baseline that distinguishes runtime reliability, unverified output production, and AI Credit efficiency.","from":"campaign-performance-baseline-totals","compute":[{"as":"success-rate","function":"quotient","args":[{"field":"successful-runs"},{"field":"concluded-runs"}]},{"as":"success-rate-display","function":"format-percent","args":[{"field":"success-rate"}]},{"as":"success-rate-percent","function":"product","args":[{"field":"success-rate"},{"value":100}]},{"as":"has-concluded-runs","function":"greater-than","args":[{"field":"concluded-runs"},{"value":0}]},{"as":"has-unsuccessful-runs","function":"greater-than","args":[{"field":"concluded-runs"},{"field":"successful-runs"}]},{"as":"observed-reliability-signal","function":"if","args":[{"field":"has-unsuccessful-runs"},{"value":"Unsuccessful runs observed"},{"value":"No unsuccessful runs observed"}]},{"as":"reliability-signal","function":"if","args":[{"field":"has-concluded-runs"},{"field":"observed-reliability-signal"},{"value":"No concluded runs observed"}]},{"as":"has-output-evidence","function":"greater-than","args":[{"field":"runs-with-output-evidence"},{"value":0}]},{"as":"has-produced-outputs","function":"greater-than","args":[{"field":"produced-outputs"},{"value":0}]},{"as":"observed-production-signal","function":"if","args":[{"field":"has-produced-outputs"},{"value":"Outputs produced; acceptance unverified"},{"value":"No outputs observed"}]},{"as":"production-signal","function":"if","args":[{"field":"has-output-evidence"},{"field":"observed-production-signal"},{"value":"Output evidence unavailable"}]}],"select":[{"field":"campaign"},{"field":"concluded-runs"},{"field":"successful-runs"},{"field":"success-rate"},{"field":"success-rate-display"},{"field":"success-rate-percent"},{"field":"reliability-signal"},{"field":"produced-outputs"},{"field":"production-signal"},{"field":"aic-per-successful-run"}]},{"name":"campaign-problem-runs","subject":"List retained failed runs for campaign problem investigation.","objective":"Choose a recent failed campaign run to investigate with its diagnostic evidence.","acceptance":"Each row corresponds to a retained campaign run with a declared failure, startup-failure, stale, or timed-out status; campaign-problem-run-evidence orders matching rows newest first. Absence is not proof of healthy execution or complete ingestion.","description":"Private failed-run input with retained diagnostic metadata; the evidence consumer orders only runs matching current runtime problems.","from":"campaign-runs","filter":{"predicates":[{"field":"status","in":["failure","startup-failure","stale","timed-out"]}]}},{"name":"campaign-problem-runtime-failures","subject":"Select current failing runtime partitions without presentation ordering.","objective":"Retain the exact current-failure eligibility needed by the problem evidence join.","acceptance":"A latest failure streak is a nonnegative integer, so failure-count at least one is equivalent to has-current-failure; missing or incomplete runtime evidence remains unknown.","description":"Private unsorted failure partitions for problem evidence; ordering is supplied by the retained failed runs.","from":"campaign-runtime-health-groups","filter":{"predicates":[{"field":"failure-count","gte":1}]},"compute":[{"as":"problem-kind","function":"coalesce","args":[{"value":"failure"},{"value":"failure"}]}]},{"name":"campaign-problem-runtime-partitions","subject":"Project current runtime problem keys and diagnoses for the failed-run evidence join.","objective":"Avoid sorting and retaining unused runtime problem presentation fields.","acceptance":"Retain both current failures and unobserved orchestrators, including their metadata and duplicate-key failure semantics; this projection does not establish health or root cause.","description":"Private compact equivalent of campaign-runtime-problems for equality enrichment, not presentation.","from":"campaign-problem-runtime-failures","union":["campaign-unobserved-orchestrators"],"select":[{"field":"campaign"},{"field":"workflow"},{"field":"runtime-repository"},{"field":"failure-count"},{"field":"problem-kind"}]},{"name":"campaign-problem-run-evidence","subject":"Attach the current campaign runtime problem summary to each retained failed Run for that partition.","objective":"Inspect the failure count and problem kind alongside a failed run without inferring its root cause.","acceptance":"Each returned row joins a retained failed run to a runtime problem on campaign, workflow, and runtime repository; the inner join drops unmatched runs, so compare with campaign-problem-runs before interpreting absence as no problem.","description":"Failed campaign runs annotated with the failure-count and problem-kind of their active runtime problem, one row per retained failed Run.","from":"campaign-problem-runs","joins":[{"source":"campaign-problem-runtime-partitions","type":"inner","on":[{"left":"campaign","right":"campaign"},{"left":"workflow","right":"workflow"},{"left":"runtime-repository","right":"runtime-repository"}],"fields":[{"field":"failure-count","as":"failure-count"},{"field":"problem-kind","as":"problem-kind"}]}],"order-by":[{"field":"started-at","direction":"desc"},{"field":"run","direction":"desc"}]},{"name":"campaign-problem-latest-target-runs","subject":"Identify the most recent retained failed Run for each campaign workflow target repository.","objective":"Select the latest retained failed run identity for each campaign workflow and target partition.","acceptance":"For every returned campaign, workflow, runtime repository, and target repository, latest-target-run agrees with the maximum retained failed run identity in that partition; a missing partition is not a healthy target.","description":"One row per campaign workflow and target repository with its most recent retained failed Run identity.","from":"campaign-problem-run-evidence","aggregate":{"by":["campaign","workflow","runtime-repository","target-repository"],"values":[{"field":"run","as":"latest-target-run","reducer":"max"}]}},{"name":"campaign-problem-error-groups","subject":"Cluster retained failed Run evidence by workflow, runtime repository, target repository, and error signature so repeated identical failures for one target collapse into one diagnosable group.","objective":"Rank repeated target-specific error signatures for investigation without merging unrelated failures.","acceptance":"Occurrence-count and latest-run match retained failed runs grouped by campaign, workflow, repositories, problem kind, and signature; unknown signatures may group together. Counts do not prove a root cause.","description":"One row per distinct target repository and error signature within a campaign runtime problem partition, with an occurrence count and the most recent matching Run identity for follow-up.","from":"campaign-problem-run-evidence","aggregate":{"by":["campaign","campaign-name","workflow","workflow-name","workflow-role","runtime-repository","target-repository","rollout-mode","failure-count","problem-kind","error-signature","error-signature-label"],"values":[{"field":"run","as":"occurrence-count","reducer":"count"},{"field":"run","as":"latest-run","reducer":"max"}]}},{"name":"campaign-current-problem-error-groups","subject":"Keep only the newest error signature for each campaign workflow target repository.","objective":"Focus investigation on the signature associated with the latest retained failed run per target.","acceptance":"Each returned group joins campaign-problem-latest-target-runs on campaign, workflow, runtime repository, and latest run ID; target repository is not a join key, so verify target identity against underlying runs before claiming one current signature per target.","description":"Current target-specific error groups whose representative Run is the target repository's most recent retained failed Run.","from":"campaign-problem-error-groups","joins":[{"source":"campaign-problem-latest-target-runs","type":"inner","on":[{"left":"campaign","right":"campaign"},{"left":"workflow","right":"workflow"},{"left":"runtime-repository","right":"runtime-repository"},{"left":"latest-run","right":"latest-target-run"}],"fields":[{"field":"latest-target-run","as":"current-target-run"}]}]},{"name":"campaign-problem-items","subject":"Attach the most recent representative Run evidence to each distinct campaign runtime problem error signature.","objective":"Open the representative failed run and target for each current campaign problem group.","acceptance":"Check joined run-link, run ID, campaign, workflow, and runtime repository; verify target against run evidence (not a join key). Unobserved orchestrators need inventory review. Missing evidence remains unknown; rollout mode does not authorize policy changes.","description":"Current campaign runtime problems represented by the newest error signature for each target repository, with its effective rollout mode, an occurrence count, the most recent matching failed Run, and a repair prompt.","from":"campaign-current-problem-error-groups","joins":[{"source":"campaign-problem-run-evidence","type":"inner","on":[{"left":"campaign","right":"campaign"},{"left":"workflow","right":"workflow"},{"left":"runtime-repository","right":"runtime-repository"},{"left":"latest-run","right":"run"}],"fields":[{"field":"started-at","as":"started-at"},{"field":"run","as":"run"},{"field":"status","as":"status"},{"field":"status-detail","as":"status-detail"},{"field":"failure-job","as":"failure-job"},{"field":"failure-message","as":"failure-message"},{"field":"failure-step","as":"failure-step"},{"field":"failure-log","as":"failure-log"},{"field":"gh-aw-version","as":"gh-aw-version"},{"field":"engine","as":"engine"},{"field":"engine-version","as":"engine-version"},{"field":"requested-model","as":"requested-model"},{"field":"resolved-model","as":"resolved-model"},{"field":"run-link","as":"run-link"},{"field":"repository-link","as":"repository-link"},{"field":"workflow-link","as":"workflow-link"},{"field":"workflow-source-link","as":"workflow-source-link"}]}],"union":["campaign-unobserved-orchestrators"],"compute":[{"as":"problem-title","function":"coalesce","args":[{"field":"failure-message"},{"field":"status-detail"},{"field":"error-signature-label"},{"field":"workflow-name"}]},{"as":"_runtime-repository-encoded","function":"url-encode","args":[{"field":"runtime-repository"}]},{"as":"_runtime-repository-href","function":"concat","args":[{"value":"#page-repository-detail?repository="},{"field":"_runtime-repository-encoded"}]},{"as":"runtime-repository-link","function":"dashboard-link","args":[{"field":"repository-link"},{"field":"_runtime-repository-href"},{"field":"runtime-repository"},{"field":"runtime-repository"}]},{"as":"_target-repository-encoded","function":"url-encode","args":[{"field":"target-repository"}]},{"as":"_target-repository-href","function":"concat","args":[{"value":"#page-repository-detail?repository="},{"field":"_target-repository-encoded"}]},{"as":"target-repository-link","function":"dashboard-link","args":[{"field":"target-repository"},{"field":"_target-repository-href"},{"field":"target-repository"}]}],"order-by":[{"field":"workflow-name","direction":"asc"},{"field":"runtime-repository","direction":"asc"},{"field":"occurrence-count","direction":"desc"},{"field":"started-at","direction":"desc"}]},{"name":"campaign-problem-tab-counts","subject":"Count the current runtime problem items available for each campaign Problems tab.","objective":"Determine whether the campaign has current retained failure groups requiring review.","acceptance":"For every returned campaign, items equals the number of campaign-problem-items rows in the same horizon; a missing count does not establish zero failures or healthy execution.","description":"One campaign row with the number of current runtime problem groups.","from":"campaign-problem-items","aggregate":{"by":["campaign"],"values":[{"field":"campaign","as":"items","reducer":"count"}]}},{"name":"campaign-baseline-successful-runs","subject":"Project successful concluded attempts from the selected-horizon campaign baseline.","objective":"Show the successful share of concluded runs without implying verified impact.","acceptance":"Counts reconcile to campaign-performance-baseline-totals; missing campaigns do not imply zero runs.","from":"campaign-performance-baseline-totals","compute":[{"as":"outcome","function":"concat","args":[{"value":"Successful attempts"},{"value":""}]}],"select":[{"field":"campaign"},{"field":"outcome"},{"field":"successful-runs","as":"runs"}]},{"name":"campaign-baseline-other-runs","subject":"Project non-successful concluded attempts from the selected-horizon campaign baseline.","objective":"Show the remaining concluded runs for reliability review.","acceptance":"Runs equal concluded-runs minus successful-runs; the category includes every other concluded status, not just failures.","from":"campaign-performance-baseline-totals","compute":[{"as":"outcome","function":"concat","args":[{"value":"Other concluded attempts"},{"value":""}]},{"as":"other-runs","function":"difference","args":[{"field":"concluded-runs"},{"field":"successful-runs"}]}],"select":[{"field":"campaign"},{"field":"outcome"},{"field":"other-runs","as":"runs"}]},{"name":"campaign-baseline-outcome-distribution","subject":"Compare successful and other concluded attempts in the selected horizon.","objective":"Spot campaign run reliability that needs inspection.","acceptance":"Successful and other counts sum to concluded attempts; neither runtime result nor output production establishes operational value.","from":"campaign-baseline-successful-runs","union":["campaign-baseline-other-runs"]},{"name":"campaign-audit-summary-plot-inventory","subject":"Describe the rendered audit-summary chart using the shared campaign Insights plot contract.","objective":"Find campaigns with retained high- or medium-severity audit summaries worth reviewing.","acceptance":"Each campaign's bucket count equals its retained audit-event-summary-buckets rows; the count describes displayed groups, not distinct incidents or confirmed harm, and missing buckets are not proof of safety.","description":"One plot-inventory row per campaign when its high- and medium-severity audit summary chart has data.","from":"audit-event-summary-buckets","aggregate":{"by":["campaign"],"values":[{"field":"event-summary","as":"buckets","reducer":"count"}]}},{"name":"campaign-insight-plot-inventory","subject":"Inventory every plot rendered on each campaign Insights page through one reusable plot contract.","objective":"Choose an available campaign Insights plot to inspect its underlying evidence.","acceptance":"Each plot entry is supplied by the audit summary plot inventory for the same campaign; experimental operational-value evidence is excluded, no plot count is treated as outcome quality, and unavailable evidence is not synthesized into a plot.","description":"One campaign row per rendered Insights plot, independent of the plot's data source or renderer.","from":"campaign-audit-summary-plot-inventory"},{"name":"campaign-insight-tab-counts","subject":"Count the plots declared by the shared campaign Insights plot inventory.","objective":"Determine whether a campaign has evidence-backed Insights plots to inspect.","acceptance":"For every returned campaign, items equals its rows in campaign-insight-plot-inventory for the same horizon; absent rows do not establish absent value, and plot counts do not measure impact.","description":"One campaign row with the number of rendered Insights plots, independent of plot type.","from":"campaign-insight-plot-inventory","aggregate":{"by":["campaign"],"values":[{"field":"campaign","as":"items","reducer":"count"}]}},{"name":"workflow-ordered-runs","subject":"Order retained run attempts within each workflow by their observed start time.","objective":"Identify each workflow's latest execution without importing event coverage or outcome totals.","acceptance":"The first chronological attempt in each workflow partition has no preceding run delta; break timestamp ties by run ID and attempt, and use creation time for queued runs.","from":"runs","compute":[{"as":"latest-run-at","function":"coalesce","args":[{"field":"started-at"},{"field":"created-at"}]}],"window":[{"operation":"change","field":"run","as":"preceding-run-delta","mode":"absolute","groupby":["organization","repository","workflow"],"order-by":[{"field":"latest-run-at","direction":"desc"},{"field":"run","direction":"desc"},{"field":"run-attempt","direction":"desc"}]}],"select":[{"field":"organization"},{"field":"repository"},{"field":"workflow"},{"field":"run"},{"field":"run-attempt"},{"field":"latest-run-at"},{"field":"run-status"},{"field":"run-conclusion"},{"field":"preceding-run-delta"},{"field":"run-link"}]},{"name":"workflow-latest-runs","subject":"Project the latest retained run attempt for each workflow.","objective":"Expose each workflow's latest observed execution state without implying aggregate outcomes.","acceptance":"Select only the first chronologically ordered attempt per workflow; preserve queued and in-progress states instead of treating unknown conclusions as failures.","from":"workflow-ordered-runs","filter":{"predicates":[{"field":"preceding-run-delta","equals":"unknown"}]},"compute":[{"as":"observed-conclusion","function":"coalesce","args":[{"field":"run-conclusion"},{"value":"unknown"}]},{"as":"completed","function":"equals-any","args":[{"field":"run-status"},{"value":"completed"}]},{"as":"latest-run-status","function":"if","args":[{"field":"completed"},{"field":"observed-conclusion"},{"field":"run-status"}]}],"select":[{"field":"organization"},{"field":"repository"},{"field":"workflow"},{"field":"run"},{"field":"run-attempt"},{"field":"latest-run-at"},{"field":"latest-run-status"},{"field":"run-link"}]},{"name":"workflow-list-preview","subject":"Show workflow declarations while latest-run evidence is still loading.","objective":"Make workflow identities and drill links available before retained runs are evaluated.","acceptance":"Preserve every declared workflow and its drill link; leave latest-run fields absent until the complete projection arrives.","from":"workflows","compute":[{"as":"repository-coordinate","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"}]},{"as":"workflow-label","function":"concat","args":[{"field":"repository-coordinate"},{"value":":"},{"field":"workflow"}]},{"as":"workflow-display-name","function":"coalesce","args":[{"field":"workflow-name"},{"field":"workflow"}]},{"as":"declared-role","function":"coalesce","args":[{"field":"workflow-role"},{"value":"standalone"}]},{"as":"declared-mode","function":"coalesce","args":[{"field":"rollout-mode"},{"value":"unknown"}]},{"as":"declared-registration","function":"coalesce","args":[{"field":"workflow-active"},{"value":"unknown"}]},{"as":"encoded-workflow","function":"url-encode","args":[{"field":"workflow-label"}]},{"as":"workflow-dashboard-href","function":"concat","args":[{"value":"#page-workflow-runtime?workflow="},{"field":"encoded-workflow"}]},{"as":"workflow-dashboard-link","function":"dashboard-link","args":[{"field":"workflow-link"},{"field":"workflow-dashboard-href"},{"field":"workflow-display-name"},{"field":"workflow-label"}]}],"select":[{"field":"organization"},{"field":"repository-coordinate","as":"repository"},{"field":"workflow"},{"field":"workflow-display-name","as":"workflow-name"},{"field":"workflow-label"},{"field":"campaign-name"},{"field":"declared-role","as":"workflow-role"},{"field":"declared-mode","as":"rollout-mode"},{"field":"declared-registration","as":"workflow-active"},{"field":"repository-link"},{"field":"workflow-dashboard-link","as":"workflow-link"}],"order-by":[{"field":"repository","direction":"asc"},{"field":"workflow","direction":"asc"}]},{"name":"workflow-list","subject":"List declared workflows in latest observed run order.","objective":"Open a dedicated workflow page from a lightweight inventory with its latest execution status.","acceptance":"Preserve textual run identities and keep unobserved workflows last with an explicit missing-run state; use only workflow declarations and retained runs, not event coverage or aggregate success/failure counters.","from":"workflows","joins":[{"source":"workflow-latest-runs","type":"left","on":[{"left":"organization","right":"organization"},{"left":"repository","right":"repository"},{"left":"workflow","right":"workflow"}],"fields":[{"field":"run","as":"latest-run"},{"field":"latest-run-at","as":"latest-run-at"},{"field":"latest-run-status","as":"observed-run-status"},{"field":"run-link","as":"run-link"}]}],"compute":[{"as":"repository-coordinate","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"}]},{"as":"workflow-label","function":"concat","args":[{"field":"repository-coordinate"},{"value":":"},{"field":"workflow"}]},{"as":"workflow-display-name","function":"coalesce","args":[{"field":"workflow-name"},{"field":"workflow"}]},{"as":"declared-role","function":"coalesce","args":[{"field":"workflow-role"},{"value":"standalone"}]},{"as":"declared-mode","function":"coalesce","args":[{"field":"rollout-mode"},{"value":"unknown"}]},{"as":"declared-registration","function":"coalesce","args":[{"field":"workflow-active"},{"value":"unknown"}]},{"as":"observed-run-id","function":"coalesce","args":[{"field":"latest-run"},{"value":"0"}]},{"as":"has-observed-run","function":"greater-than","args":[{"field":"observed-run-id"},{"value":0}]},{"as":"latest-run-status","function":"coalesce","args":[{"field":"observed-run-status"},{"value":"No observed run"}]},{"as":"encoded-workflow","function":"url-encode","args":[{"field":"workflow-label"}]},{"as":"workflow-dashboard-href","function":"concat","args":[{"value":"#page-workflow-runtime?workflow="},{"field":"encoded-workflow"}]},{"as":"workflow-dashboard-link","function":"dashboard-link","args":[{"field":"workflow-link"},{"field":"workflow-dashboard-href"},{"field":"workflow-display-name"},{"field":"workflow-label"}]}],"select":[{"field":"organization"},{"field":"repository-coordinate","as":"repository"},{"field":"workflow"},{"field":"workflow-display-name","as":"workflow-name"},{"field":"workflow-label"},{"field":"campaign-name"},{"field":"declared-role","as":"workflow-role"},{"field":"declared-mode","as":"rollout-mode"},{"field":"declared-registration","as":"workflow-active"},{"field":"latest-run"},{"field":"latest-run-at"},{"field":"latest-run-status"},{"field":"has-observed-run"},{"field":"repository-link"},{"field":"workflow-dashboard-link","as":"workflow-link"},{"field":"run-link"}],"order-by":[{"field":"has-observed-run","direction":"desc"},{"field":"latest-run-at","direction":"desc"},{"field":"repository","direction":"asc"},{"field":"workflow","direction":"asc"}]},{"name":"runs-daily-health-buckets","subject":"Select whole UTC start-day buckets against the requested time bounds.","objective":"Expose UTC bucket boundaries for declarative daily time selection.","acceptance":"Compute bounds from observed execution-start days only; missing request bounds remain unset and no sub-day totals or missing days are fabricated.","from":"daily-run-counts","compute":[{"as":"day-midnight","function":"concat","args":[{"field":"day"},{"value":"T00:00:00Z"}]},{"as":"day-ms","function":"timestamp","args":[{"field":"day-midnight"}]},{"as":"start-ms","function":"timestamp","args":[{"context":"time-start"}]},{"as":"end-ms","function":"timestamp","args":[{"context":"time-end"}]},{"as":"before-start","function":"greater-than","args":[{"field":"start-ms"},{"field":"day-ms"}]},{"as":"before-end","function":"greater-than","args":[{"field":"end-ms"},{"field":"day-ms"}]}]},{"name":"runs-daily-health-totals","subject":"Sum observed daily run health across the selected scope.","objective":"Keep daily activity counts independent of detail retention.","acceptance":"Sum only daily counts, never retained Runs. UTC start-day buckets are selected by midnight; sub-day totals are unsupported. Missing or undated evidence remains unavailable or partial.","from":"runs-daily-health-buckets","filter":{"predicates":[{"field":"before-start","in":[false,null]},{"field":"before-end","in":[true,null]}]},"aggregate":{"by":["day"],"values":[{"field":"successful","as":"successful","reducer":"sum"},{"field":"failed","as":"failed","reducer":"sum"},{"field":"approval","as":"approval","reducer":"sum"},{"field":"pending","as":"pending","reducer":"sum"},{"field":"other","as":"other","reducer":"sum"}]}},{"name":"runs-daily-successful","subject":"Observed daily successful run counts.","objective":"Expose the successful class for the daily runtime-health chart.","acceptance":"Project successful counts from scoped daily totals without re-reading detail; runtime success does not imply accepted outcomes.","from":"runs-daily-health-totals","compute":[{"as":"runtime-health","function":"literal","args":[{"value":"Successful"}]}],"select":[{"field":"day"},{"field":"runtime-health"},{"field":"successful","as":"runs"}]},{"name":"runs-daily-failed","subject":"Observed daily failed run counts.","objective":"Expose the failed class for the daily runtime-health chart.","acceptance":"Project failed counts from scoped daily totals, preserving zero counts and aggregate coverage without deriving incidents.","from":"runs-daily-health-totals","compute":[{"as":"runtime-health","function":"literal","args":[{"value":"Failed"}]}],"select":[{"field":"day"},{"field":"runtime-health"},{"field":"failed","as":"runs"}]},{"name":"runs-daily-approval","subject":"Observed daily approval-required run counts.","objective":"Expose approval-required observations in the daily runtime-health chart.","acceptance":"Project approval counts from scoped daily totals without treating approval-required observations as successes or failures.","from":"runs-daily-health-totals","compute":[{"as":"runtime-health","function":"literal","args":[{"value":"Approval required"}]}],"select":[{"field":"day"},{"field":"runtime-health"},{"field":"approval","as":"runs"}]},{"name":"runs-daily-pending","subject":"Observed daily pending run counts.","objective":"Expose last-observed pending state in the daily runtime-health chart.","acceptance":"Project pending counts from scoped daily totals; counts describe last-observed evidence, not a live execution census.","from":"runs-daily-health-totals","compute":[{"as":"runtime-health","function":"literal","args":[{"value":"Pending"}]}],"select":[{"field":"day"},{"field":"runtime-health"},{"field":"pending","as":"runs"}]},{"name":"runs-daily-other","subject":"Observed daily unclassified terminal or missing-status run counts.","objective":"Expose the remaining runtime-health class without implying success.","acceptance":"Project other counts from scoped daily totals; preserve zeros and coverage without interpreting skipped, cancelled, or unknown evidence as success.","from":"runs-daily-health-totals","compute":[{"as":"runtime-health","function":"literal","args":[{"value":"Other"}]}],"select":[{"field":"day"},{"field":"runtime-health"},{"field":"other","as":"runs"}]},{"name":"runs-daily-conclusions","subject":"Daily observed runtime health classes for the Runs chart.","objective":"Investigate daily activity independently of retained run detail.","acceptance":"Classes sum to observed dated Runs, not attempts or verified outcomes. Pending is last-observed state; Other is not success. Select whole UTC start-day buckets by midnight, not sub-day totals. Preserve partial or unavailable coverage.","from":"runs-daily-successful","union":["runs-daily-failed","runs-daily-approval","runs-daily-pending","runs-daily-other"],"order-by":[{"field":"day","direction":"asc"},{"field":"runtime-health","direction":"asc"}]},{"name":"entity-events","subject":"Project all run-owned records for reusable cards and run drill-down.","objective":"Expose run-owned event identity, status, provenance, timestamp, and available navigation links for inspection.","acceptance":"Projected event fields and fallback URL trace to the source record; a missing link or event is not proof of no output, and event status alone does not verify downstream impact.","from":"event-base","compute":[{"as":"event-url","function":"coalesce","args":[{"field":"safe-output-url"},{"field":"correlation-id"},{"field":"implementation-pull-request-url"}]}],"select":[{"field":"organization"},{"field":"repository"},{"field":"workflow"},{"field":"run"},{"field":"run-attempt"},{"field":"event"},{"field":"event-source"},{"field":"event-type"},{"field":"event-summary"},{"field":"event-status"},{"field":"github-entity-type"},{"field":"safe-output-type"},{"field":"event-url"},{"field":"event-timestamp","as":"observed-at"},{"field":"run-link"}],"order-by":[{"field":"observed-at","direction":"desc"},{"field":"event","direction":"asc"}]},{"name":"runs-table","subject":"Show observed workflow runs in a table with execution, repository, workflow, engine, model, and navigation details.","objective":"Locate observed runs whose recorded status or conclusion needs closer inspection.","acceptance":"Show recorded run identity, status, conclusion, scope, execution metadata, and source links in newest-first order; absent runs require a freshness and coverage check, and a successful run is not proof of accepted outcomes.","description":"Observed workflow runs ordered from newest to oldest.","from":"runs","compute":[{"as":"repository-coordinate","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"}]}],"select":[{"field":"run"},{"field":"run-status"},{"field":"run-conclusion"},{"field":"repository-coordinate"},{"field":"workflow"},{"field":"rollout-mode"},{"field":"engine"},{"field":"engine-version"},{"field":"gh-aw-version"},{"field":"requested-model"},{"field":"resolved-model"},{"field":"started-at"},{"field":"repository-link"},{"field":"workflow-link"},{"field":"run-link"}],"order-by":[{"field":"started-at","direction":"desc"}]},{"name":"workflow-aic-per-run","subject":"List declared workflows with recorded positive AI Credit costs and their average cost per run.","objective":"Identify workflows with observed run AIC averages worth investigating alongside run evidence.","acceptance":"Include only declared workflows with at least one run attempt reporting positive AIC; exclude zero and missing telemetry from the average and ranking, without interpreting missing telemetry as free execution.","description":"Workflow AI Credit averages limited to run attempts with recorded positive AIC.","from":"workflows","joins":[{"source":"workflow-aic-run-totals","type":"left","on":[{"left":"organization","right":"organization"},{"left":"repository","right":"repository"},{"left":"workflow","right":"workflow"}],"fields":[{"field":"runs","as":"observed-runs"},{"field":"aic-runs","as":"observed-aic-runs"},{"field":"aic","as":"observed-aic"}]}],"compute":[{"as":"repository-slug","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"}]},{"as":"workflow-display-name","function":"coalesce","args":[{"field":"workflow-name"},{"field":"workflow"}]},{"as":"workflow-identity","function":"concat","args":[{"field":"repository-slug"},{"value":":"},{"field":"workflow"}]},{"as":"encoded-workflow","function":"url-encode","args":[{"field":"workflow-identity"}]},{"as":"workflow-dashboard-href","function":"concat","args":[{"value":"#page-workflow-runtime?workflow="},{"field":"encoded-workflow"}]},{"as":"workflow-dashboard-label","function":"concat","args":[{"value":"View "},{"field":"workflow-display-name"},{"value":" workflow dashboard"}]},{"as":"workflow-dashboard-link","function":"dashboard-link","args":[{"field":"workflow-link"},{"field":"workflow-dashboard-href"},{"field":"workflow-dashboard-label"},{"field":"workflow-identity"}]},{"as":"aic-per-run","function":"quotient","args":[{"field":"observed-aic"},{"field":"observed-aic-runs"}]}],"filter":{"predicates":[{"field":"observed-aic-runs","gte":1}]},"select":[{"field":"workflow-identity","as":"workflow-label"},{"field":"workflow-dashboard-link","as":"workflow-link"},{"field":"aic-per-run"}],"order-by":[{"field":"aic-per-run","direction":"desc"}],"limit":10},{"name":"dashboard-ingestion-health","subject":"Expose the current collection state for the global ingestion indicator.","objective":"Distinguish reported ingestion failure or recovery from the age of retained workflow evidence.","acceptance":"Use the authorized server collection-health classification, not cumulative failures or browser refresh time. Missing or unauthorized health remains unknown and static dashboards do not request this source.","from":"collection-health","select":[{"field":"configured"},{"field":"health"}],"limit":1},{"name":"dashboard-data-freshness","subject":"Find the newest workflow activity timestamp in retained canonical data.","objective":"Warn globally when the ingested workflow evidence has not advanced for 24 hours.","acceptance":"Use upstream updated-at, falling back to created-at, never browser import or refresh time. Missing or invalid timestamps remain unknown; inactivity alone does not prove an ingestion failure.","from":"runs","compute":[{"as":"data-at","function":"coalesce","args":[{"field":"updated-at"},{"field":"created-at"}]},{"as":"data-at-ms","function":"timestamp","args":[{"field":"data-at"}]}],"aggregate":{"values":[{"field":"data-at-ms","as":"latest-data-at","reducer":"max"}]}},{"name":"indexing-shards","subject":"List retained Activity shard import receipts.","objective":"Inspect which shards were ingested, when, and how many records they committed.","acceptance":"Show shard scope, phase, import status, import timestamp, counts and payload identity from retained receipts. Import time is not upstream freshness and missing receipts do not prove complete coverage.","from":"transactions","filter":{"predicates":[{"field":"kind","in":["ingest-normalized-jsonl","ingest-jsonl","ingest-jsonl-failed","runs","records"]}]},"select":[{"field":"id"},{"field":"payloadScope","as":"shard"},{"field":"kind"},{"field":"activity-status","as":"status"},{"field":"createdAt","as":"ingested-at"},{"field":"committedRecords","as":"committed-records"},{"field":"rawRuns","as":"workflow-runs"},{"field":"payloadHash","as":"payload-hash"}],"order-by":[{"field":"ingested-at","direction":"desc"}]},{"name":"ingestion-queued","subject":"Label the shared collection task queue depth for the administrator queue chart.","objective":"Identify total ready and scheduled collection work, including backfill tasks.","acceptance":"Show the observed shared queue depth only when collection is configured; missing or unauthorized health data is not zero pending work.","from":"collection-health","filter":{"predicates":[{"field":"configured","equals":true}]},"compute":[{"as":"queue","function":"coalesce","args":[{"value":"Ready and scheduled"},{"value":"Ready and scheduled"}]}],"select":[{"field":"queue"},{"field":"queue-depth","as":"tasks"}]},{"name":"ingestion-inflight","subject":"Label current in-flight collection tasks for the administrator queue chart.","objective":"Distinguish leased collection tasks from work awaiting collection.","acceptance":"Show the observed pending task count only when collection is configured; do not infer a count from an unavailable source.","from":"collection-health","filter":{"predicates":[{"field":"configured","equals":true}]},"compute":[{"as":"queue","function":"coalesce","args":[{"value":"In flight"},{"value":"In flight"}]}],"select":[{"field":"queue"},{"field":"pending-tasks","as":"tasks"}]},{"name":"ingestion-backfill","subject":"Label cumulative backfill run admissions for the administrator ingestion chart.","objective":"Compare historically admitted run tasks with current outstanding work without treating admissions as a live backlog.","acceptance":"Show the cumulative run task admissions only when collection is configured; this value does not decrease as tasks complete and missing health data does not imply completed backfill.","from":"collection-health","filter":{"predicates":[{"field":"configured","equals":true}]},"compute":[{"as":"queue","function":"coalesce","args":[{"value":"Backfill admitted (total)"},{"value":"Backfill admitted (total)"}]}],"select":[{"field":"queue"},{"field":"backfill-queued-run-tasks","as":"tasks"}]},{"name":"ingestion-queue-sizes","subject":"Compare current shared queue pressure, in-flight tasks, and cumulative historical backfill admissions from the administrator-only server snapshot.","objective":"Spot a growing backlog without treating past backfill admissions as outstanding work.","acceptance":"Current queue sizes and cumulative admissions come only from an authorized collection-health snapshot; unavailable state is not zero.","from":"ingestion-queued","union":["ingestion-inflight","ingestion-backfill"],"select":[{"field":"queue"},{"field":"tasks"}]},{"name":"ingestion-webhook-status","subject":"Inspect live webhook delivery counters for the current server process.","objective":"Distinguish signature validation, acknowledgements, rejections and failures without polling GitHub.","acceptance":"Show only authorized process-local counters, including in-flight requests, duplicate acknowledgements and signed pings. Counters reset on restart, are not replica totals, and do not establish GitHub-side webhook registration or completed collection. Refresh the active subscription even without canonical data changes.","from":"webhook-status","compute":[{"as":"configuration","function":"if","args":[{"field":"configured"},{"value":"Configured"},{"value":"Not configured"}]}],"limit":1},{"name":"ingestion-health","subject":"Show the current Redis-backed webhook and collection health snapshot.","objective":"Determine whether the reported collection, webhook, queue, and backfill state warrants inspecting ingestion diagnostics.","acceptance":"Report the observed health, queue, failure, success, and projection timestamps together; verify freshness and configuration before calling collection healthy, and treat missing state as unknown rather than zero.","from":"collection-health","select":[{"field":"configured"},{"field":"health"},{"field":"queue-depth"},{"field":"pending-tasks"},{"field":"dead-letters"},{"field":"oldest-pending-age"},{"field":"backfill"},{"field":"backfill-failures"},{"field":"backfill-queued-run-tasks"},{"field":"webhook-load"},{"field":"collection-load"},{"field":"failure-load"},{"field":"last-projected"},{"field":"last-webhook-at"},{"field":"last-failure-at"},{"field":"last-failure-code"},{"field":"last-success-at"},{"field":"webhook-received"},{"field":"webhook-duplicate"},{"field":"webhook-admission-failed"},{"field":"task-queued"},{"field":"task-coalesced"},{"field":"collection-succeeded"},{"field":"collection-failed"},{"field":"collection-retried"},{"field":"collection-dead-lettered"}]},{"name":"github-api-usage","subject":"Show retained GitHub API quota usage per bucket and in aggregate over the last 24 hours.","objective":"Determine whether any GitHub App installation or the CAO fleet as a whole is approaching its GitHub API rate limit.","acceptance":"Report peak usage percentages with their limits, used, and reserved counts; treat a slot without observations as unknown rather than idle, and never infer credentials from bucket identity.","from":"github-quota-usage","select":[{"field":"observed-at"},{"field":"scope"},{"field":"bucket"},{"field":"app"},{"field":"installation"},{"field":"resource"},{"field":"buckets"},{"field":"limit"},{"field":"used"},{"field":"reserved"},{"field":"usage-percent"}]},{"name":"marketplace-directory","subject":"Browse packages from configured marketplace registries.","objective":"Present a stable alphabetical directory that can be loaded in bounded pages.","acceptance":"Preserve resolver-produced provenance and package metadata. Order by package name and immutable source so continuation pages neither skip nor duplicate entries; discovery grants no installation authority.","from":"marketplace-packages","order-by":[{"field":"package-name","direction":"asc"},{"field":"package-source","direction":"asc"}]},{"name":"marketplace-package-detail","subject":"Expose normalized marketplace package records for source-coordinate lookup by the detail view.","objective":"Locate the resolver-produced package record for a source coordinate supplied by the consuming view.","acceptance":"Use the returned package-source, registry, ref, and resolved-commit fields when inspecting a matching record; the query itself does not filter by coordinate, and an absent match is not proof of package nonexistence or approval.","from":"marketplace-packages"},{"name":"friction-by-workflow","subject":"Rank workflows by observed gh-aw audit friction AI Credit totals for investigation.","objective":"Identify which repository and workflow combinations have the largest measured friction totals in retained observations.","acceptance":"Compare friction-aic and distinct runs with the underlying measurement states and attribution evidence; do not equate a ranking with avoidable cost or a validated saving.","description":"Total gh-aw audit friction cost grouped by repository and workflow.","from":"friction","compute":[{"as":"positive-aic","function":"greater-than","args":[{"field":"aic"},{"value":0}]},{"as":"repository-coordinate","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"}]},{"as":"workflow-coordinate","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"},{"value":":"},{"field":"workflow"}]}],"aggregate":{"by":["workflow-coordinate","repository-coordinate","workflow"],"values":[{"field":"aic","as":"friction-aic","reducer":"sum","filter":{"predicates":[{"field":"positive-aic","equals":true}]}},{"field":"run","as":"runs","reducer":"distinct-count"}]},"order-by":[{"field":"friction-aic","direction":"desc"},{"field":"workflow-coordinate","direction":"asc"}]},{"name":"friction-observations","subject":"List retained gh-aw audit friction measurements with their run context and attribution totals.","objective":"Trace each reported friction measurement to a run and distinguish counted, suppressed, and unattributed occurrences.","acceptance":"Preserve native AIC, total-run AIC, measurement state, timestamps, links, and occurrence counts; missing or unattributed evidence remains uncertain, not a verified opportunity for savings.","description":"Newest friction measurements first, preserving the native audit values and uncertainty state.","from":"friction","compute":[{"as":"repository-coordinate","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"}]},{"as":"friction-percent","function":"format-percent","args":[{"field":"friction-ratio"}]}],"select":[{"field":"event-timestamp","as":"observed-at"},{"field":"repository-coordinate"},{"field":"workflow"},{"field":"run"},{"field":"run-link"},{"field":"measurement-state"},{"field":"aic"},{"field":"total-run-aic"},{"field":"friction-percent"},{"field":"counted-occurrences"},{"field":"suppressed-occurrences"},{"field":"unattributed-occurrences"}],"order-by":[{"field":"observed-at","direction":"desc"},{"field":"run","direction":"desc"}]},{"name":"indexing-shard-dates","subject":"Read the activity date encoded in each retained transaction's shard filename.","objective":"Separate source shard dates from ingestion timestamps.","acceptance":"Keep every transaction and leave absent, invalid, or structural shard dates unknown; never substitute import time.","from":"transactions","compute":[{"as":"shard-day","function":"activity-shard-day","args":[{"field":"payloadScope"}]},{"as":"missing-shard-day","function":"equals-any","args":[{"field":"shard-day"},{"value":null}]}]},{"name":"indexing-shard-entry-counts","subject":"Count retained ingestion entries for each valid shard activity date.","objective":"Expose coincident ingestion density as circle area without changing individual run counts.","acceptance":"Count dated transaction identities across all kinds, including zero and unavailable run counts. This is retained ingestion evidence, not distinct runs, bytes, or upstream coverage.","from":"indexing-shard-dates","filter":{"predicates":[{"field":"missing-shard-day","equals":false}]},"aggregate":{"by":["shard-day"],"values":[{"field":"id","as":"shard-entry-count","reducer":"count"}]}},{"name":"indexing-ingestion-runs","subject":"Show retained ingestion transactions at the activity date encoded in their shard filename.","objective":"Compare reported run counts by source shard activity date, independently of import time, and expose coincident ingestion density.","acceptance":"Preserve all dated transactions without grouping, limits or page filters. Size by retained entries on the shard day, not distinct runs or coverage. Never substitute import time. Missing run counts remain labeled zero-position placeholders, not measured zeroes.","from":"indexing-shard-dates","joins":[{"source":"indexing-shard-entry-counts","type":"left","on":[{"left":"shard-day","right":"shard-day"}],"fields":[{"field":"shard-entry-count","as":"shard-entry-count"}]}],"filter":{"predicates":[{"field":"missing-shard-day","equals":false}]},"compute":[{"as":"workflow-runs","function":"coalesce","args":[{"field":"rawRuns"},{"value":0}]},{"as":"missing-run-count","function":"equals-any","args":[{"field":"rawRuns"},{"value":null}]},{"as":"run-count-status","function":"if","args":[{"field":"missing-run-count"},{"value":"Run count unavailable (shown at 0)"},{"value":"Reported run count"}]}],"select":[{"field":"id"},{"field":"kind"},{"field":"createdAt"},{"field":"shard-day"},{"field":"rawRuns"},{"field":"workflow-runs"},{"field":"shard-entry-count"},{"field":"run-count-status"}],"order-by":[{"field":"shard-day","direction":"asc"},{"field":"id","direction":"asc"}]},{"name":"indexing-daily-run-counts","subject":"Inspect admitted daily logical Run counts independently of retained detail and shard receipts.","objective":"Make the daily run-count projection visible as an ingestion diagnostic.","acceptance":"Sum daily buckets by observed UTC execution-start day across repositories and workflows, without page filters, detail fallback, fabricated days or zero populations. Preserve aggregate coverage and partial or unavailable evidence; counts do not prove upstream completeness.","from":"daily-run-counts","aggregate":{"by":["day"],"values":[{"field":"total","as":"runs","reducer":"sum"}]},"select":[{"field":"day","as":"date"},{"field":"runs"}],"order-by":[{"field":"date","direction":"asc"}]},{"name":"indexing-campaigns-table-count","subject":"Count retained campaigns rows in the dashboard database.","objective":"Provide the retained campaigns row count for the table-count diagnostic.","acceptance":"Label the result campaigns and count campaign rows in the current database; absence or zero does not establish completeness or expected campaign coverage.","from":"campaigns","compute":[{"as":"table","function":"literal","args":[{"value":"campaigns"}]}],"aggregate":{"by":["table"],"values":[{"field":"campaign","as":"records","reducer":"count"}]}},{"name":"indexing-repositories-table-count","subject":"Count retained repositories rows in the dashboard database.","objective":"Provide the retained repositories row count for the table-count diagnostic.","acceptance":"Label the result repositories and count repository rows in the current database; absence or zero does not establish completeness or expected repository coverage.","from":"repositories","compute":[{"as":"table","function":"literal","args":[{"value":"repositories"}]}],"aggregate":{"by":["table"],"values":[{"field":"repository","as":"records","reducer":"count"}]}},{"name":"indexing-workflows-table-count","subject":"Count retained workflows rows in the dashboard database.","objective":"Provide the retained workflows row count for the table-count diagnostic.","acceptance":"Label the result workflows and count workflow rows in the current database; absence or zero does not establish completeness or expected workflow coverage.","from":"workflows","compute":[{"as":"table","function":"literal","args":[{"value":"workflows"}]}],"aggregate":{"by":["table"],"values":[{"field":"workflow","as":"records","reducer":"count"}]}},{"name":"indexing-runs-table-count","subject":"Count retained workflow runs rows in the dashboard database.","objective":"Provide the retained workflow runs row count for the table-count diagnostic.","acceptance":"Label the result workflow runs and count run rows in the current database; absence or zero does not establish completeness or expected execution volume.","from":"runs","compute":[{"as":"table","function":"literal","args":[{"value":"runs"}]}],"aggregate":{"by":["table"],"values":[{"field":"run","as":"records","reducer":"count"}]}},{"name":"indexing-domains-table-count","subject":"Count retained network domains rows in the dashboard database.","objective":"Provide the retained network domains row count for the table-count diagnostic.","acceptance":"Label the result network domains and count domain event rows in the current database; absence or zero does not prove no network activity.","from":"domains","compute":[{"as":"table","function":"literal","args":[{"value":"domains"}]}],"aggregate":{"by":["table"],"values":[{"field":"event","as":"records","reducer":"count"}]}},{"name":"indexing-tools-table-count","subject":"Count retained tool events rows in the dashboard database.","objective":"Provide the retained tool events row count for the table-count diagnostic.","acceptance":"Label the result tool events and count tool event rows in the current database; absence or zero does not prove no tool use.","from":"tools","compute":[{"as":"table","function":"literal","args":[{"value":"tools"}]}],"aggregate":{"by":["table"],"values":[{"field":"table","as":"records","reducer":"count"}]}},{"name":"indexing-audits-table-count","subject":"Count retained audit events rows in the dashboard database.","objective":"Provide the retained audit events row count for the table-count diagnostic.","acceptance":"Label the result audit events and count audit event rows in the current database; absence or zero does not prove no audit findings.","from":"audits","compute":[{"as":"table","function":"literal","args":[{"value":"audits"}]}],"aggregate":{"by":["table"],"values":[{"field":"event","as":"records","reducer":"count"}]}},{"name":"indexing-issues-table-count","subject":"Count retained issue events rows in the dashboard database.","objective":"Provide the retained issue events row count for the table-count diagnostic.","acceptance":"Label the result issue events and count issue event rows in the current database; absence or zero does not prove no issues exist.","from":"issues","compute":[{"as":"table","function":"literal","args":[{"value":"issues"}]}],"aggregate":{"by":["table"],"values":[{"field":"event","as":"records","reducer":"count"}]}},{"name":"indexing-operational-values-table-count","subject":"Count retained operational values rows in the dashboard database.","objective":"Provide the retained operational values row count for the table-count diagnostic.","acceptance":"Label the result operational values and count operational-value rows in the current database; absence or zero does not imply zero value or an evaluated outcome.","from":"operational-values","compute":[{"as":"table","function":"literal","args":[{"value":"operationalValues"}]}],"aggregate":{"by":["table"],"values":[{"field":"operational-value","as":"records","reducer":"count"}]}},{"name":"indexing-transactions-table-count","subject":"Count retained ingestion transactions rows in the dashboard database.","objective":"Provide the retained ingestion transactions row count for the table-count diagnostic.","acceptance":"Label the result ingestion transactions and count transaction IDs in the current database; absence or zero does not establish whether upstream ingestion ran.","from":"transactions","compute":[{"as":"table","function":"literal","args":[{"value":"transactions"}]}],"aggregate":{"by":["table"],"values":[{"field":"id","as":"records","reducer":"count"}]}},{"name":"indexing-database-table-counts","subject":"Count retained canonical dashboard database rows by table.","objective":"Compare the retained table row counts to identify tables needing further ingestion or coverage investigation.","acceptance":"Union the named table-count projections and report their table labels and counts; check source availability, retention, and separate transaction evidence before interpreting an empty or small table as an ingestion defect.","from":"indexing-campaigns-table-count","union":["indexing-repositories-table-count","indexing-workflows-table-count","indexing-runs-table-count","indexing-domains-table-count","indexing-tools-table-count","indexing-audits-table-count","indexing-issues-table-count","indexing-operational-values-table-count","indexing-transactions-table-count"],"order-by":[{"field":"records","direction":"desc"},{"field":"table","direction":"asc"}]},{"name":"indexing-transactions","subject":"Prepare retained ingestion transactions for card presentation.","objective":"Expose transaction identity, kind, timestamp, committed-record count, and payload hash for ingestion traceability.","acceptance":"Projected fields match retained transactions without implying successful upstream coverage from a committed count or hash alone; missing transactions require a freshness and availability check.","from":"transactions","select":[{"field":"id"},{"field":"kind"},{"field":"createdAt","as":"created-at"},{"field":"committedRecords","as":"committed-records"},{"field":"payloadHash","as":"payload-hash"}]},{"name":"engines-models-sample-distribution","subject":"Describe agent and model combinations in the seven-day statistical run sample.","objective":"Find sampled combinations to investigate without scanning the full retained run history.","acceptance":"Count unweighted selected Runs after frame selection. Keep statistical-frame-id in grouped rows and frame metadata on empty results. Zero-allocation strata are not population zeros. Preserve unknown identifiers; failure reserves can alter composition. Never mix sample counts with exact usage or infer population shares.","description":"Unweighted composition of the seven-day statistical sample; not a population estimate. Failure outcomes may be oversampled.","from":"statistical-runs","compute":[{"as":"summary","function":"concat","args":[{"field":"agent-id"},{"value":" / "},{"field":"model-id"}]}],"aggregate":{"by":["summary","statistical-frame-id"],"values":[{"field":"run","as":"sampled-runs","reducer":"count"}]},"order-by":[{"field":"sampled-runs","direction":"desc"},{"field":"summary","direction":"asc"}]},{"name":"engines-models-usage","subject":"Summarize run-level AIC and token usage by agent and model identifiers without treating unavailable telemetry as zero.","objective":"Locate agent and model combinations whose observed per-run AIC or token usage merits checking against individual runs.","acceptance":"Report run counts and native minimum, mean, and maximum values only for reported metrics; inspect underlying runs for per-metric telemetry coverage and context before comparing combinations, and infer neither efficiency nor outcome value from usage alone.","description":"Observed workflow runs grouped by agent ID and model ID. AIC statistics use only positive-AIC runs; token statistics use runs that reported each token metric.","from":"runs","compute":[{"as":"summary","function":"concat","args":[{"field":"agent-id"},{"value":" / "},{"field":"model-id"}]},{"as":"positive-aic","function":"greater-than","args":[{"field":"aic-total"},{"value":0}]}],"aggregate":{"by":["summary"],"values":[{"field":"run","as":"runs","reducer":"count"},{"field":"aic-total","as":"minimum-aic-per-run","reducer":"min","filter":{"predicates":[{"field":"positive-aic","equals":true}]}},{"field":"aic-total","as":"average-aic-per-run","reducer":"mean","filter":{"predicates":[{"field":"positive-aic","equals":true}]}},{"field":"aic-total","as":"maximum-aic-per-run","reducer":"max","filter":{"predicates":[{"field":"positive-aic","equals":true}]}},{"field":"input-tokens","as":"minimum-input-tokens-per-run","reducer":"min"},{"field":"input-tokens","as":"average-input-tokens-per-run","reducer":"mean"},{"field":"input-tokens","as":"maximum-input-tokens-per-run","reducer":"max"},{"field":"output-tokens","as":"minimum-output-tokens-per-run","reducer":"min"},{"field":"output-tokens","as":"average-output-tokens-per-run","reducer":"mean"},{"field":"output-tokens","as":"maximum-output-tokens-per-run","reducer":"max"},{"field":"cache-read-tokens","as":"minimum-cache-read-tokens-per-run","reducer":"min"},{"field":"cache-read-tokens","as":"average-cache-read-tokens-per-run","reducer":"mean"},{"field":"cache-read-tokens","as":"maximum-cache-read-tokens-per-run","reducer":"max"},{"field":"cache-write-tokens","as":"minimum-cache-write-tokens-per-run","reducer":"min"},{"field":"cache-write-tokens","as":"average-cache-write-tokens-per-run","reducer":"mean"},{"field":"cache-write-tokens","as":"maximum-cache-write-tokens-per-run","reducer":"max"},{"field":"reasoning-tokens","as":"minimum-reasoning-tokens-per-run","reducer":"min"},{"field":"reasoning-tokens","as":"average-reasoning-tokens-per-run","reducer":"mean"},{"field":"reasoning-tokens","as":"maximum-reasoning-tokens-per-run","reducer":"max"}]},"select":[{"field":"summary"},{"field":"runs"},{"field":"average-aic-per-run"},{"field":"minimum-aic-per-run"},{"field":"maximum-aic-per-run"},{"field":"minimum-input-tokens-per-run"},{"field":"average-input-tokens-per-run"},{"field":"maximum-input-tokens-per-run"},{"field":"minimum-output-tokens-per-run"},{"field":"average-output-tokens-per-run"},{"field":"maximum-output-tokens-per-run"},{"field":"minimum-cache-read-tokens-per-run"},{"field":"average-cache-read-tokens-per-run"},{"field":"maximum-cache-read-tokens-per-run"},{"field":"minimum-cache-write-tokens-per-run"},{"field":"average-cache-write-tokens-per-run"},{"field":"maximum-cache-write-tokens-per-run"},{"field":"minimum-reasoning-tokens-per-run"},{"field":"average-reasoning-tokens-per-run"},{"field":"maximum-reasoning-tokens-per-run"}],"order-by":[{"field":"runs","direction":"desc"},{"field":"summary","direction":"asc"}]},{"name":"skill-invocations","subject":"Select observed skill invocations for skill usage analytics.","objective":"Expose skill event identity, scope, invocation counts, and failed counts for downstream usage analysis.","acceptance":"Keep each observed event and its repository/workflow attribution with native counts; missing records or failed counts alone do not establish whether a skill was useful or available.","from":"skills","select":[{"field":"event","as":"id"},{"field":"name","as":"skill"},{"field":"organization"},{"field":"repository"},{"field":"workflow"},{"field":"invocation-count"},{"field":"failed-count"}]},{"name":"skill-invocations-by-skill","subject":"Rank skills by their observed invocation count.","objective":"Identify skills with the highest observed invocation totals for follow-up inspection.","acceptance":"Sum observed invocation counts by skill and retain the rank as a usage description; do not equate popularity with effectiveness or infer unobserved invocations.","from":"skill-invocations","aggregate":{"by":["skill"],"values":[{"field":"invocation-count","as":"invocations","reducer":"sum"}]},"order-by":[{"field":"invocations","direction":"desc"},{"field":"skill","direction":"asc"}]},{"name":"skill-invocations-by-workflow-totals","subject":"Rank workflows by their observed skill invocation count.","objective":"Produce repository-scoped workflow invocation totals for downstream skill-usage comparison.","acceptance":"Sum observed invocation counts by organization, repository, and workflow; totals describe recorded usage only, not success or expected adoption.","from":"skill-invocations","aggregate":{"by":["organization","repository","workflow"],"values":[{"field":"invocation-count","as":"invocations","reducer":"sum"}]}},{"name":"skill-invocations-by-workflow","subject":"Present workflow skill invocation totals with drill-through navigation to the workflow dashboard.","objective":"Expose observed workflow skill invocation totals with a link to inspect each workflow.","acceptance":"Each projected workflow coordinate, link, and invocation total traces to the grouped source; using a link to investigate does not establish that usage caused an outcome.","from":"skill-invocations-by-workflow-totals","compute":[{"as":"workflow-coordinate","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"},{"value":":"},{"field":"workflow"}]},{"as":"encoded-workflow","function":"url-encode","args":[{"field":"workflow-coordinate"}]},{"as":"workflow-dashboard-href","function":"concat","args":[{"value":"#page-workflow-runtime?workflow="},{"field":"encoded-workflow"}]},{"as":"workflow-dashboard-label","function":"concat","args":[{"value":"View "},{"field":"workflow-coordinate"},{"value":" workflow dashboard"}]},{"as":"workflow-link","function":"dashboard-link","args":[{"value":""},{"field":"workflow-dashboard-href"},{"field":"workflow-dashboard-label"},{"field":"workflow-coordinate"}]}],"select":[{"field":"workflow-coordinate"},{"field":"workflow-link"},{"field":"invocations"}],"order-by":[{"field":"invocations","direction":"desc"},{"field":"workflow-coordinate","direction":"asc"}]},{"name":"skill-workflow-totals","subject":"Count observed invocations for each skill and workflow.","objective":"Produce skill-by-workflow invocation totals for the downstream inventory.","acceptance":"Sum observed invocation counts by skill, organization, repository, and workflow; missing combinations are not evidence that a skill could not run.","from":"skill-invocations","aggregate":{"by":["skill","organization","repository","workflow"],"values":[{"field":"invocation-count","as":"invocations","reducer":"sum"}]}},{"name":"skill-workflow-inventory","subject":"List observed skills by workflow with drill-through navigation to the workflow dashboard.","objective":"Identify observed skill/workflow combinations and provide a workflow link for inspecting their runs.","acceptance":"Show the repository, workflow, skill, link, and observed invocation total from the grouped evidence; an absent row does not prove non-use, and a high count does not prove effectiveness.","from":"skill-workflow-totals","compute":[{"as":"repository-coordinate","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"}]},{"as":"workflow-coordinate","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"},{"value":":"},{"field":"workflow"}]},{"as":"encoded-workflow","function":"url-encode","args":[{"field":"workflow-coordinate"}]},{"as":"workflow-dashboard-href","function":"concat","args":[{"value":"#page-workflow-runtime?workflow="},{"field":"encoded-workflow"}]},{"as":"workflow-dashboard-label","function":"concat","args":[{"value":"View "},{"field":"workflow-coordinate"},{"value":" workflow dashboard"}]},{"as":"workflow-link","function":"dashboard-link","args":[{"value":""},{"field":"workflow-dashboard-href"},{"field":"workflow-dashboard-label"},{"field":"workflow-coordinate"}]}],"select":[{"field":"skill"},{"field":"repository-coordinate"},{"field":"workflow"},{"field":"workflow-link"},{"field":"invocations"}],"order-by":[{"field":"invocations","direction":"desc"},{"field":"skill","direction":"asc"},{"field":"workflow","direction":"asc"}]},{"name":"experiment-assignment-coverage","subject":"Count observed run assignments for each experiment and workflow without inferring a completion target.","objective":"Expose assignment counts by experiment and workflow for investigating observed experiment coverage.","acceptance":"Count retained assignment rows in each experiment/workflow group, not distinct runs; do not invent a target, infer missing assignments from absent groups, or treat assignments as eval or grader outcomes.","from":"experiment-assignments","compute":[{"as":"workflow-coordinate","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"},{"value":":"},{"field":"workflow"}]}],"aggregate":{"by":["workflow-coordinate","experiment"],"values":[{"field":"run","as":"assignments","reducer":"count"}]}},{"name":"eval-status-ledger","subject":"Inspect every explicitly classified eval answer, including UNKNOWN.","objective":"Expose retained eval observations with their workflow, run evidence and observation time.","acceptance":"Keep recorded YES, NO and UNKNOWN answers distinct; unknown or absent evidence must not imply success or failure, and historical answers are not current verdicts or validated operational outcomes.","from":"eval-observations","compute":[{"as":"_recorded-run-href","function":"link-href","args":[{"field":"evidence-link"}]},{"as":"_eval-run-href","function":"coalesce","args":[{"field":"_recorded-run-href"},{"field":"evidence-link"}]},{"as":"run-link","function":"link","args":[{"field":"_eval-run-href"},{"field":"run"}]}],"filter":{"predicates":[{"field":"eval-result","in":["YES","NO","UNKNOWN"]}]}},{"name":"eval-answer-counts","subject":"Count recorded YES, NO and UNKNOWN answers for each workflow-scoped eval.","objective":"Provide complete answer denominators before expanding each eval into three bars.","acceptance":"Keep canonical eval identities separate and count only explicitly classified observations. Select at most 33 complete eval groups, never truncate an answer group.","from":"eval-status-ledger","aggregate":{"by":["organization","repository","workflow","eval"],"values":[{"field":"eval-result","as":"answers","reducer":"count"},{"field":"eval-result","as":"yes","reducer":"count","filter":{"predicates":[{"field":"eval-result","equals":"YES"}]}},{"field":"eval-result","as":"no","reducer":"count","filter":{"predicates":[{"field":"eval-result","equals":"NO"}]}},{"field":"eval-result","as":"unknown","reducer":"count","filter":{"predicates":[{"field":"eval-result","equals":"UNKNOWN"}]}}]},"order-by":[{"field":"eval","direction":"asc"},{"field":"organization","direction":"asc"},{"field":"repository","direction":"asc"},{"field":"workflow","direction":"asc"}],"limit":33},{"name":"eval-yes-shares","subject":"Compute the YES share of each eval's recorded answers.","objective":"Expose recorded YES proportions for comparing answer categories without inferring verified operational outcomes.","acceptance":"Emit one YES row per retained canonical eval group, including zero YES counts; answer-share is yes / answers across recorded YES, NO and UNKNOWN observations. Do not count absent observations.","from":"eval-answer-counts","compute":[{"as":"eval-result","function":"literal","args":[{"value":"YES"}]},{"as":"answer-order","function":"literal","args":[{"value":0}]},{"as":"answer-share","function":"quotient","args":[{"field":"yes"},{"field":"answers"}]}]},{"name":"eval-no-shares","subject":"Compute the NO share of each eval's recorded answers.","objective":"Expose recorded NO proportions for comparing answer categories without treating historical answers as current verdicts.","acceptance":"Emit one NO row per retained canonical eval group, including zero NO counts; answer-share is no / answers across recorded YES, NO and UNKNOWN observations. Do not count absent observations.","from":"eval-answer-counts","compute":[{"as":"eval-result","function":"literal","args":[{"value":"NO"}]},{"as":"answer-order","function":"literal","args":[{"value":1}]},{"as":"answer-share","function":"quotient","args":[{"field":"no"},{"field":"answers"}]}]},{"name":"eval-unknown-shares","subject":"Compute the explicit UNKNOWN share of each eval's recorded answers.","objective":"Expose explicitly recorded UNKNOWN proportions without conflating absent observations with classified uncertainty.","acceptance":"Emit one UNKNOWN row per retained canonical eval group, including zero UNKNOWN counts; answer-share is unknown / answers across recorded YES, NO and UNKNOWN observations. Missing observations are not UNKNOWN answers.","from":"eval-answer-counts","compute":[{"as":"eval-result","function":"literal","args":[{"value":"UNKNOWN"}]},{"as":"answer-order","function":"literal","args":[{"value":2}]},{"as":"answer-share","function":"quotient","args":[{"field":"unknown"},{"field":"answers"}]}]},{"name":"eval-answer-distribution","subject":"Compare YES, NO and UNKNOWN percentages within each eval.","objective":"Show three horizontal bars per eval that together account for all recorded answers.","acceptance":"Emit all three answer categories, including zero shares; percentages sum to 100 per canonical eval. Missing observations are not UNKNOWN answers. Preserve workflow and repository attribution.","from":"eval-yes-shares","union":["eval-no-shares","eval-unknown-shares"],"compute":[{"as":"answer-percent","function":"product","args":[{"field":"answer-share"},{"value":100}]},{"as":"eval-label","function":"concat","args":[{"field":"eval"},{"value":" | "},{"field":"organization"},{"value":"/"},{"field":"repository"},{"value":":"},{"field":"workflow"}]}],"order-by":[{"field":"eval-label","direction":"asc"},{"field":"answer-order","direction":"asc"}]},{"name":"grader-observed-maxima","subject":"Find each workflow-scoped grader's maximum retained value in the selected data.","objective":"Provide an observed normalization denominator without mixing grader identities or claiming a theoretical maximum.","acceptance":"Group by canonical grader identity, not display name; ignore missing values and preserve zero or negative maxima without substituting a denominator.","from":"grader-observations","aggregate":{"by":["grader-id"],"values":[{"field":"value","as":"max-grader-value","reducer":"max"}]}},{"name":"grader-normalized-observations","subject":"Normalize each grader observation by that grader's observed maximum.","objective":"Compare relative grader values over time while preserving native measurements and run provenance.","acceptance":"Compute value / max-grader-value without clamping or inverting lower-is-better measures; zero or missing denominators produce null, never a fabricated zero or infinity.","from":"grader-observations","joins":[{"source":"grader-observed-maxima","type":"left","on":[{"left":"grader-id","right":"grader-id"}],"fields":[{"field":"max-grader-value","as":"max-grader-value"}]}],"compute":[{"as":"normalized-value","function":"quotient","args":[{"field":"value"},{"field":"max-grader-value"}]},{"as":"_observation-time","function":"timestamp","args":[{"field":"observed-at"}]},{"as":"_unplottable-value","function":"equals-any","args":[{"field":"normalized-value"},{"value":null}]},{"as":"_unplottable-time","function":"equals-any","args":[{"field":"_observation-time"},{"value":null}]},{"as":"grader-series","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"},{"value":" / "},{"field":"workflow"},{"value":" / "},{"field":"grader"}]}]},{"name":"grader-value-scatter","subject":"Plot timed grader observations with a defined value-to-observed-maximum ratio.","objective":"Show relative grader measurements at their recorded observation times.","acceptance":"Keep each eligible observation and its run link; omit missing ratios or observation times from the plot while retaining those records in the native-value ledger. Ratios are not eval answers or evidence of improvement.","from":"grader-normalized-observations","filter":{"predicates":[{"field":"_unplottable-value","equals":false},{"field":"_unplottable-time","equals":false}]},"order-by":[{"field":"observed-at","direction":"asc"}]},{"name":"grader-status-ledger","subject":"Report grader measurements, units and explicit statuses without confusing them with binary eval answers.","objective":"Preserve numeric grader evidence and distinguish explicit per-observation pass and fail verdicts from unknown statuses.","acceptance":"Retain native grader values, units and statuses. Map only pass/passed to YES and fail/failed to NO in the auxiliary verdict field, leaving all other statuses unknown; never infer an eval answer, current success, causation or policy authority from a grader score.","from":"grader-observations","compute":[{"as":"is-pass","function":"equals-any","args":[{"field":"status"},{"value":"pass"},{"value":"passed"}]},{"as":"is-fail","function":"equals-any","args":[{"field":"status"},{"value":"fail"},{"value":"failed"}]},{"as":"non-pass-verdict","function":"if","args":[{"field":"is-fail"},{"value":"NO"},{"value":"unknown"}]},{"as":"verdict","function":"if","args":[{"field":"is-pass"},{"value":"YES"},{"field":"non-pass-verdict"}]}]},{"name":"routing-session-observations","subject":"Read metadata-only unified-session routing evidence.","objective":"Keep routing analytics independent of native logs and inferred run totals.","acceptance":"Only recognized session events contribute; event clocks remain absent when unrecorded.","from":"audits","filter":{"predicates":[{"field":"event-type","in":["session.format","workflow.info","workflow.job_result","agent.execution","firewall.model_routing","firewall.token_usage","usage.report","firewall.steering","firewall.upstream_error","model.config","model.baseline_estimate","model.resolution","model_routing.outcome","model_endpoint.mismatch","session.collection","session.collection_warning","subagent.request","subagent.started","subagent.configured","subagent.completed","subagent.failed","subagent.model_unavailable"]}]},"compute":[{"as":"record-clock","function":"timestamp","args":[{"field":"event-timestamp"}]},{"as":"event-clock","function":"coalesce","args":[{"field":"routing-session-clock"},{"field":"record-clock"}]},{"as":"routing-run-key","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"},{"value":":"},{"field":"run"}]},{"as":"agent-phase","function":"equals-any","args":[{"field":"phase"},{"value":"agent"}]},{"as":"proxy-selection","function":"equals-any","args":[{"field":"routing-stage"},{"value":"selection"}]},{"as":"proxy-failure","function":"equals-any","args":[{"field":"routing-stage"},{"value":"failure"}]},{"as":"has-agent-name","function":"greater-than","args":[{"field":"routing-agent-name"},{"value":""}]}]},{"name":"routing-session-attempts","from":"routing-session-observations","subject":"Identify available session files and their earliest recorded clocks.","objective":"Keep rerun attempts from multiplying routing denominators.","acceptance":"Attempt order is only a tie-breaker after the recorded session clock.","aggregate":{"by":["routing-run-key","run-attempt"],"values":[{"field":"event-clock","as":"session-clock","reducer":"min"}]}},{"name":"routing-session-order","from":"routing-session-attempts","subject":"Order duplicate run sessions by run time and attempt.","objective":"Keep the latest file for each repository/run identity.","acceptance":"Only one attempt contributes to routing facts.","window":[{"operation":"row-number","field":"run-attempt","as":"session-position","groupby":["routing-run-key"],"order-by":[{"field":"session-clock","direction":"desc"},{"field":"run-attempt","direction":"desc"}]}]},{"name":"routing-latest-sessions","from":"routing-session-order","subject":"Retain one authoritative session attempt per run.","objective":"Avoid mixing picks or accounting from reruns.","acceptance":"Duplicate attempts remain available in session coverage.","filter":{"predicates":[{"field":"session-position","equals":1}]}},{"name":"routing-session-events","from":"routing-session-observations","subject":"Read routing metadata from the latest session file per run.","objective":"Deduplicate rerun attempts before any metric.","acceptance":"Earlier attempts never add cost or change the selected pick.","joins":[{"source":"routing-latest-sessions","type":"inner","on":[{"left":"routing-run-key","right":"routing-run-key"},{"left":"run-attempt","right":"run-attempt"}],"fields":[{"field":"session-clock","as":"session-clock"}]}]},{"name":"routing-run-facts","subject":"Collect per-session source facts without interpreting absence as success.","objective":"Resolve routing states and coverage from runner and proxy evidence.","acceptance":"Agent-phase proxy selection wins over failure and harness status; untimed observations keep unknown time.","from":"routing-session-events","aggregate":{"by":["routing-run-key","organization","repository","workflow","run"],"values":[{"field":"event-clock","as":"run-clock","reducer":"min"},{"field":"run-link","as":"run-link","reducer":"unique"},{"field":"engine","as":"engine","reducer":"unique"},{"field":"event","as":"workflow-info-count","reducer":"count","filter":{"predicates":[{"field":"event-type","equals":"workflow.info"},{"field":"required","equals":true}]}},{"field":"event-status","as":"session-format","reducer":"unique","filter":{"predicates":[{"field":"event-type","equals":"session.format"}]}},{"field":"event","as":"selection-count","reducer":"count","filter":{"predicates":[{"field":"event-type","equals":"firewall.model_routing"},{"field":"routing-stage","equals":"selection"},{"field":"phase","equals":"agent"}]}},{"field":"event","as":"failure-count","reducer":"count","filter":{"predicates":[{"field":"event-type","equals":"firewall.model_routing"},{"field":"routing-stage","equals":"failure"},{"field":"phase","equals":"agent"}]}},{"field":"event","as":"local-effort-failures","reducer":"count","filter":{"predicates":[{"field":"event-type","equals":"firewall.model_routing"},{"field":"routing-stage","equals":"failure"},{"field":"code","equals":"unsupported_reasoning_effort"}]}},{"field":"event","as":"proxy-record-count","reducer":"count","filter":{"predicates":[{"field":"event-type","equals":"firewall.model_routing"},{"field":"phase","equals":"agent"}]}},{"field":"event","as":"agent-accounting-count","reducer":"count","filter":{"predicates":[{"field":"event-type","equals":"firewall.token_usage"},{"field":"phase","equals":"agent"}]}},{"field":"event","as":"subagent-count","reducer":"count","filter":{"predicates":[{"field":"event-type","in":["subagent.started","subagent.request","subagent.configured","subagent.completed","subagent.failed","subagent.model_unavailable"]}]}},{"field":"routing-status","as":"harness-status","reducer":"unique","filter":{"predicates":[{"field":"event-type","equals":"workflow.info"}]}},{"field":"routing-enabled","as":"configured-enabled","reducer":"unique","filter":{"predicates":[{"field":"event-type","equals":"model.config"}]}},{"field":"routing-selected-model","as":"harness-model","reducer":"unique","filter":{"predicates":[{"field":"event-type","equals":"workflow.info"}]}},{"field":"telemetry-model","as":"workflow-model","reducer":"unique","filter":{"predicates":[{"field":"event-type","equals":"workflow.info"}]}},{"field":"routing-selected-effort","as":"harness-effort","reducer":"unique","filter":{"predicates":[{"field":"event-type","equals":"workflow.info"}]}},{"field":"routing-mode","as":"harness-mode","reducer":"unique","filter":{"predicates":[{"field":"event-type","equals":"workflow.info"}]}},{"field":"routing-awf-version","as":"session-awf-version","reducer":"unique","filter":{"predicates":[{"field":"event-type","equals":"workflow.info"}]}},{"field":"routing-goal","as":"configured-goal","reducer":"unique","filter":{"predicates":[{"field":"event-type","equals":"model.config"}]}},{"field":"routing-configured-mode","as":"configured-routing-mode","reducer":"unique","filter":{"predicates":[{"field":"event-type","equals":"model.config"}]}},{"field":"routing-max-credits","as":"configured-max-credits","reducer":"unique","filter":{"predicates":[{"field":"event-type","equals":"model.config"}]}},{"field":"event-status","as":"agent-result","reducer":"unique","filter":{"predicates":[{"field":"event-type","equals":"workflow.job_result"},{"field":"name","equals":"agent"},{"field":"event-status","in":["success","failure","cancelled","skipped"]}]}},{"field":"event","as":"warnings","reducer":"count","filter":{"predicates":[{"field":"event-type","equals":"session.collection_warning"}]}}]}},{"name":"routing-ordered-selections","subject":"Order proxy selections within each session.","objective":"Use the last selection by normalized clock and file order.","acceptance":"Harness and advisory picks never override proxy selections.","from":"routing-session-events","filter":{"predicates":[{"field":"event-type","equals":"firewall.model_routing"},{"field":"routing-stage","equals":"selection"},{"field":"phase","equals":"agent"}]},"window":[{"operation":"row-number","field":"source-sequence","as":"selection-position","groupby":["routing-run-key"],"order-by":[{"field":"event-timestamp","direction":"desc"},{"field":"source-sequence","direction":"desc"}]}]},{"name":"routing-selections","subject":"Retain one authoritative proxy pick per run.","objective":"Avoid multiplying requests or run counts after re-selection.","acceptance":"One row per identified run uses the final proxy selection.","from":"routing-ordered-selections","filter":{"predicates":[{"field":"selection-position","equals":1}]}},{"name":"routing-resolved-runs","subject":"Resolve routing state, pick and label cells from unified sessions.","objective":"Distinguish selected, failed, harness-only, configured, inferred and unknown evidence.","acceptance":"Proxy evidence wins; configuration conflicts are visible; missing picks and time remain unknown.","from":"routing-run-facts","joins":[{"source":"routing-selections","type":"left","on":[{"left":"routing-run-key","right":"routing-run-key"}],"fields":[{"field":"routing-selected-model","as":"proxy-model"},{"field":"routing-selected-effort","as":"proxy-effort"},{"field":"routing-goal","as":"proxy-goal"},{"field":"routing-mode","as":"proxy-mode"},{"field":"routing-configured-mode","as":"proxy-configured-mode"},{"field":"routing-task-type","as":"routing-task-type"},{"field":"routing-scope","as":"routing-scope"},{"field":"routing-complexity","as":"routing-complexity"},{"field":"routing-latency-ms","as":"routing-latency-ms"},{"field":"routing-degraded","as":"routing-degraded"},{"field":"routing-classifier-attempts","as":"routing-classifier-attempts"},{"field":"routing-classifier-model","as":"routing-classifier-model"},{"field":"routing-classifier-effort","as":"routing-classifier-effort"},{"field":"routing-schema","as":"routing-schema"},{"field":"routing-awf-version","as":"proxy-awf-version"},{"field":"routing-router-version","as":"routing-router-version"}]}],"compute":[{"as":"observed-at","function":"iso-timestamp","args":[{"field":"run-clock"}]},{"as":"routing-awf-version","function":"coalesce","args":[{"field":"session-awf-version"},{"field":"proxy-awf-version"}]},{"as":"routing-mode","function":"coalesce","args":[{"field":"proxy-mode"},{"field":"harness-mode"}]},{"as":"routing-goal","function":"coalesce","args":[{"field":"proxy-goal"},{"field":"configured-goal"}]},{"as":"routing-configured-mode","function":"coalesce","args":[{"field":"proxy-configured-mode"},{"field":"configured-routing-mode"}]},{"as":"has-selection","function":"greater-than","args":[{"field":"selection-count"},{"value":0}]},{"as":"has-failure","function":"greater-than","args":[{"field":"failure-count"},{"value":0}]},{"as":"has-harness","function":"equals-any","args":[{"field":"harness-status"},{"value":null}]},{"as":"has-usage","function":"greater-than","args":[{"field":"agent-accounting-count"},{"value":0}]},{"as":"no-proxy","function":"equals-any","args":[{"field":"proxy-record-count"},{"value":0}]},{"as":"usage-state","function":"if","args":[{"field":"has-usage"},{"value":"unrouted_inferred"},{"value":"unknown"}]},{"as":"inferred-state","function":"if","args":[{"field":"no-proxy"},{"field":"usage-state"},{"value":"unknown"}]},{"as":"enabled","function":"equals-any","args":[{"field":"configured-enabled"},{"value":true}]},{"as":"disabled","function":"equals-any","args":[{"field":"configured-enabled"},{"value":false}]},{"as":"enabled-state","function":"if","args":[{"field":"enabled"},{"value":"configured_unrecorded"},{"field":"inferred-state"}]},{"as":"configured-state","function":"if","args":[{"field":"disabled"},{"value":"unrouted"},{"field":"enabled-state"}]},{"as":"reported-state","function":"if","args":[{"field":"has-harness"},{"field":"configured-state"},{"value":"harness_reported"}]},{"as":"failure-state","function":"if","args":[{"field":"has-failure"},{"value":"selection_failed"},{"field":"reported-state"}]},{"as":"routing-state","function":"if","args":[{"field":"has-selection"},{"value":"selected"},{"field":"failure-state"}]},{"as":"observed-pick-model","function":"if","args":[{"field":"has-selection"},{"field":"proxy-model"},{"field":"harness-model"}]},{"as":"observed-pick-effort","function":"if","args":[{"field":"has-selection"},{"field":"proxy-effort"},{"field":"harness-effort"}]},{"as":"pick-model","function":"coalesce","args":[{"field":"observed-pick-model"},{"value":"unknown"}]},{"as":"pick-effort","function":"coalesce","args":[{"field":"observed-pick-effort"},{"value":"unknown"}]},{"as":"pick","function":"concat","args":[{"field":"pick-model"},{"value":" / "},{"field":"pick-effort"}]},{"as":"has-proxy-decision","function":"if","args":[{"field":"has-selection"},{"value":true},{"field":"has-failure"}]},{"as":"has-decision","function":"if","args":[{"field":"has-harness"},{"field":"has-proxy-decision"},{"value":true}]},{"as":"configuration-conflict","function":"if","args":[{"field":"disabled"},{"field":"has-decision"},{"value":false}]},{"as":"unknown-pick-model","function":"equals-any","args":[{"field":"pick-model"},{"value":"unknown"}]},{"as":"unknown-pick-effort","function":"equals-any","args":[{"field":"pick-effort"},{"value":"unknown"}]},{"as":"unknown-pick","function":"if","args":[{"field":"unknown-pick-model"},{"value":true},{"field":"unknown-pick-effort"}]},{"as":"routing-key-encoded","function":"url-encode","args":[{"field":"routing-run-key"}]},{"as":"routing-href","function":"concat","args":[{"value":"#page-routing-run?routing-run="},{"field":"routing-key-encoded"}]},{"as":"routing-dashboard-link","function":"dashboard-link","args":[{"field":"run-link"},{"field":"routing-href"},{"field":"run"}]}],"filter":{"predicates":[{"field":"workflow-info-count","gte":1}]}},{"name":"routing-filter-candidates","from":"routing-aggregates","subject":"Apply one run-level scope before every routing metric and event join.","objective":"Filter complete sessions, never fragments of their evidence.","acceptance":"Unknown run time is excluded from a bounded range; blank filters retain all known values.","parameters":[{"name":"routing-filter-workflow","type":"string"},{"name":"routing-filter-repository","type":"string"},{"name":"routing-filter-engine","type":"string"},{"name":"routing-filter-state","type":"string"},{"name":"routing-filter-goal","type":"string"},{"name":"routing-filter-mode","type":"string"},{"name":"routing-filter-awf","type":"string"},{"name":"routing-filter-start","type":"string"},{"name":"routing-filter-end","type":"string"}],"compute":[{"as":"full-repository","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"}]},{"as":"all-workflows","function":"equals-any","args":[{"parameter":"routing-filter-workflow"},{"value":""}]},{"as":"same-workflow","function":"equals-any","args":[{"field":"workflow"},{"parameter":"routing-filter-workflow"}]},{"as":"include-workflow","function":"if","args":[{"field":"all-workflows"},{"value":true},{"field":"same-workflow"}]},{"as":"all-repositories","function":"equals-any","args":[{"parameter":"routing-filter-repository"},{"value":""}]},{"as":"same-repository","function":"equals-any","args":[{"field":"full-repository"},{"parameter":"routing-filter-repository"}]},{"as":"include-repository","function":"if","args":[{"field":"all-repositories"},{"value":true},{"field":"same-repository"}]},{"as":"all-engines","function":"equals-any","args":[{"parameter":"routing-filter-engine"},{"value":""}]},{"as":"same-engine","function":"equals-any","args":[{"field":"engine"},{"parameter":"routing-filter-engine"}]},{"as":"include-engine","function":"if","args":[{"field":"all-engines"},{"value":true},{"field":"same-engine"}]},{"as":"all-states","function":"equals-any","args":[{"parameter":"routing-filter-state"},{"value":""}]},{"as":"same-state","function":"equals-any","args":[{"field":"routing-state"},{"parameter":"routing-filter-state"}]},{"as":"include-state","function":"if","args":[{"field":"all-states"},{"value":true},{"field":"same-state"}]},{"as":"all-goals","function":"equals-any","args":[{"parameter":"routing-filter-goal"},{"value":""}]},{"as":"same-goal","function":"equals-any","args":[{"field":"routing-goal"},{"parameter":"routing-filter-goal"}]},{"as":"include-goal","function":"if","args":[{"field":"all-goals"},{"value":true},{"field":"same-goal"}]},{"as":"all-modes","function":"equals-any","args":[{"parameter":"routing-filter-mode"},{"value":""}]},{"as":"same-mode","function":"equals-any","args":[{"field":"routing-mode"},{"parameter":"routing-filter-mode"}]},{"as":"include-mode","function":"if","args":[{"field":"all-modes"},{"value":true},{"field":"same-mode"}]},{"as":"all-awf","function":"equals-any","args":[{"parameter":"routing-filter-awf"},{"value":""}]},{"as":"same-awf","function":"equals-any","args":[{"field":"routing-awf-version"},{"parameter":"routing-filter-awf"}]},{"as":"include-awf","function":"if","args":[{"field":"all-awf"},{"value":true},{"field":"same-awf"}]},{"as":"all-starts","function":"equals-any","args":[{"parameter":"routing-filter-start"},{"value":""}]},{"as":"start-clock","function":"timestamp","args":[{"parameter":"routing-filter-start"}]},{"as":"start-before","function":"difference","args":[{"field":"start-clock"},{"value":1}]},{"as":"after-start","function":"greater-than","args":[{"field":"run-clock"},{"field":"start-before"}]},{"as":"include-start","function":"if","args":[{"field":"all-starts"},{"value":true},{"field":"after-start"}]},{"as":"all-ends","function":"equals-any","args":[{"parameter":"routing-filter-end"},{"value":""}]},{"as":"end-clock","function":"timestamp","args":[{"parameter":"routing-filter-end"}]},{"as":"before-end","function":"greater-than","args":[{"field":"end-clock"},{"field":"run-clock"}]},{"as":"include-end","function":"if","args":[{"field":"all-ends"},{"value":true},{"field":"before-end"}]}]},{"name":"routing-runs","from":"routing-filter-candidates","subject":"Retain identified runs matching every selected routing filter.","objective":"Use the same population for adoption, accounting and outcomes.","acceptance":"A time bound excludes untimed runs and does not remove individual events from retained sessions.","filter":{"predicates":[{"field":"include-workflow","equals":true},{"field":"include-repository","equals":true},{"field":"include-engine","equals":true},{"field":"include-state","equals":true},{"field":"include-goal","equals":true},{"field":"include-mode","equals":true},{"field":"include-awf","equals":true},{"field":"include-start","equals":true},{"field":"include-end","equals":true}]}},{"name":"routing-events","from":"routing-session-events","subject":"Retain all evidence belonging to scoped identified runs.","objective":"Filter event metrics by the resolved run rather than by individual event clocks.","acceptance":"State, pick and accounting are computed before the scope is applied.","joins":[{"source":"routing-runs","type":"inner","on":[{"left":"routing-run-key","right":"routing-run-key"}],"fields":[{"field":"routing-state","as":"run-routing-state"}]}]},{"name":"routing-phase-sources","subject":"Choose one nonoverlapping accounting source per run and phase.","objective":"Prefer proxy token usage over usage reports.","acceptance":"Snapshot totals and cumulative totalAic never enter additive cost.","from":"routing-events","aggregate":{"by":["routing-run-key","phase"],"values":[{"field":"event","as":"proxy-usage-count","reducer":"count","filter":{"predicates":[{"field":"event-type","equals":"firewall.token_usage"}]}},{"field":"event","as":"report-usage-count","reducer":"count","filter":{"predicates":[{"field":"event-type","equals":"usage.report"}]}},{"field":"event","as":"proxy-source-count","reducer":"count","filter":{"predicates":[{"field":"event-type","equals":"session.collection"},{"field":"name","equals":"token-usage.jsonl"},{"field":"event-status","equals":"collected"}]}},{"field":"event","as":"report-source-count","reducer":"count","filter":{"predicates":[{"field":"event-type","equals":"session.collection"},{"field":"name","in":["agent_usage.json","usage.json","usage.jsonl","usage-report.jsonl"]},{"field":"event-status","equals":"collected"}]}}]}},{"name":"routing-accounting-candidates","subject":"Read nonoverlapping per-response accounting records.","objective":"Expose recorded credits and token classes without repricing unknown usage.","acceptance":"Each phase uses proxy accounting when present and usage.report otherwise; absent AIC is counted.","from":"routing-events","joins":[{"source":"routing-phase-sources","type":"left","on":[{"left":"routing-run-key","right":"routing-run-key"},{"left":"phase","right":"phase"}],"fields":[{"field":"proxy-usage-count","as":"proxy-usage-count"}]}],"compute":[{"as":"has-proxy-accounting","function":"greater-than","args":[{"field":"proxy-usage-count"},{"value":0}]},{"as":"accounting-identity","function":"coalesce","args":[{"field":"correlation-id"},{"field":"event"}]},{"as":"accounting-source","function":"if","args":[{"field":"has-proxy-accounting"},{"value":"firewall.token_usage"},{"value":"usage.report"}]},{"as":"selected-accounting","function":"equals-any","args":[{"field":"event-type"},{"field":"accounting-source"}]},{"as":"unknown-aic","function":"equals-any","args":[{"field":"aic"},{"value":null}]},{"as":"unknown-aic-count","function":"if","args":[{"field":"unknown-aic"},{"value":1},{"value":0}]}],"window":[{"operation":"row-number","field":"source-sequence","as":"accounting-position","groupby":["routing-run-key","phase","event-type","accounting-identity"],"order-by":[{"field":"event-timestamp","direction":"desc"},{"field":"source-sequence","direction":"desc"}]}]},{"name":"routing-accounting","subject":"Select the authoritative accounting source for each phase.","objective":"Exclude overlapping usage reports and snapshots.","acceptance":"Every accounting row contributes at most once.","from":"routing-accounting-candidates","filter":{"predicates":[{"field":"selected-accounting","equals":true},{"field":"accounting-position","equals":1},{"field":"phase","in":["agent","detection","evals"]}]}},{"name":"routing-request-candidates","subject":"Keep per-request routing decisions separate from accounting.","objective":"Join routed outcomes by run, phase and request ID.","acceptance":"Rejected requests establish local zero cost; other unmatched requests retain unknown cost.","from":"routing-events","filter":{"predicates":[{"field":"event-type","equals":"firewall.model_routing"},{"field":"routing-stage","equals":"request"}]},"compute":[{"as":"request-identity","function":"coalesce","args":[{"field":"correlation-id"},{"field":"event"}]}],"window":[{"operation":"row-number","field":"source-sequence","as":"request-position","groupby":["routing-run-key","phase","request-identity"],"order-by":[{"field":"event-timestamp","direction":"desc"},{"field":"source-sequence","direction":"desc"}]}]},{"name":"routing-request-records","from":"routing-request-candidates","subject":"Retain the latest record for each request identity.","objective":"Avoid duplicate request joins and overlapping totals.","acceptance":"Requests without IDs remain independent, not falsely correlated.","filter":{"predicates":[{"field":"request-position","equals":1}]}},{"name":"routing-subagent-candidates","subject":"Read engine-reported sub-agent request ownership.","objective":"Use exact request-ID ownership before falling back to unsplit traffic.","acceptance":"Only request identities can assign exact ownership; advisory outcomes never assign credits.","from":"routing-events","filter":{"predicates":[{"field":"event-type","equals":"subagent.request"}]},"compute":[{"as":"subagent-identity","function":"coalesce","args":[{"field":"correlation-id"},{"field":"event"}]}],"window":[{"operation":"row-number","field":"source-sequence","as":"subagent-position","groupby":["routing-run-key","phase","subagent-identity"],"order-by":[{"field":"event-timestamp","direction":"desc"},{"field":"source-sequence","direction":"desc"}]}]},{"name":"routing-subagent-requests","from":"routing-subagent-candidates","subject":"Retain one sub-agent observation per request identity.","objective":"Keep exact ownership joins unique.","acceptance":"Missing identities do not match unrelated requests.","filter":{"predicates":[{"field":"subagent-position","equals":1}]}},{"name":"routing-exact-accounting","subject":"Attribute each accounting record to exactly one traffic bucket.","objective":"Keep detection, evals, classifier, exact sub-agent, main, unsplit and unattributed credits distinct.","acceptance":"Detection and evals use phase, missing purpose is never agent by default, and snapshot credits are excluded.","from":"routing-accounting","joins":[{"source":"routing-request-records","type":"left","on":[{"left":"routing-run-key","right":"routing-run-key"},{"left":"phase","right":"phase"},{"left":"correlation-id","right":"correlation-id"}],"fields":[{"field":"event","as":"request-event"},{"field":"routing-routed","as":"request-routed"},{"field":"routing-deviations","as":"request-deviations"},{"field":"routing-outcome","as":"request-outcome"},{"field":"routing-requested-model","as":"request-model"},{"field":"routing-requested-effort","as":"request-effort"}]},{"source":"routing-subagent-requests","type":"left","on":[{"left":"routing-run-key","right":"routing-run-key"},{"left":"phase","right":"phase"},{"left":"correlation-id","right":"correlation-id"}],"fields":[{"field":"routing-agent-name","as":"exact-agent-name"}]},{"source":"routing-run-facts","type":"left","on":[{"left":"routing-run-key","right":"routing-run-key"}],"fields":[{"field":"subagent-count","as":"subagent-count"}]}],"compute":[{"as":"exact-owner","function":"coalesce","args":[{"field":"routing-agent-name"},{"field":"exact-agent-name"}]},{"as":"no-exact-owner","function":"equals-any","args":[{"field":"exact-owner"},{"value":null}]}]},{"name":"routing-correlation-usage-candidates","from":"routing-exact-accounting","subject":"Find accounting records without exact sub-agent ownership.","objective":"Correlate only fully recorded token quartets in file order.","acceptance":"Missing token classes never match by model alone.","filter":{"predicates":[{"field":"phase","equals":"agent"},{"field":"no-exact-owner","equals":true}]},"compute":[{"as":"token-quartet","function":"sum","args":[{"field":"input-tokens"},{"field":"output-tokens"},{"field":"cache-read-tokens"},{"field":"cache-write-tokens"}]},{"as":"is-classifier","function":"equals-any","args":[{"field":"routing-purpose"},{"value":"routing_classification"}]}]},{"name":"routing-correlation-usage","from":"routing-correlation-usage-candidates","subject":"Order unmatched accounting within model and token quartet.","objective":"Match each engine-reported request at most once.","acceptance":"Classifier, incomplete and already-exact requests are excluded.","filter":{"predicates":[{"field":"token-quartet","gte":0},{"field":"is-classifier","equals":false}]},"window":[{"operation":"row-number","field":"source-sequence","as":"correlation-position","groupby":["routing-run-key","telemetry-model","input-tokens","output-tokens","cache-read-tokens","cache-write-tokens"],"order-by":[{"field":"source-sequence","direction":"asc"}]}]},{"name":"routing-correlation-subagent-candidates","from":"routing-subagent-requests","subject":"Exclude engine requests already matched by proxy request ID.","objective":"Prevent exact and correlated ownership from claiming the same request.","acceptance":"Only engine requests with a complete quartet and a definition name can correlate.","joins":[{"source":"routing-accounting","type":"left","on":[{"left":"routing-run-key","right":"routing-run-key"},{"left":"phase","right":"phase"},{"left":"correlation-id","right":"correlation-id"}],"fields":[{"field":"event","as":"exact-accounting-event"}]}],"compute":[{"as":"token-quartet","function":"sum","args":[{"field":"input-tokens"},{"field":"output-tokens"},{"field":"cache-read-tokens"},{"field":"cache-write-tokens"}]}]},{"name":"routing-correlation-subagents","from":"routing-correlation-subagent-candidates","subject":"Order unmatched engine requests within each model/token quartet.","objective":"Produce deterministic one-to-one correlated ownership.","acceptance":"Correlation is labelled separately from exact evidence.","filter":{"predicates":[{"field":"exact-accounting-event","equals":null},{"field":"token-quartet","gte":0},{"field":"phase","equals":"agent"}]},"window":[{"operation":"row-number","field":"source-sequence","as":"correlation-position","groupby":["routing-run-key","telemetry-model","input-tokens","output-tokens","cache-read-tokens","cache-write-tokens"],"order-by":[{"field":"source-sequence","direction":"asc"}]}]},{"name":"routing-correlated-accounting","from":"routing-correlation-usage","subject":"Join proxy usage with unmatched engine requests by model, quartet and occurrence.","objective":"Use the spec's correlated sub-agent attribution without duplicating credits.","acceptance":"Each engine request and accounting record participates at most once.","joins":[{"source":"routing-correlation-subagents","type":"left","on":[{"left":"routing-run-key","right":"routing-run-key"},{"left":"telemetry-model","right":"telemetry-model"},{"left":"input-tokens","right":"input-tokens"},{"left":"output-tokens","right":"output-tokens"},{"left":"cache-read-tokens","right":"cache-read-tokens"},{"left":"cache-write-tokens","right":"cache-write-tokens"},{"left":"correlation-position","right":"correlation-position"}],"fields":[{"field":"routing-agent-name","as":"correlated-owner"}]}],"select":[{"field":"routing-run-key"},{"field":"event"},{"field":"correlated-owner"}]},{"name":"routing-attributed-accounting","from":"routing-exact-accounting","subject":"Assign every accounting record to exactly one exclusive bucket.","objective":"Keep exact and correlated sub-agent ownership distinct.","acceptance":"Phase wins over purpose; missing ownership remains unsplit or unattributed.","joins":[{"source":"routing-correlated-accounting","type":"left","on":[{"left":"routing-run-key","right":"routing-run-key"},{"left":"event","right":"event"}],"fields":[{"field":"correlated-owner","as":"correlated-owner"}]}],"compute":[{"as":"agent-name","function":"coalesce","args":[{"field":"exact-owner"},{"field":"correlated-owner"}]},{"as":"unknown-agent","function":"equals-any","args":[{"field":"agent-name"},{"value":null}]},{"as":"unknown-request","function":"equals-any","args":[{"field":"request-event"},{"value":null}]},{"as":"has-subagents","function":"greater-than","args":[{"field":"subagent-count"},{"value":0}]},{"as":"is-subagent-purpose","function":"equals-any","args":[{"field":"routing-purpose"},{"value":"subagent"}]},{"as":"is-agent-purpose","function":"equals-any","args":[{"field":"routing-purpose"},{"value":"agent"}]},{"as":"matched-bucket","function":"if","args":[{"field":"has-subagents"},{"value":"agent_unsplit"},{"value":"main_agent"}]},{"as":"request-bucket","function":"if","args":[{"field":"unknown-request"},{"value":"unattributed"},{"field":"matched-bucket"}]},{"as":"subagent-bucket","function":"if","args":[{"field":"is-subagent-purpose"},{"value":"agent_unsplit"},{"field":"request-bucket"}]},{"as":"purpose-bucket","function":"if","args":[{"field":"is-agent-purpose"},{"value":"main_agent"},{"field":"subagent-bucket"}]},{"as":"subagent-attribution","function":"if","args":[{"field":"no-exact-owner"},{"value":"subagent_correlated"},{"value":"subagent_exact"}]},{"as":"ownership-bucket","function":"if","args":[{"field":"unknown-agent"},{"field":"purpose-bucket"},{"field":"subagent-attribution"}]},{"as":"classifier","function":"equals-any","args":[{"field":"routing-purpose"},{"value":"routing_classification"}]},{"as":"classifier-bucket","function":"if","args":[{"field":"classifier"},{"value":"classifier"},{"field":"ownership-bucket"}]},{"as":"evals","function":"equals-any","args":[{"field":"phase"},{"value":"evals"}]},{"as":"phase-bucket","function":"if","args":[{"field":"evals"},{"value":"evals"},{"field":"classifier-bucket"}]},{"as":"detection","function":"equals-any","args":[{"field":"phase"},{"value":"detection"}]},{"as":"bucket","function":"if","args":[{"field":"detection"},{"value":"detection"},{"field":"phase-bucket"}]}]},{"name":"routing-joined-requests","subject":"Inspect per-request deviations and outcomes against proxy picks.","objective":"Keep requests without accounting visible and never invent a deviation cause.","acceptance":"Unmatched requests have unknown cost; each request retains its own requested and selected model.","from":"routing-request-records","joins":[{"source":"routing-accounting","type":"left","on":[{"left":"routing-run-key","right":"routing-run-key"},{"left":"phase","right":"phase"},{"left":"correlation-id","right":"correlation-id"}],"fields":[{"field":"aic","as":"accounted-aic"},{"field":"event","as":"accounting-event"}]}],"compute":[{"as":"missing-accounting","function":"equals-any","args":[{"field":"accounting-event"},{"value":null}]},{"as":"failed-request","function":"equals-any","args":[{"field":"routing-outcome"},{"value":"failed"}]},{"as":"failed-unaccounted","function":"if","args":[{"field":"missing-accounting"},{"field":"failed-request"},{"value":false}]}],"order-by":[{"field":"event-timestamp","direction":"desc"}]},{"name":"routing-unaccounted-failures","from":"routing-joined-requests","subject":"Count failed requests lacking accounting per run.","objective":"Recognize only unambiguous AWF-local effort failures.","acceptance":"A run-level effort failure cannot assign zero to multiple failed requests.","aggregate":{"by":["routing-run-key"],"values":[{"field":"event","as":"failed-unaccounted-count","reducer":"count","filter":{"predicates":[{"field":"failed-unaccounted","equals":true}]}}]}},{"name":"routing-deviations","from":"routing-joined-requests","subject":"Resolve explicit local zero costs and preserve all other unknown request costs.","objective":"Avoid partial-cost comparisons based on missing accounting.","acceptance":"Only guard rejection or an unambiguous local effort failure establishes zero AIC.","joins":[{"source":"routing-unaccounted-failures","type":"left","on":[{"left":"routing-run-key","right":"routing-run-key"}],"fields":[{"field":"failed-unaccounted-count","as":"failed-unaccounted-count"}]},{"source":"routing-run-facts","type":"left","on":[{"left":"routing-run-key","right":"routing-run-key"}],"fields":[{"field":"local-effort-failures","as":"local-effort-failures"}]}],"compute":[{"as":"only-unaccounted-failure","function":"equals-any","args":[{"field":"failed-unaccounted-count"},{"value":1}]},{"as":"has-local-failure","function":"greater-than","args":[{"field":"local-effort-failures"},{"value":0}]},{"as":"unambiguous-local-failure","function":"if","args":[{"field":"only-unaccounted-failure"},{"field":"has-local-failure"},{"value":false}]},{"as":"local-code","function":"equals-any","args":[{"field":"code"},{"value":"unsupported_reasoning_effort"}]},{"as":"local-evidence","function":"if","args":[{"field":"local-code"},{"value":true},{"field":"unambiguous-local-failure"}]},{"as":"local-failure","function":"if","args":[{"field":"failed-request"},{"field":"local-evidence"},{"value":false}]},{"as":"guard-rejection","function":"equals-any","args":[{"field":"routing-outcome"},{"value":"rejected"}]},{"as":"zero-local-cost","function":"if","args":[{"field":"guard-rejection"},{"value":true},{"field":"local-failure"}]},{"as":"local-cost","function":"if","args":[{"field":"zero-local-cost"},{"value":0},{"value":null}]},{"as":"request-aic","function":"coalesce","args":[{"field":"accounted-aic"},{"field":"local-cost"}]},{"as":"unknown-request-cost","function":"equals-any","args":[{"field":"request-aic"},{"value":null}]},{"as":"unknown-request-count","function":"if","args":[{"field":"unknown-request-cost"},{"value":1},{"value":0}]}]},{"name":"routing-phase-usage","from":"routing-accounting","subject":"Sum nonoverlapping accounting per run and phase.","objective":"Establish complete costs only with known response values.","acceptance":"Unknown response costs remain counted.","aggregate":{"by":["routing-run-key","phase"],"values":[{"field":"aic","as":"recorded-aic","reducer":"sum"},{"field":"aic","as":"known-responses","reducer":"count"},{"field":"unknown-aic-count","as":"unknown-responses","reducer":"sum"}]}},{"name":"routing-request-coverage","from":"routing-deviations","subject":"Count requests whose cost remains unknown.","objective":"Exclude incomplete runs from distribution comparisons.","acceptance":"Unmatched nonlocal requests cannot be treated as free.","aggregate":{"by":["routing-run-key","phase"],"values":[{"field":"unknown-request-count","as":"unknown-requests","reducer":"sum"}]}},{"name":"routing-phase-costs","from":"routing-phase-sources","subject":"Evaluate accounting completeness using collected source receipts and request joins.","objective":"Exclude partial costs from medians and comparisons.","acceptance":"A complete phase has its selected accounting source, no missing AIC and no unaccounted nonlocal requests.","joins":[{"source":"routing-phase-usage","type":"left","on":[{"left":"routing-run-key","right":"routing-run-key"},{"left":"phase","right":"phase"}],"fields":[{"field":"recorded-aic","as":"recorded-aic"},{"field":"unknown-responses","as":"unknown-responses"},{"field":"known-responses","as":"known-responses"}]},{"source":"routing-request-coverage","type":"left","on":[{"left":"routing-run-key","right":"routing-run-key"},{"left":"phase","right":"phase"}],"fields":[{"field":"unknown-requests","as":"unknown-requests"}]}],"compute":[{"as":"has-proxy","function":"greater-than","args":[{"field":"proxy-usage-count"},{"value":0}]},{"as":"has-report","function":"greater-than","args":[{"field":"report-usage-count"},{"value":0}]},{"as":"any-source-count","function":"sum","args":[{"field":"proxy-source-count"},{"field":"report-source-count"}]},{"as":"report-or-empty-source","function":"if","args":[{"field":"has-report"},{"field":"report-source-count"},{"field":"any-source-count"}]},{"as":"accounting-source-count","function":"if","args":[{"field":"has-proxy"},{"field":"proxy-source-count"},{"field":"report-or-empty-source"}]},{"as":"source-present","function":"greater-than","args":[{"field":"accounting-source-count"},{"value":0}]},{"as":"missing-responses","function":"coalesce","args":[{"field":"unknown-responses"},{"value":0}]},{"as":"missing-requests","function":"coalesce","args":[{"field":"unknown-requests"},{"value":0}]},{"as":"missing-count","function":"sum","args":[{"field":"missing-responses"},{"field":"missing-requests"}]},{"as":"all-values-known","function":"equals-any","args":[{"field":"missing-count"},{"value":0}]},{"as":"complete","function":"if","args":[{"field":"source-present"},{"field":"all-values-known"},{"value":false}]},{"as":"known-sum","function":"coalesce","args":[{"field":"recorded-aic"},{"value":0}]},{"as":"complete-aic","function":"if","args":[{"field":"complete"},{"field":"known-sum"},{"value":null}]}]},{"name":"routing-agent-costs","from":"routing-phase-costs","subject":"Select complete or explicitly partial agent-phase costs.","objective":"Keep detection and evals out of agent-phase comparisons.","acceptance":"Classifier remains part of agent-phase cost.","filter":{"predicates":[{"field":"phase","equals":"agent"}]}},{"name":"routing-detection-costs","from":"routing-phase-costs","subject":"Retain detection-phase cost completeness separately.","objective":"Do not count detection as classifier or agent traffic.","acceptance":"Missing detection evidence remains unknown, not zero.","filter":{"predicates":[{"field":"phase","equals":"detection"}]}},{"name":"routing-cost-runs","from":"routing-resolved-runs","subject":"Attach accounting completeness to identified routing runs.","objective":"Provide comparable costs only for complete runs.","acceptance":"An absent cost stays unknown and never inherits aggregate run AIC.","joins":[{"source":"routing-runs","type":"inner","on":[{"left":"routing-run-key","right":"routing-run-key"}],"fields":[{"field":"main-aic","as":"main-aic"},{"field":"baseline-model","as":"baseline-model"},{"field":"baseline-aic","as":"baseline-aic"},{"field":"baseline-complete","as":"baseline-complete"}]},{"source":"routing-agent-costs","type":"left","on":[{"left":"routing-run-key","right":"routing-run-key"}],"fields":[{"field":"complete-aic","as":"complete-aic"},{"field":"complete","as":"cost-complete"},{"field":"missing-count","as":"missing-cost-records"}]},{"source":"routing-detection-costs","type":"left","on":[{"left":"routing-run-key","right":"routing-run-key"}],"fields":[{"field":"complete-aic","as":"detection-aic"},{"field":"complete","as":"detection-complete"}]}],"compute":[{"as":"run-cost-complete","function":"if","args":[{"field":"cost-complete"},{"field":"detection-complete"},{"value":false}]},{"as":"run-aic","function":"sum","args":[{"field":"complete-aic"},{"field":"detection-aic"}]},{"as":"budget-use","function":"quotient","args":[{"field":"run-aic"},{"field":"configured-max-credits"}]}]},{"name":"routing-run-summary","from":"routing-runs","subject":"Keep the selected Run's compact routing and baseline evidence visible.","objective":"Preserve the comparison when shorter-lived Audit detail expires.","acceptance":"Retained aggregate costs and baseline evidence survive Audit expiry; absent phase details stay unknown.","joins":[{"source":"routing-cost-runs","type":"left","on":[{"left":"routing-run-key","right":"routing-run-key"}],"fields":[{"field":"cost-complete","as":"cost-complete"},{"field":"missing-cost-records","as":"missing-cost-records"},{"field":"detection-aic","as":"detection-aic"},{"field":"run-aic","as":"run-aic"},{"field":"budget-use","as":"budget-use"}]}]},{"name":"routing-weekly-cost-totals","from":"routing-runs","subject":"Summarize complete agent-phase costs by UTC ISO week and routing state.","objective":"Expose trends without including partial costs.","acceptance":"Untimed runs cannot enter time buckets.","filter":{"predicates":[{"field":"run-clock","gte":0}]},"compute":[{"as":"week","function":"date-bucket","args":[{"field":"observed-at"},{"value":"week"}]}],"aggregate":{"by":["week","routing-state"],"values":[{"field":"run","as":"runs","reducer":"count"},{"field":"complete-aic","as":"complete-runs","reducer":"count"},{"field":"complete-aic","as":"observed-median","reducer":"median"}]}},{"name":"routing-weekly-accounting-cost","from":"routing-weekly-cost-totals","subject":"Gate weekly medians by complete sample size.","objective":"Keep sparse weeks from implying meaningful cost trends.","acceptance":"Weeks below the configurable minimum display insufficient data.","parameters":[{"name":"minimum-sample","type":"number"}],"compute":[{"as":"cost-series","function":"concat","args":[{"value":"Agent-phase accounting: "},{"field":"routing-state"}]},{"as":"sample-floor","function":"difference","args":[{"parameter":"minimum-sample"},{"value":1}]},{"as":"enough-samples","function":"greater-than","args":[{"field":"complete-runs"},{"field":"sample-floor"}]},{"as":"median-aic","function":"if","args":[{"field":"enough-samples"},{"field":"observed-median"},{"value":null}]},{"as":"sample-status","function":"if","args":[{"field":"enough-samples"},{"value":"observational"},{"value":"insufficient data"}]}],"order-by":[{"field":"week","direction":"asc"}]},{"name":"routing-resolutions","from":"routing-session-events","subject":"Read runner-written configured-model resolutions for scoped routing runs.","objective":"Explain what each workflow role's configured model resolved to before the engine launched.","acceptance":"Only model.resolution facts from latest scoped attempts contribute; missing or unsafe values and failed null resolutions remain unknown.","joins":[{"source":"routing-runs","type":"inner","on":[{"left":"routing-run-key","right":"routing-run-key"}],"fields":[{"field":"run-clock","as":"run-clock"},{"field":"observed-at","as":"run-observed-at"},{"field":"full-repository","as":"full-repository"},{"field":"routing-dashboard-link","as":"routing-dashboard-link"},{"field":"routing-state","as":"run-routing-state"}]}],"filter":{"predicates":[{"field":"event-type","equals":"model.resolution"}]},"compute":[{"as":"resolution-engine","function":"coalesce","args":[{"field":"telemetry-engine"},{"value":"unknown"}]},{"as":"resolution-role-label","function":"coalesce","args":[{"field":"resolution-role"},{"value":"unknown"}]},{"as":"configured-model","function":"coalesce","args":[{"field":"resolution-configured-model"},{"value":"unknown"}]},{"as":"resolved-model-label","function":"coalesce","args":[{"field":"resolution-resolved-model"},{"value":"unknown"}]},{"as":"resolution-provider","function":"coalesce","args":[{"field":"provider"},{"value":"unknown"}]},{"as":"resolution-status","function":"coalesce","args":[{"field":"event-status"},{"value":"unknown"}]},{"as":"failed-resolution","function":"equals-any","args":[{"field":"event-status"},{"value":"failed"}]},{"as":"failure-cause","function":"coalesce","args":[{"field":"code"},{"value":"unknown"}]},{"as":"resolution-cause","function":"if","args":[{"field":"failed-resolution"},{"field":"failure-cause"},{"field":"code"}]},{"as":"unknown-resolved-model","function":"equals-any","args":[{"field":"resolution-resolved-model"},{"value":null}]},{"as":"untimed","function":"equals-any","args":[{"field":"run-clock"},{"value":null}]},{"as":"configured-to-resolved","function":"concat","args":[{"field":"configured-model"},{"value":" → "},{"field":"resolved-model-label"}]},{"as":"workflow-key","function":"concat","args":[{"field":"full-repository"},{"value":":"},{"field":"workflow"}]},{"as":"resolution-actor","function":"concat","args":[{"field":"resolution-engine"},{"value":"/"},{"field":"resolution-role-label"},{"value":"/"},{"field":"resolution-provider"}]},{"as":"resolution-series","function":"concat","args":[{"field":"workflow-key"},{"value":" | "},{"field":"resolution-actor"},{"value":" | "},{"field":"configured-model"}]}]},{"name":"routing-health-totals","from":"routing-runs","subject":"Count routed runs and their selection, failure, adherence, outcome and cost evidence per repository and workflow.","objective":"Answer whether routing is on and working from one row per routed workflow.","acceptance":"Only selected, selection_failed, harness_reported and configured_unrecorded runs contribute; runs without evidence stay out of each denominator.","filter":{"predicates":[{"field":"routing-state","in":["selected","selection_failed","harness_reported","configured_unrecorded"]}]},"compute":[{"as":"has-routing-failure","function":"greater-than","args":[{"field":"failure-count"},{"value":0}]},{"as":"failure-or-fallback","function":"if","args":[{"field":"has-routing-failure"},{"value":true},{"field":"routing-degraded"}]},{"as":"adherence-known","function":"greater-than","args":[{"field":"flagged-requests"},{"value":0}]},{"as":"no-deviation","function":"equals-any","args":[{"field":"deviated-requests"},{"value":0}]}],"aggregate":{"by":["full-repository","workflow","baseline-model"],"values":[{"field":"paired-main-aic","as":"paired-main-aic","reducer":"sum"},{"field":"paired-baseline-aic","as":"paired-baseline-aic","reducer":"sum"},{"field":"run","as":"routed-runs","reducer":"count"},{"field":"run","as":"selected-runs","reducer":"count","filter":{"predicates":[{"field":"routing-state","equals":"selected"}]}},{"field":"run","as":"failure-runs","reducer":"count","filter":{"predicates":[{"field":"failure-or-fallback","equals":true}]}},{"field":"run","as":"adherence-known-runs","reducer":"count","filter":{"predicates":[{"field":"adherence-known","equals":true}]}},{"field":"run","as":"followed-runs","reducer":"count","filter":{"predicates":[{"field":"adherence-known","equals":true},{"field":"no-deviation","equals":true}]}},{"field":"agent-result","as":"known-outcomes","reducer":"count"},{"field":"run","as":"successes","reducer":"count","filter":{"predicates":[{"field":"agent-result","equals":"success"}]}},{"field":"complete-aic","as":"complete-runs","reducer":"count"},{"field":"complete-aic","as":"median-aic","reducer":"median"}]}},{"name":"routing-health","subject":"Show routing health shares per repository and workflow.","objective":"Tell whether routing is on and working from selection, failure or fallback, pick adherence, known outcomes and complete cost.","acceptance":"A zero denominator or no complete cost is unknown, never zero; unknown job outcomes are excluded from the success rate.","from":"routing-health-totals","compute":[{"as":"estimated-cost-vs-baseline","function":"quotient","args":[{"field":"paired-main-aic"},{"field":"paired-baseline-aic"}]},{"as":"estimated-cost-percent","function":"format-percent","args":[{"field":"estimated-cost-vs-baseline"}]},{"as":"selected-share","function":"quotient","args":[{"field":"selected-runs"},{"field":"routed-runs"}]},{"as":"failure-share","function":"quotient","args":[{"field":"failure-runs"},{"field":"routed-runs"}]},{"as":"followed-share","function":"quotient","args":[{"field":"followed-runs"},{"field":"adherence-known-runs"}]},{"as":"success-rate","function":"quotient","args":[{"field":"successes"},{"field":"known-outcomes"}]},{"as":"selected-percent","function":"format-percent","args":[{"field":"selected-share"}]},{"as":"failure-percent","function":"format-percent","args":[{"field":"failure-share"}]},{"as":"followed-percent","function":"format-percent","args":[{"field":"followed-share"}]},{"as":"success-percent","function":"format-percent","args":[{"field":"success-rate"}]}],"order-by":[{"field":"routed-runs","direction":"desc"},{"field":"full-repository","direction":"asc"},{"field":"workflow","direction":"asc"}]},{"name":"routing-weekly-models","from":"routing-runs","subject":"Count proxy-selected runs by UTC ISO week and picked model.","objective":"Show what the router chooses over time.","acceptance":"Only selected runs with a known pick model and a recorded run clock contribute; an unrecorded effort does not exclude a run.","filter":{"predicates":[{"field":"routing-state","equals":"selected"},{"field":"unknown-pick-model","equals":false},{"field":"run-clock","gte":0}]},"compute":[{"as":"week","function":"date-bucket","args":[{"field":"observed-at"},{"value":"week"}]}],"aggregate":{"by":["week","pick-model"],"values":[{"field":"run","as":"runs","reducer":"count"}]},"order-by":[{"field":"week","direction":"asc"},{"field":"pick-model","direction":"asc"}]},{"name":"routing-weekly-paired-totals","from":"routing-runs","subject":"Weekly paired complete main-request costs by baseline model.","objective":"Compare routing cost trends with each named baseline using identical main-request populations.","acceptance":"Only timed runs with complete positive baseline estimates and matching known main-request costs contribute to both medians.","filter":{"predicates":[{"field":"paired","equals":true},{"field":"run-clock","gte":0}]},"compute":[{"as":"week","function":"date-bucket","args":[{"field":"observed-at"},{"value":"week"}]}],"aggregate":{"by":["week","baseline-model"],"values":[{"field":"run","as":"complete-runs","reducer":"count"},{"field":"paired-main-aic","as":"observed-main-median","reducer":"median"},{"field":"paired-baseline-aic","as":"baseline-estimate-median","reducer":"median"}]}},{"name":"routing-weekly-paired-cost","from":"routing-weekly-paired-totals","subject":"Paired main-request samples that meet the chosen evidence floor.","objective":"Avoid changing routing policy based on insufficient paired evidence.","acceptance":"Observed and estimated series share the same complete-run count and configurable minimum sample.","parameters":[{"name":"minimum-sample","type":"number"}],"compute":[{"as":"sample-floor","function":"difference","args":[{"parameter":"minimum-sample"},{"value":1}]},{"as":"enough-samples","function":"greater-than","args":[{"field":"complete-runs"},{"field":"sample-floor"}]}]},{"name":"routing-weekly-main-observed","from":"routing-weekly-paired-cost","subject":"Observed main-request AIC for the same eligible runs as each baseline.","objective":"Identify weeks when routed main-request costs exceed the matching baseline estimate.","acceptance":"Observed medians exclude classifier and sub-agent costs and remain unknown below the paired sample floor.","compute":[{"as":"cost-series","function":"concat","args":[{"value":"Main requests observed (baseline: "},{"field":"baseline-model"},{"value":")"}]},{"as":"median-aic","function":"if","args":[{"field":"enough-samples"},{"field":"observed-main-median"},{"value":null}]}]},{"name":"routing-weekly-baseline-estimate","from":"routing-weekly-paired-cost","subject":"Explicitly estimated baseline AIC for paired main-agent requests.","objective":"Show the named counterfactual against which owners can assess routing goal or mode.","acceptance":"The series is labelled estimated, separates baseline models and uses exactly the observed series' eligible runs.","compute":[{"as":"cost-series","function":"concat","args":[{"value":"Baseline estimate (estimated, main requests): "},{"field":"baseline-model"}]},{"as":"median-aic","function":"if","args":[{"field":"enough-samples"},{"field":"baseline-estimate-median"},{"value":null}]}]},{"name":"routing-weekly-cost","from":"routing-weekly-accounting-cost","union":["routing-weekly-main-observed","routing-weekly-baseline-estimate"],"subject":"Compare the same main-agent requests to an explicitly estimated baseline.","objective":"Change routing goal or mode when paired observed cost exceeds the named baseline.","acceptance":"Keep agent-phase accounting separate, baseline models distinct and sparse weeks as gaps.","order-by":[{"field":"week","direction":"asc"},{"field":"cost-series","direction":"asc"}]},{"name":"routing-failure-problems","from":"routing-runs","subject":"Runs whose routing failure codes require investigation.","objective":"Investigate routing configuration or execution failures before changing rollout.","acceptance":"Emit one row per run with recorded routing failure identifiers, excluding upstream errors handled by their own kind.","filter":{"predicates":[{"field":"routing-failure-codes","gte":""}]},"compute":[{"as":"problem-kind","function":"literal","args":[{"value":"routing failure"}]},{"as":"problem-cause","function":"coalesce","args":[{"field":"routing-failure-codes"},{"value":null}]}],"select":[{"field":"routing-run-key"},{"field":"problem-kind"},{"field":"problem-cause"}]},{"name":"routing-deviation-problems","from":"routing-runs","subject":"Runs whose requests deviated from the routing pick.","objective":"Investigate why requests did not follow the selected model or effort.","acceptance":"Emit one row per run with distinct recorded deviation causes, without inferring causes from model names.","filter":{"predicates":[{"field":"routing-deviation-codes","gte":""}]},"compute":[{"as":"problem-kind","function":"literal","args":[{"value":"deviation"}]},{"as":"problem-cause","function":"coalesce","args":[{"field":"routing-deviation-codes"},{"value":null}]}],"select":[{"field":"routing-run-key"},{"field":"problem-kind"},{"field":"problem-cause"}]},{"name":"routing-resolution-problems","from":"routing-runs","subject":"Runs whose configured models could not be resolved.","objective":"Correct model aliases or restore catalogue availability for failed resolutions.","acceptance":"Emit one row per run with recorded resolution failure causes, not absence of resolution evidence.","filter":{"predicates":[{"field":"routing-resolution-codes","gte":""}]},"compute":[{"as":"problem-kind","function":"literal","args":[{"value":"resolution failure"}]},{"as":"problem-cause","function":"coalesce","args":[{"field":"routing-resolution-codes"},{"value":null}]}],"select":[{"field":"routing-run-key"},{"field":"problem-kind"},{"field":"problem-cause"}]},{"name":"routing-upstream-problems","from":"routing-runs","subject":"Provider-rejected requests with distinct upstream error codes.","objective":"Correct model or effort settings rejected by the provider.","acceptance":"Emit one upstream-error row per run with distinct safe codes or unknown, never a duplicate generic routing failure.","filter":{"predicates":[{"field":"routing-upstream-codes","gte":""}]},"compute":[{"as":"problem-kind","function":"literal","args":[{"value":"upstream error"}]},{"as":"problem-cause","function":"coalesce","args":[{"field":"routing-upstream-codes"},{"value":null}]}],"select":[{"field":"routing-run-key"},{"field":"problem-kind"},{"field":"problem-cause"}]},{"name":"routing-candidate-problems","from":"routing-runs","subject":"Runs whose full eligible pool contains choices the router cannot rank.","objective":"Review allowed models when the router cannot rank the complete eligible pool.","acceptance":"Emit one row only when both pool counters are known and overlap is below eligibility, displaying the observed ratio.","filter":{"predicates":[{"field":"candidate-coverage","gte":""}]},"compute":[{"as":"problem-kind","function":"literal","args":[{"value":"candidates not rankable"}]},{"as":"problem-cause","function":"coalesce","args":[{"field":"candidate-coverage"},{"value":null}]}],"select":[{"field":"routing-run-key"},{"field":"problem-kind"},{"field":"problem-cause"}]},{"name":"routing-problems","from":"routing-failure-problems","union":["routing-deviation-problems","routing-resolution-problems","routing-upstream-problems","routing-candidate-problems"],"subject":"List routing failures, deviations and resolution failures with one row per run and kind.","objective":"Show what needs attention and link each problem to its run page.","acceptance":"Time is the run's recorded observation time and stays unknown without a run clock; untimed rows sort after timed rows.","joins":[{"source":"routing-runs","type":"inner","on":[{"left":"routing-run-key","right":"routing-run-key"}],"fields":[{"field":"run","as":"run"},{"field":"full-repository","as":"full-repository"},{"field":"workflow","as":"workflow"},{"field":"run-clock","as":"run-clock"},{"field":"observed-at","as":"observed-at"},{"field":"routing-dashboard-link","as":"routing-dashboard-link"}]}],"compute":[{"as":"untimed","function":"equals-any","args":[{"field":"run-clock"},{"value":null}]}],"order-by":[{"field":"untimed","direction":"asc"},{"field":"run-clock","direction":"desc"},{"field":"run","direction":"desc"},{"field":"problem-kind","direction":"asc"}]},{"name":"simulator-database-inputs","subject":"Model daily run volume and 30-day retained detail from user-supplied scenario inputs.","objective":"Compare hypothetical workload choices without treating results as observed activity.","acceptance":"Each simulated day uses the selected inputs; skipped runs retain summaries and detailed records have a 30-day lifetime.","description":"Each simulated day includes all accumulated run summaries; tools and issues belong only to non-skipped runs and expire after 30 days.","from":"simulation-days","parameters":[{"name":"repositories","type":"number"},{"name":"runs-per-day","type":"number"},{"name":"tools-per-run","type":"number"},{"name":"issues-per-run","type":"number"},{"name":"skip-rate","type":"number"}],"compute":[{"as":"runs-daily","function":"product","args":[{"parameter":"repositories"},{"parameter":"runs-per-day"}]},{"as":"skip-fraction","function":"quotient","args":[{"parameter":"skip-rate"},{"value":100}]},{"as":"active-fraction","function":"difference","args":[{"value":1},{"field":"skip-fraction"}]},{"as":"summary-runs","function":"product","args":[{"field":"day"},{"field":"runs-daily"}]},{"as":"past-ttl","function":"greater-than","args":[{"field":"day"},{"value":30}]},{"as":"detail-days","function":"if","args":[{"field":"past-ttl"},{"value":30},{"field":"day"}]},{"as":"detail-runs","function":"product","args":[{"field":"detail-days"},{"field":"runs-daily"},{"field":"active-fraction"}]},{"as":"tools-per-run","function":"literal","args":[{"parameter":"tools-per-run"}]},{"as":"issues-per-run","function":"literal","args":[{"parameter":"issues-per-run"}]}]},{"name":"simulator-run-size","subject":"Estimate retained run-summary table size at 512 bytes per run.","objective":"Show modeled accumulation of run summaries.","acceptance":"Summary size includes every simulated run at 512 bytes and is not presented as measured storage.","from":"simulator-database-inputs","compute":[{"as":"table","function":"literal","args":[{"value":"Run summaries"}]},{"as":"bytes","function":"product","args":[{"field":"summary-runs"},{"value":512}]}],"select":[{"field":"day"},{"field":"table"},{"field":"bytes"}]},{"name":"simulator-tool-size","subject":"Estimate retained tool table size at 256 bytes per tool on non-skipped runs.","objective":"Show modeled tool-record growth under the selected workload.","acceptance":"Tool size uses only non-skipped simulated runs and 256 bytes per tool over the retained period.","from":"simulator-database-inputs","compute":[{"as":"table","function":"literal","args":[{"value":"Tools (30-day TTL)"}]},{"as":"bytes","function":"product","args":[{"field":"detail-runs"},{"field":"tools-per-run"},{"value":256}]}],"select":[{"field":"day"},{"field":"table"},{"field":"bytes"}]},{"name":"simulator-issue-size","subject":"Estimate retained issue table size at 512 bytes per issue on non-skipped runs.","objective":"Show modeled issue-record growth under the selected workload.","acceptance":"Issue size uses only non-skipped simulated runs and 512 bytes per issue over the retained period.","from":"simulator-database-inputs","compute":[{"as":"table","function":"literal","args":[{"value":"Issues (30-day TTL)"}]},{"as":"bytes","function":"product","args":[{"field":"detail-runs"},{"field":"issues-per-run"},{"value":512}]}],"select":[{"field":"day"},{"field":"table"},{"field":"bytes"}]},{"name":"simulator-database-size","subject":"Show modeled run-summary, tool, and issue table bytes after 30 days.","objective":"Compare hypothetical database table sizes at the end of the retention horizon.","acceptance":"The model presents separate summary, tool, and issue estimates after 30 simulated days, never observed storage.","description":"Run summaries accumulate; detailed records have a 30-day TTL.","from":"simulator-run-size","union":["simulator-tool-size","simulator-issue-size"],"filter":{"predicates":[{"field":"day","equals":30}]},"select":[{"field":"table"},{"field":"bytes"}]},{"name":"simulator-database-total","subject":"Sum the modeled table sizes after 30 days.","objective":"Show the final estimated size of the modeled database tables.","acceptance":"The final value is the sum of the three modeled table sizes after 30 days.","from":"simulator-database-size","compute":[{"as":"total-label","function":"literal","args":[{"value":"Total"}]}],"aggregate":{"by":["total-label"],"values":[{"field":"bytes","as":"bytes","reducer":"sum"}]},"select":[{"field":"total-label","as":"table"},{"field":"bytes"}]},{"name":"simulator-database-summary","subject":"List modeled table sizes and their final total after 30 days.","objective":"Present the 30-day estimate in a compact table.","acceptance":"Three modeled table sizes and their summed final value are shown without a growth chart.","from":"simulator-database-size","union":["simulator-database-total"]},{"name":"simulator-pr-inputs","subject":"Model company PR volume, AW fan-out and AI Credits from editable assumptions.","objective":"Compare hypothetical company sizes without launching workflows or claiming measured capacity.","acceptance":"Developers multiply PRs per developer per day, AW runs per PR and AIC per run; repositories divide averages only. Duration scales totals independently of the synthetic day source.","from":"simulation-days","parameters":[{"name":"company-repositories","type":"number"},{"name":"developers","type":"number"},{"name":"prs-per-developer-per-day","type":"number"},{"name":"aw-runs-per-pr","type":"number"},{"name":"days","type":"number"},{"name":"aic-per-run","type":"number"}],"filter":{"predicates":[{"field":"day","equals":1}]},"compute":[{"as":"daily-prs","function":"product","args":[{"parameter":"developers"},{"parameter":"prs-per-developer-per-day"}]},{"as":"daily-runs","function":"product","args":[{"field":"daily-prs"},{"parameter":"aw-runs-per-pr"}]},{"as":"daily-aic","function":"product","args":[{"field":"daily-runs"},{"parameter":"aic-per-run"}]},{"as":"total-prs","function":"product","args":[{"field":"daily-prs"},{"parameter":"days"}]},{"as":"total-runs","function":"product","args":[{"field":"daily-runs"},{"parameter":"days"}]},{"as":"total-aic","function":"product","args":[{"field":"daily-aic"},{"parameter":"days"}]},{"as":"prs-per-repo","function":"quotient","args":[{"field":"daily-prs"},{"parameter":"company-repositories"}]},{"as":"runs-per-repo","function":"quotient","args":[{"field":"daily-runs"},{"parameter":"company-repositories"}]},{"as":"runs-per-second","function":"quotient","args":[{"field":"daily-runs"},{"value":86400}]}]},{"name":"simulator-pr-counts","subject":"Show modeled daily and horizon pull request counts.","objective":"Separate developer activity from repository scope.","acceptance":"PR totals depend on developers and duration, not repository count.","from":"simulator-pr-inputs","compute":[{"as":"measure","function":"literal","args":[{"value":"Pull requests"}]}],"select":[{"field":"measure"},{"field":"daily-prs","as":"daily"},{"field":"total-prs","as":"total"}]},{"name":"simulator-pr-runs","subject":"Show modeled AW runs generated by pull requests.","objective":"Expose the selected AW fan-out.","acceptance":"Daily and horizon runs use the configured AW runs per PR.","from":"simulator-pr-inputs","compute":[{"as":"measure","function":"literal","args":[{"value":"AW runs"}]}],"select":[{"field":"measure"},{"field":"daily-runs","as":"daily"},{"field":"total-runs","as":"total"}]},{"name":"simulator-pr-aic","subject":"Show modeled AI Credits, not actual spending or currency.","objective":"Make the editable AIC-per-run assumption explicit.","acceptance":"AIC totals multiply modeled runs by AIC per AW run; no dollar conversion or budget enforcement is inferred.","from":"simulator-pr-inputs","compute":[{"as":"measure","function":"literal","args":[{"value":"AI Credits (AIC)"}]}],"select":[{"field":"measure"},{"field":"daily-aic","as":"daily"},{"field":"total-aic","as":"total"}]},{"name":"simulator-pr-summary","subject":"Compare daily and horizon PR, AW-run and AI Credit estimates.","objective":"Support side-effect-free company workload planning.","acceptance":"Exactly three modeled measures are shown and recompute from all six form inputs.","from":"simulator-pr-counts","union":["simulator-pr-runs","simulator-pr-aic"]},{"name":"overview-run-summary","subject":"Summarize successful, failed, and active runs with rollout-mode counts.","objective":"Expose observed success, failure, and active run counts, including active live and review modes, for the selected horizon.","acceptance":"Each count follows its declared conclusion, status, and rollout-mode filters; run success is not treated as a verified outcome, and incomplete or stale evidence is identified.","from":"overview-runs","aggregate":{"values":[{"field":"run-conclusion","as":"successful-runs","reducer":"count","filter":{"predicates":[{"field":"run-conclusion","equals":"success"}]}},{"field":"run-conclusion","as":"failed-runs","reducer":"count","filter":{"predicates":[{"field":"run-conclusion","in":["failure","startup-failure","stale","timed-out"]}]}},{"field":"run-status","as":"active-runs","reducer":"count","filter":{"predicates":[{"field":"run-status","in":["queued","in-progress","in_progress"]}]}},{"field":"run-status","as":"active-live","reducer":"count","filter":{"predicates":[{"field":"run-status","in":["queued","in-progress","in_progress"]},{"field":"rollout-mode","equals":"live"}]}},{"field":"run-status","as":"active-review","reducer":"count","filter":{"predicates":[{"field":"run-status","in":["queued","in-progress","in_progress"]},{"field":"rollout-mode","equals":"review"}]}}]}},{"name":"overview-delivery-summary","subject":"Count distinct target repositories with successful worker dispatch runs in the selected horizon.","objective":"Measure observed reach among registered repositories with successful dispatched worker runs.","acceptance":"Distinct delivered-repositories is limited to registered targets and successful workflow_dispatch worker runs in the selected horizon; it does not establish accepted delivery or authorized coverage.","from":"overview-runs","joins":[{"source":"repositories","type":"inner","on":[{"left":"target-repository","right":"repository-coordinate"}],"fields":[{"field":"repository-coordinate","as":"registered-target-repository"}]}],"filter":{"predicates":[{"field":"event","equals":"workflow_dispatch"},{"field":"run-conclusion","equals":"success"},{"field":"workflow-role","equals":"worker"}]},"aggregate":{"values":[{"field":"target-repository","as":"delivered-repositories","reducer":"distinct-count"}]}},{"name":"overview-value-summary","subject":"Count all observed grader results.","objective":"Identify whether any grader observations are available to the Overview status presentation.","acceptance":"The value-gains field counts observed grader records only; inspect each result's native measure, unit, direction, maturity, and uncertainty before claiming an outcome or improvement.","from":"grader-observations","aggregate":{"values":[{"field":"grader","as":"value-gains","reducer":"count"}]}},{"name":"overview-issue-summary","subject":"Count retained issue and pull request safe-output records for Overview.","objective":"Restore the issue and pull request counter with a link to its evidence inventory.","acceptance":"The count includes retained canonical issue and pull request records, not inferred outcomes; unavailable evidence remains unavailable.","from":"issues","aggregate":{"values":[{"field":"id","as":"value","reducer":"count"}]},"limit":1},{"name":"overview-issue-station","subject":"Present the retained issue and pull request count for Overview.","objective":"Provide a presentation-ready count and accessible evidence description.","acceptance":"The value matches overview-issue-summary and describes retained safe outputs, not accepted outcomes.","from":"overview-issue-summary","compute":[{"as":"detail","function":"concat","args":[{"value":"Retained safe"},{"value":" outputs"}]},{"as":"description","function":"concat","args":[{"field":"value"},{"value":" retained issues and pull requests"}]}],"limit":1},{"name":"overview-value-station","subject":"Present the observed grader-result count as the legacy Value gains counter.","objective":"Restore the Value gains counter while making its observation-count semantics explicit.","acceptance":"The count matches overview-value-summary, including zero; grader presence is not proof of improvement and unavailable evidence is not zero.","from":"overview-value-summary","compute":[{"as":"detail","function":"concat","args":[{"value":"Observed grader"},{"value":" results"}]},{"as":"description","function":"concat","args":[{"field":"value-gains"},{"value":" observed grader results, not verified improvements"}]}],"select":[{"field":"value-gains","as":"value"},{"field":"detail"},{"field":"description"}],"limit":1},{"name":"overview-run-status-input","subject":"Prepare the compact run summary for declarative factory status classification.","objective":"Carry successful-runs, failed-runs, and active-runs into the status join without changing their meaning.","acceptance":"The projected counts retain the selected horizon and match overview-run-summary; the join key is only a presentation key, not additional evidence.","from":"overview-run-summary","compute":[{"as":"status-join-key","function":"concat","args":[{"value":"factory"},{"value":"-status"}]}],"select":[{"field":"status-join-key"},{"field":"successful-runs"},{"field":"failed-runs"},{"field":"active-runs"}]},{"name":"overview-value-status-input","subject":"Prepare the compact value summary for declarative factory status classification.","objective":"Carry the grader-observation count into the optional status join.","acceptance":"The projected value-gains count matches overview-value-summary; a zero count does not establish complete grader coverage, and a nonzero count is not proof of gain.","from":"overview-value-summary","compute":[{"as":"status-join-key","function":"concat","args":[{"value":"factory"},{"value":"-status"}]}],"select":[{"field":"status-join-key"},{"field":"value-gains"}]},{"name":"overview-factory-status","subject":"Classify the factory heading from compact run and optional value evidence.","objective":"Provide a bounded Overview heading based on observed run counts and optional grader-record presence.","acceptance":"The heading matches the declared run-count and optional grader-presence branches; grader presence is not verified value, and the heading does not authorize any policy change.","from":"overview-run-status-input","joins":[{"source":"overview-value-status-input","type":"left","on":[{"left":"status-join-key","right":"status-join-key"}],"fields":[{"field":"value-gains","as":"value-gains"}]}],"compute":[{"as":"has-successful-runs","function":"greater-than","args":[{"field":"successful-runs"},{"value":0}]},{"as":"has-failed-runs","function":"greater-than","args":[{"field":"failed-runs"},{"value":0}]},{"as":"failures-exceed-successes","function":"greater-than","args":[{"field":"failed-runs"},{"field":"successful-runs"}]},{"as":"has-active-runs","function":"greater-than","args":[{"field":"active-runs"},{"value":0}]},{"as":"has-value-gains","function":"greater-than","args":[{"field":"value-gains"},{"value":0}]},{"as":"successful-heading","function":"if","args":[{"field":"has-successful-runs"},{"value":"Your factory is humming."},{"value":"Your factory is idle."}]},{"as":"attention-heading","function":"if","args":[{"field":"has-failed-runs"},{"value":"Your factory needs attention."},{"field":"successful-heading"}]},{"as":"strain-heading","function":"if","args":[{"field":"failures-exceed-successes"},{"value":"Your factory is under strain."},{"field":"attention-heading"}]},{"as":"active-heading","function":"if","args":[{"field":"has-active-runs"},{"value":"Your factory is humming."},{"field":"strain-heading"}]},{"as":"factory-heading","function":"if","args":[{"field":"has-value-gains"},{"value":"Your factory is delivering value."},{"field":"active-heading"}]}],"select":[{"field":"factory-heading"}]},{"name":"overview-registered-repository-summary","subject":"Count canonical repository identities registered in the resolved control-plane scope.","objective":"Provide the registered-repository denominator for observed worker reach.","acceptance":"The count reflects canonical repository records in the resolved scope; it is not evidence of live enrollment, successful execution, or full inventory completeness.","from":"repositories","aggregate":{"values":[{"field":"repository","as":"registered-repositories","reducer":"count"}]}},{"name":"overview-delivery-coverage-input","subject":"Prepare successful delivery totals for the repository coverage summary.","objective":"Carry the distinct delivered-repositories count into the coverage join.","acceptance":"The projected count equals overview-delivery-summary for the selected horizon; the join key adds no repository observations.","from":"overview-delivery-summary","compute":[{"as":"coverage-key","function":"concat","args":[{"value":"repository-coverage"},{"value":""}]}],"select":[{"field":"delivered-repositories"},{"field":"coverage-key"}]},{"name":"overview-registered-repository-coverage-input","subject":"Prepare registered repository totals for the repository coverage summary.","objective":"Carry the registered-repositories count into the coverage denominator join.","acceptance":"The projected count equals overview-registered-repository-summary for the resolved scope; missing inventory is not treated as zero eligible targets.","from":"overview-registered-repository-summary","compute":[{"as":"coverage-key","function":"concat","args":[{"value":"repository-coverage"},{"value":""}]}],"select":[{"field":"registered-repositories"},{"field":"coverage-key"}]},{"name":"overview-rhythm","subject":"Compare all workflow runs by weekday, layering this week over last week.","objective":"Show the observed weekday pattern across both calendar weeks, regardless of status or conclusion.","acceptance":"Verify weekday order, counts including unsuccessful and in-flight runs, and reached-day flags. Missing rhythm is unavailable, not zero activity; do not attribute changes to workflow improvements.","from":"overview-runs","time":{"range":"15d"},"compute":[{"as":"rhythm-point","function":"calendar-week-point","args":[{"field":"started-at"},{"context":"time-end"},{"value":true}]}],"aggregate":{"values":[{"field":"rhythm-point","as":"rhythm","reducer":"calendar-week-rhythm"}]}},{"name":"overview-repository-coverage-summary","subject":"Aggregate reached and total repositories across the resolved organization scope.","objective":"Pair observed reached-repositories and registered-repositories-total for a comparable coverage denominator.","acceptance":"Both totals come from their named input queries and share the resolved scope; verify the left-joined inventory source independently before interpreting a zero total, since a missing join can aggregate to zero.","from":"overview-delivery-coverage-input","joins":[{"source":"overview-registered-repository-coverage-input","type":"left","on":[{"left":"coverage-key","right":"coverage-key"}],"fields":[{"field":"registered-repositories","as":"registered-repositories-total"}]}],"aggregate":{"values":[{"field":"delivered-repositories","as":"reached-repositories","reducer":"sum"},{"field":"registered-repositories-total","as":"registered-repositories-total","reducer":"sum"}]}},{"name":"overview-repository-coverage","subject":"Measure registered repository reach from successful worker execution.","objective":"Present observed successful-worker repository reach as a ratio alongside numerator and denominator.","acceptance":"repository-coverage is reached-repositories divided by registered-repositories-total when available; preserve the counts and undefined denominator, and do not call reach successful outcomes.","from":"overview-repository-coverage-summary","compute":[{"as":"repository-coverage","function":"quotient","args":[{"field":"reached-repositories"},{"field":"registered-repositories-total"}]}],"select":[{"field":"repository-coverage"},{"field":"reached-repositories"},{"field":"registered-repositories-total"}]},{"name":"overview-workflow-health-groups","subject":"Assess current runtime failures for every workflow across CAO and targeted repositories.","objective":"Compute the latest consecutive completed-run failure streak for each repository-scoped workflow without requiring campaign membership.","acceptance":"Group by organization, repository, and workflow; in-flight retries do not clear failures, and later non-failing completed runs reset the streak within the selected horizon.","from":"overview-runs","filter":{"predicates":[{"field":"run-status","equals":"completed"}]},"compute":[{"as":"is-runtime-failure","function":"equals-any","args":[{"field":"run-conclusion"},{"value":"failure"},{"value":"startup-failure"},{"value":"stale"},{"value":"timed-out"}]},{"as":"runtime-failure-streak-point","function":"failure-streak-point","args":[{"field":"started-at"},{"field":"run"},{"field":"is-runtime-failure"}]}],"aggregate":{"by":["organization","repository","workflow"],"values":[{"field":"runtime-failure-streak-point","as":"failure-count","reducer":"latest-failure-streak"}]}},{"name":"overview-workflow-health-summary","subject":"Count all registered workflows and those without current observed runtime failures.","objective":"Provide Factory health numerator and denominator across CAO and targeted repositories, including standalone and campaign workflows.","acceptance":"Each repository-scoped workflow counts once regardless of campaign or role; no retained failure is not proof of successful execution, missing inventory remains unavailable, and missing run evidence marks the result incomplete.","from":"workflows","joins":[{"source":"overview-workflow-health-groups","type":"left","on":[{"left":"organization","right":"organization"},{"left":"repository","right":"repository"},{"left":"workflow","right":"workflow"}],"fields":[{"field":"failure-count","as":"observed-failures"}]}],"compute":[{"as":"normalized-failures","function":"coalesce","args":[{"field":"observed-failures"},{"value":0}]},{"as":"problem-present","function":"greater-than","args":[{"field":"normalized-failures"},{"value":0}]}],"aggregate":{"values":[{"field":"workflow","as":"workflows","reducer":"count"},{"field":"workflow","as":"healthy-workflows","reducer":"count","filter":{"predicates":[{"field":"problem-present","equals":false}]}}]}},{"name":"overview-workflow-health-presentation-input","subject":"Prepare all-workflow health counts for Overview presentation.","objective":"Carry Factory health counts into the header and station presentation.","acceptance":"Both counts match overview-workflow-health-summary and preserve missing evidence metadata.","from":"overview-workflow-health-summary","compute":[{"as":"overview-presentation-key","function":"concat","args":[{"value":"overview"},{"value":"-presentation"}]}],"select":[{"field":"overview-presentation-key"},{"field":"workflows"},{"field":"healthy-workflows"}]},{"name":"overview-factory-health-presentation","subject":"Produce presentation-ready Factory health values for the Overview header and floor.","objective":"Display the ratio of workflows without current observed runtime failures to all registered workflows with both underlying counts.","acceptance":"The percentage and detail agree with healthy-workflows and workflows; a missing or zero denominator remains unavailable, and the ratio is not proof of impact.","from":"overview-workflow-health-presentation-input","compute":[{"as":"factory-health","function":"quotient","args":[{"field":"healthy-workflows"},{"field":"workflows"}]},{"as":"factory-health-display","function":"format-percent","args":[{"field":"factory-health"}]},{"as":"healthy-workflows-display","function":"format-count","args":[{"field":"healthy-workflows"}]},{"as":"workflows-display","function":"format-count","args":[{"field":"workflows"}]},{"as":"factory-health-detail","function":"concat","args":[{"field":"healthy-workflows-display"},{"value":"/"},{"field":"workflows-display"},{"value":" healthy workflows"}]},{"as":"factory-health-description","function":"concat","args":[{"field":"factory-health-display"},{"value":" factory health"}]}],"select":[{"field":"overview-presentation-key"},{"field":"factory-health"},{"field":"factory-health-display"},{"field":"factory-health-detail"},{"field":"factory-health-description"}]},{"name":"overview-header-status-presentation-input","subject":"Prepare the factory status heading for the declarative Overview header.","objective":"Carry the factory heading into the Overview header join unchanged.","acceptance":"The heading matches overview-factory-status; the presentation key does not imply additional evidence or a policy recommendation.","from":"overview-factory-status","compute":[{"as":"overview-presentation-key","function":"concat","args":[{"value":"overview"},{"value":"-presentation"}]}],"select":[{"field":"overview-presentation-key"},{"field":"factory-heading"}]},{"name":"overview-header-presentation","subject":"Resolve the Overview heading from declarative status and factory-health evidence.","objective":"Display the configured heading corresponding to observed run status and factory health.","acceptance":"The selected heading follows the declared presentation branches; numeric branch boundaries are UI classification only, not operational targets or rollout thresholds.","from":"overview-header-status-presentation-input","joins":[{"source":"overview-factory-health-presentation","type":"left","on":[{"left":"overview-presentation-key","right":"overview-presentation-key"}],"fields":[{"field":"factory-health","as":"factory-health"}]}],"compute":[{"as":"factory-health-positive","function":"greater-than","args":[{"field":"factory-health"},{"value":0}]},{"as":"factory-health-below-threshold","function":"greater-than","args":[{"value":0.66},{"field":"factory-health"}]},{"as":"positive-factory-health-heading","function":"if","args":[{"field":"factory-health-below-threshold"},{"value":"Your factory needs attention."},{"field":"factory-heading"}]},{"as":"heading","function":"if","args":[{"field":"factory-health-positive"},{"field":"positive-factory-health-heading"},{"field":"factory-heading"}]}],"select":[{"field":"heading"}]},{"name":"overview-run-motion-presentation-input","subject":"Prepare active run state for Overview station presentation.","objective":"Expose whether at least one queued or in-progress run was observed for station display.","acceptance":"active reflects overview-run-summary's active-runs count; no observed active run does not prove the fleet is idle when the snapshot is incomplete.","from":"overview-run-summary","compute":[{"as":"overview-presentation-key","function":"concat","args":[{"value":"overview"},{"value":"-presentation"}]},{"as":"active","function":"greater-than","args":[{"field":"active-runs"},{"value":0}]}],"select":[{"field":"overview-presentation-key"},{"field":"active"}]},{"name":"overview-factory-station","subject":"Provide the presentation-ready Factory health station for Overview.","objective":"Show the all-workflow runtime health ratio, supporting counts, and observed run motion together.","acceptance":"Station value, display, detail, description, and active flag match their input queries; neither absence of failures nor run motion is verified workflow effectiveness.","from":"overview-factory-health-presentation","joins":[{"source":"overview-run-motion-presentation-input","type":"left","on":[{"left":"overview-presentation-key","right":"overview-presentation-key"}],"fields":[{"field":"active","as":"active"}]}],"select":[{"field":"factory-health","as":"value"},{"field":"factory-health-display","as":"display-value"},{"field":"factory-health-detail","as":"detail"},{"field":"factory-health-description","as":"description"},{"field":"active"}]},{"name":"overview-repository-station-presentation-input","subject":"Prepare repository coverage for the presentation-ready Overview station.","objective":"Format repository reach with its reached and registered counts for the station.","acceptance":"The percentage and detail preserve overview-repository-coverage's numerator and denominator; unavailable coverage remains unavailable, not zero or complete reach.","from":"overview-repository-coverage","compute":[{"as":"overview-presentation-key","function":"concat","args":[{"value":"overview"},{"value":"-presentation"}]},{"as":"display-value","function":"format-percent","args":[{"field":"repository-coverage"}]},{"as":"reached-repositories-display","function":"format-count","args":[{"field":"reached-repositories"}]},{"as":"registered-repositories-display","function":"format-count","args":[{"field":"registered-repositories-total"}]},{"as":"detail","function":"concat","args":[{"field":"reached-repositories-display"},{"value":"/"},{"field":"registered-repositories-display"},{"value":" repositories reached"}]},{"as":"description","function":"concat","args":[{"field":"display-value"},{"value":" average repository coverage"}]}],"select":[{"field":"overview-presentation-key"},{"field":"repository-coverage","as":"value"},{"field":"display-value"},{"field":"detail"},{"field":"description"}]},{"name":"overview-repository-station","subject":"Provide the presentation-ready repository coverage station for Overview.","objective":"Show observed registered-repository worker reach and run motion in one station.","acceptance":"Value and formatted evidence match the coverage presentation input, and active matches run motion; neither changes policy or establishes accepted outcomes.","from":"overview-repository-station-presentation-input","joins":[{"source":"overview-run-motion-presentation-input","type":"left","on":[{"left":"overview-presentation-key","right":"overview-presentation-key"}],"fields":[{"field":"active","as":"active"}]}],"select":[{"field":"value"},{"field":"display-value"},{"field":"detail"},{"field":"description"},{"field":"active"}]},{"name":"cost-by-repository","subject":"Present observed AI Credit cost grouped by repository.","objective":"Locate repositories with higher observed AI Credit totals for evidence-led investigation.","acceptance":"Each repository coordinate and native aic total agrees with repository-aic-totals; confirm the selected horizon and underlying runs before attributing cost or proposing a change.","from":"repository-aic-totals","compute":[{"as":"repository-coordinate","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"}]},{"as":"encoded-repository","function":"url-encode","args":[{"field":"repository-coordinate"}]},{"as":"repository-dashboard-href","function":"concat","args":[{"value":"#page-repository-detail?repository="},{"field":"encoded-repository"}]},{"as":"repository-dashboard-label","function":"concat","args":[{"value":"View "},{"field":"repository-coordinate"},{"value":" repository dashboard"}]},{"as":"repository-dashboard-link","function":"dashboard-link","args":[{"value":""},{"field":"repository-dashboard-href"},{"field":"repository-dashboard-label"},{"field":"repository-coordinate"}]}],"select":[{"field":"repository-coordinate"},{"field":"repository-dashboard-link"},{"field":"aic"}],"order-by":[{"field":"aic","direction":"desc"}]},{"name":"cost-by-workflow","subject":"Present observed AI Credit cost grouped by repository-owned workflow.","objective":"Locate repository workflows with higher observed AI Credit totals and open their workflow evidence.","acceptance":"Workflow identity, link, and native aic total match workflow-aic-totals in descending order; cost alone does not establish waste, quality, or value.","from":"workflow-aic-totals","compute":[{"as":"repository-coordinate","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"}]},{"as":"workflow-coordinate","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"},{"value":":"},{"field":"workflow"}]},{"as":"encoded-workflow","function":"url-encode","args":[{"field":"workflow-coordinate"}]},{"as":"workflow-dashboard-href","function":"concat","args":[{"value":"#page-workflow-runtime?workflow="},{"field":"encoded-workflow"}]},{"as":"workflow-dashboard-label","function":"concat","args":[{"value":"View "},{"field":"workflow-coordinate"},{"value":" workflow dashboard"}]},{"as":"workflow-dashboard-link","function":"dashboard-link","args":[{"value":""},{"field":"workflow-dashboard-href"},{"field":"workflow-dashboard-label"},{"field":"workflow-coordinate"}]}],"select":[{"field":"repository-coordinate"},{"field":"workflow"},{"field":"workflow-coordinate"},{"field":"workflow-dashboard-link"},{"field":"aic"}],"order-by":[{"field":"aic","direction":"desc"}]},{"name":"cost-per-workflow-run","subject":"Present the average observed AI Credit cost of a single run for each repository-owned workflow.","objective":"Compare observed AI Credit per run across repository workflows with each observed-runs denominator.","acceptance":"Include only workflows with positive-AIC run attempts, and use only those attempts in cost averages; observed-runs still counts all retained attempts.","description":"Observed AI Credit totals divided by positive-AIC run attempts for each declared workflow.","from":"workflow-aic-run-totals","filter":{"predicates":[{"field":"aic-runs","gte":1}]},"compute":[{"as":"aic-per-run","function":"quotient","args":[{"field":"aic"},{"field":"aic-runs"}]},{"as":"repository-coordinate","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"}]},{"as":"workflow-coordinate","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"},{"value":":"},{"field":"workflow"}]},{"as":"encoded-workflow","function":"url-encode","args":[{"field":"workflow-coordinate"}]},{"as":"workflow-dashboard-href","function":"concat","args":[{"value":"#page-workflow-runtime?workflow="},{"field":"encoded-workflow"}]},{"as":"workflow-dashboard-label","function":"concat","args":[{"value":"View "},{"field":"workflow-coordinate"},{"value":" workflow dashboard"}]},{"as":"workflow-dashboard-link","function":"dashboard-link","args":[{"value":""},{"field":"workflow-dashboard-href"},{"field":"workflow-dashboard-label"},{"field":"workflow-coordinate"}]}],"select":[{"field":"repository-coordinate"},{"field":"workflow"},{"field":"workflow-coordinate"},{"field":"workflow-dashboard-link"},{"field":"runs","as":"observed-runs"},{"field":"aic-per-run"}],"order-by":[{"field":"aic-per-run","direction":"desc"}]},{"name":"failure-run-base","subject":"Select retained runs with failure, startup-failure, stale, or timed-out conclusions for the failed-run ledger and streak inputs.","objective":"Provide one consistent failure-conclusion evidence set to downstream Overview queries.","acceptance":"Each selected run has one of the four declared conclusions within the selected horizon; other conclusions remain outside this set, and missing run coverage is not interpreted as no failures.","from":"runs","filter":{"predicates":[{"field":"run-conclusion","in":["failure","startup-failure","stale","timed-out"]}]}},{"name":"failed-runs","subject":"List failed workflow runs that need operator attention.","objective":"Give operators the most recent observed failed runs to inspect in GitHub.","acceptance":"Unprojected run rows retain available conclusion, started-at, and run evidence fields in descending started-at order; inspect source logs and missing links before attributing a cause or declaring resolution.","from":"failure-run-base","order-by":[{"field":"started-at","direction":"desc"}]},{"name":"overview-failing-runs","subject":"Identify failed runs in the selected snapshot horizon so subsequent streak logic can use the same declarative failure definition.","objective":"Project distinct failure-run counts by organization, repository, workflow, and run for streak joins.","acceptance":"Each grouped run identity has a failing-runs count derived from failure-run-base in the selected horizon; this stage does not assert a consecutive streak or require action.","from":"failure-run-base","aggregate":{"by":["organization","repository","workflow","run"],"values":[{"field":"run","as":"failing-runs","reducer":"distinct-count"}]}},{"name":"overview-failing-workflows","subject":"Identify only workflows that have at least one failed run in the selected snapshot horizon before computing streaks.","objective":"Provide workflow identities with observed failed runs for the streak computation.","acceptance":"Each organization/repository/workflow group has a distinct failing-runs count from overview-failing-runs; the count covers observed failures, not the latest consecutive streak.","from":"overview-failing-runs","aggregate":{"by":["organization","repository","workflow"],"values":[{"field":"run","as":"failing-runs","reducer":"distinct-count"}]}},{"name":"overview-repeated-failure-groups","subject":"Group each workflow's latest consecutive failing run sequence in the selected snapshot horizon, resetting the group after any successful run.","objective":"Project the latest observed consecutive failure-count per workflow for downstream blocked-work matching.","acceptance":"failure-count follows run ordering and the declared latest-failure-streak reducer, with non-failing runs breaking the streak; missing earlier runs or incomplete snapshots limit the observed sequence.","from":"runs","joins":[{"source":"overview-failing-workflows","type":"inner","on":[{"left":"organization","right":"organization"},{"left":"repository","right":"repository"},{"left":"workflow","right":"workflow"}],"fields":[{"field":"failing-runs","as":"failing-runs"}]},{"source":"overview-failing-runs","type":"left","on":[{"left":"organization","right":"organization"},{"left":"repository","right":"repository"},{"left":"workflow","right":"workflow"},{"left":"run","right":"run"}],"fields":[{"field":"failing-runs","as":"run-failing-count"}]}],"compute":[{"as":"failure-streak-point","function":"failure-streak-point","args":[{"field":"started-at"},{"field":"run"},{"field":"run-failing-count"}]}],"aggregate":{"by":["organization","repository","workflow"],"values":[{"field":"failure-streak-point","as":"failure-count","reducer":"latest-failure-streak"}]}},{"name":"overview-repeated-failure-candidates","subject":"Attach selected-horizon failure counts to each workflow's latest canonical work item.","objective":"Pair blocked work items with observed workflow failure streaks and retained run evidence before attention filtering.","acceptance":"Candidates are filtered to blocked items with a matching organization/repository/workflow streak; is-repeated reflects failure-count greater than one, while selected evidence-link and run-link can be absent or refer to the work item rather than the latest failed run.","from":"work-items","joins":[{"source":"overview-repeated-failure-groups","type":"inner","on":[{"left":"organization","right":"organization"},{"left":"repository","right":"repository"},{"left":"workflow","right":"workflow"}],"fields":[{"field":"failure-count","as":"failure-count"}]}],"filter":{"predicates":[{"field":"lifecycle-state","equals":"blocked"}]},"compute":[{"as":"is-repeated","function":"greater-than","args":[{"field":"failure-count"},{"value":1}]},{"as":"attention-signal-id","function":"concat","args":[{"value":"repeated-failure:"},{"field":"organization"},{"value":"/"},{"field":"repository"},{"value":":"},{"field":"workflow"}]},{"as":"kind","function":"coalesce","args":[{"value":"Repeated workflow failures"},{"value":"Repeated workflow failures"}]},{"as":"title","function":"coalesce","args":[{"field":"workflow"},{"value":"Workflow"}]},{"as":"attention-reason","function":"concat","args":[{"field":"failure-count"},{"value":" failed runs in the selected horizon"}]},{"as":"action","function":"coalesce","args":[{"value":"Open latest failed run on GitHub"},{"value":"Open latest failed run on GitHub"}]},{"as":"icon","function":"coalesce","args":[{"value":"x-circle"},{"value":"x-circle"}]},{"as":"tone","function":"coalesce","args":[{"value":"critical"},{"value":"critical"}]},{"as":"priority","function":"number","args":[{"value":0}]}],"select":[{"field":"is-repeated"},{"field":"attention-signal-id"},{"field":"kind"},{"field":"title"},{"field":"scope"},{"field":"attention-reason","as":"reason"},{"field":"observed-at"},{"field":"action"},{"field":"evidence-link"},{"field":"run-link"},{"field":"icon"},{"field":"tone"},{"field":"priority"},{"field":"failure-count"}]},{"name":"overview-repeated-failure-attention","subject":"Keep only unresolved workflows with two or more failures in the selected horizon.","objective":"Surface blocked workflow items with observed repeated failures for bounded run investigation.","acceptance":"Every row inherits a blocked item with is-repeated true and projects evidence-link and run-link when available; verify run order, links, and current state before treating the failure as still unresolved.","from":"overview-repeated-failure-candidates","filter":{"predicates":[{"field":"is-repeated","equals":true}]},"select":[{"field":"attention-signal-id"},{"field":"kind"},{"field":"title"},{"field":"scope"},{"field":"reason"},{"field":"observed-at"},{"field":"action"},{"field":"evidence-link"},{"field":"run-link"},{"field":"icon"},{"field":"tone"},{"field":"priority"},{"field":"failure-count"}]},{"name":"overview-review-attention","subject":"Select only unresolved outputs explicitly awaiting human review with their retained GitHub evidence destination.","objective":"Present review-state work items and their retained GitHub destination to a human reviewer.","acceptance":"Rows are filtered to lifecycle-state review and project the work-item ID as attention-signal-id, plus reason, evidence-link, and run-link where present; reviewer disposition must be checked at source.","from":"work-items","filter":{"predicates":[{"field":"lifecycle-state","equals":"review"}]},"compute":[{"as":"kind","function":"coalesce","args":[{"value":"Human review required"},{"value":"Human review required"}]},{"as":"title","function":"coalesce","args":[{"field":"objective"},{"value":"Produced output"}]},{"as":"action","function":"coalesce","args":[{"value":"Open review item on GitHub"},{"value":"Open review item on GitHub"}]},{"as":"icon","function":"coalesce","args":[{"value":"eye"},{"value":"eye"}]},{"as":"tone","function":"coalesce","args":[{"value":"action"},{"value":"action"}]},{"as":"priority","function":"number","args":[{"value":1}]}],"select":[{"field":"work-item-id","as":"attention-signal-id"},{"field":"kind"},{"field":"title"},{"field":"scope"},{"field":"reason"},{"field":"observed-at"},{"field":"action"},{"field":"evidence-link"},{"field":"run-link"},{"field":"icon"},{"field":"tone"},{"field":"priority"}]},{"name":"overview-needs-attention","subject":"Combine grouped repeated failures and unresolved review outputs without introducing ordinary activity or duplicate work items.","objective":"Prioritize observed blocked repeated-failure work and review-state outputs for investigation.","acceptance":"Rows come only from the repeated-failure or review inputs and retain their source reasons, links, and ordering; confirm fresh source status before acting, and do not equate a missing row with resolved work.","from":"overview-repeated-failure-attention","union":["overview-review-attention"],"order-by":[{"field":"priority","direction":"asc"},{"field":"observed-at","direction":"desc"},{"field":"attention-signal-id","direction":"asc"}]},{"name":"domain-route-record","subject":"Project the selected domain header and one retained run link.","objective":"Identify the selected domain and open a retained run before investigating its traffic evidence.","acceptance":"The route header preserves the selected domain and a run link from its retained observations; missing observations or links remain unavailable, and a header does not establish access policy or traffic completeness.","from":"domains","select":[{"field":"domain"},{"field":"run-link"}]},{"name":"domain-run-records","subject":"Retained run-linked observations for the selected domain.","objective":"Find related runs without returning the unscoped domain collection alongside the paginated view.","acceptance":"Preserve every domain observation field, exact route scope, filtering, ordering, total count, provenance and related-run links; only the bounded view payload crosses the worker boundary.","from":"domains"},{"name":"tool-route-record","subject":"Project the selected MCP tool header and one retained run link.","objective":"Identify the selected MCP tool and open a retained run before investigating its call evidence.","acceptance":"The route header preserves the selected MCP tool label and a run link from its retained calls; absent calls or links remain unavailable and do not imply zero usage or tool effectiveness.","from":"mcp-tool-calls","select":[{"field":"mcp-tool-label"},{"field":"run-link"}]},{"name":"audit-route-record","subject":"Project the selected audit summary header and one retained run link.","objective":"Identify the selected audit summary and open a retained run before investigating its observations.","acceptance":"The route header preserves the selected event summary and a run link from its retained audit observations; absent evidence remains unavailable and neither the header nor its absence establishes incident severity or a clean audit.","from":"audits","select":[{"field":"event-summary"},{"field":"run-link"}]},{"name":"domain-entity-insights","subject":"Summarize one domain entity for its dedicated Insights view.","objective":"Identify domain decisions with request volume worth investigating before considering any egress change.","acceptance":"For the selected domain, request totals match the retained domain observations grouped by decision; missing data or blocked traffic does not establish a need for access, which requires underlying request and policy review.","from":"domains","aggregate":{"by":["domain","decision"],"values":[{"field":"request-count","as":"requests","reducer":"sum"}]},"order-by":[{"field":"requests","direction":"desc"},{"field":"decision","direction":"asc"}]},{"name":"tool-entity-insights","subject":"Summarize one tool entity for its dedicated Insights view.","objective":"Select a tool and status combination whose recorded call volume merits investigation.","acceptance":"For the selected tool, observation counts match retained MCP call observations grouped by server, tool, and status; missing calls are not zero usage and status counts do not establish effectiveness or cause.","from":"mcp-tool-calls","aggregate":{"by":["mcp-tool-label","mcp-server","mcp-tool","mcp-status"],"values":[{"field":"mcp-observation","as":"observations","reducer":"count"}]},"order-by":[{"field":"observations","direction":"desc"},{"field":"mcp-status","direction":"asc"}]},{"name":"audit-entity-insights","subject":"Summarize one audit event entity for its dedicated Insights view.","objective":"Select an audit summary and status requiring closer review of underlying observations.","acceptance":"For the selected summary, counts agree with retained audit observation IDs grouped by event status; repeated observations are not silently treated as distinct incidents, and absence does not prove no findings.","from":"audits","aggregate":{"by":["event-summary","event-status"],"values":[{"field":"id","as":"observations","reducer":"count"}]},"order-by":[{"field":"observations","direction":"desc"},{"field":"event-status","direction":"asc"}]}] +[{"name":"command-queue","subject":"Show the durable local CLI command queue.","objective":"Inspect command lifecycle and reconnect to output without rerunning work.","acceptance":"Preserve persistent command IDs and all six server states; closing output never cancels execution. Unavailable local authority is not an empty queue.","from":"cli-commands","compute":[{"as":"command-action","function":"coalesce","args":[{"field":"actionId"},{"value":""}]},{"as":"command-title","function":"coalesce","args":[{"field":"command"},{"field":"actionId"}]},{"as":"command-target","function":"coalesce","args":[{"field":"repository"},{"field":"campaign"},{"field":"package-source"},{"value":"Local control repository"}]},{"as":"command-created-at","function":"coalesce","args":[{"field":"createdAt"},{"value":null}]},{"as":"command-href","function":"concat","args":[{"value":"#page-command?command="},{"field":"id"}]},{"as":"command-dashboard-link","function":"dashboard-link","args":[{"value":""},{"field":"command-href"},{"field":"command-title"},{"field":"id"}]}]},{"name":"event-base","subject":"Project shared event fields before combining run-owned records.","objective":"Provide the narrow retained event evidence needed for inspection and run import-coverage analysis.","acceptance":"The result unions retained audit, domain, tool, and issue records with their available run identity; an empty or unavailable preview cannot establish zero source activity or complete import coverage.","from":"audits","union":["domains","tools","issues"],"select":[{"field":"organization"},{"field":"repository"},{"field":"workflow"},{"field":"run"},{"field":"run-attempt"},{"field":"event"},{"field":"event-source"},{"field":"event-type"},{"field":"event-summary"},{"field":"event-status"},{"field":"github-entity-type"},{"field":"safe-output-type"},{"field":"safe-output-url"},{"field":"correlation-id"},{"field":"implementation-pull-request-url"},{"field":"event-timestamp"},{"field":"run-link"}]},{"name":"audit-event-runs","subject":"Count imported audit records per run before combining event sources.","objective":"Bound audit evidence for run import-coverage analysis.","acceptance":"Count only retained audit records with event identity by run attempt; missing evidence does not establish zero activity.","from":"audits","aggregate":{"by":["organization","repository","workflow","run","run-attempt"],"values":[{"field":"event","as":"events","reducer":"count"}]}},{"name":"domain-event-runs","subject":"Count imported domain records per run before combining event sources.","objective":"Bound domain evidence for run import-coverage analysis.","acceptance":"Count only retained domain records with event identity by run attempt; missing evidence does not establish zero activity.","from":"domains","aggregate":{"by":["organization","repository","workflow","run","run-attempt"],"values":[{"field":"event","as":"events","reducer":"count"}]}},{"name":"tool-event-runs","subject":"Count imported tool records per run before combining event sources.","objective":"Bound tool evidence for run import-coverage analysis.","acceptance":"Count only retained tool records with event identity by run attempt; missing evidence does not establish zero activity.","from":"tools","aggregate":{"by":["organization","repository","workflow","run","run-attempt"],"values":[{"field":"event","as":"events","reducer":"count"}]}},{"name":"issue-event-runs","subject":"Count imported issue records per run before combining event sources.","objective":"Bound issue evidence for run import-coverage analysis.","acceptance":"Count only retained issue records with event identity by run attempt; missing evidence does not establish zero activity.","from":"issues","aggregate":{"by":["organization","repository","workflow","run","run-attempt"],"values":[{"field":"event","as":"events","reducer":"count"}]}},{"name":"event-runs","subject":"Identify each workflow run that has one or more imported run-owned records.","objective":"Identify run attempts with retained imported records so their presence can be compared with observed runs.","acceptance":"One row per organization, repository, workflow, run, and attempt contains events, the count of matching retained records; no row in an available result does not prove that no event was produced.","description":"Distinct workflow runs represented by imported domain, tool, audit, or issue records.","from":"audit-event-runs","union":["domain-event-runs","tool-event-runs","issue-event-runs"],"aggregate":{"by":["organization","repository","workflow","run","run-attempt"],"values":[{"field":"events","as":"events","reducer":"sum"}]}},{"name":"run-import-status","subject":"Identify observed runs that have one or more imported run-owned records.","objective":"Compare observed run attempts with retained run-owned event evidence to locate import-coverage gaps for investigation.","acceptance":"Keep each observed run and its run-attempt identity; imported-event-count is zero and imported is false without a matching retained event, but missing events alone do not establish an ingestion failure.","description":"Observed runs enriched with imported-record status.","from":"runs","joins":[{"source":"event-runs","type":"left","on":[{"left":"organization","right":"organization"},{"left":"repository","right":"repository"},{"left":"workflow","right":"workflow"},{"left":"run","right":"run"},{"left":"run-attempt","right":"run-attempt"}],"fields":[{"field":"events","as":"imported-events"}]}],"compute":[{"as":"imported-event-count","function":"coalesce","args":[{"field":"imported-events"},{"value":0}]},{"as":"imported","function":"greater-than","args":[{"field":"imported-event-count"},{"value":0}]}]},{"name":"workflow-run-totals","subject":"Summarize observed run counts and imported runs by declared workflow.","objective":"Compare observed run attempts, conclusions, and imported-record coverage for each workflow.","acceptance":"Group by organization, repository, and workflow; report distinct run-attempt totals, successful and failed conclusion counts, and imported-run totals only from retained evidence. Missing run records cannot establish zero execution.","description":"Observed run and imported-run totals for each declared workflow.","from":"run-import-status","compute":[{"as":"run-attempt-identity","function":"concat","args":[{"field":"run"},{"value":":"},{"field":"run-attempt"}]}],"aggregate":{"by":["organization","repository","workflow"],"values":[{"field":"run-attempt-identity","as":"runs","reducer":"distinct-count"},{"field":"run-conclusion","as":"successful-runs","reducer":"count","filter":{"predicates":[{"field":"run-conclusion","equals":"success"}]}},{"field":"run-conclusion","as":"failed-runs","reducer":"count","filter":{"predicates":[{"field":"run-conclusion","in":["failure","startup-failure","stale","timed-out"]}]}},{"field":"imported","as":"imported-runs","reducer":"sum"}]}},{"name":"workflow-aic-run-totals","subject":"Summarize observed run attempts and AI Credits for workflow cost comparison.","objective":"Count retained run attempts and recorded AI Credits without loading imported-event coverage.","acceptance":"Count all distinct retained run attempts, but include only positive recorded AIC in cost totals and cost denominators; zero and missing telemetry cannot skew cost averages.","from":"runs","compute":[{"as":"run-attempt-identity","function":"concat","args":[{"field":"run"},{"value":":"},{"field":"run-attempt"}]},{"as":"positive-aic","function":"greater-than","args":[{"field":"aic-total"},{"value":0}]}],"aggregate":{"by":["organization","repository","workflow"],"values":[{"field":"run-attempt-identity","as":"runs","reducer":"distinct-count"},{"field":"run-attempt-identity","as":"aic-runs","reducer":"distinct-count","filter":{"predicates":[{"field":"positive-aic","equals":true}]}},{"field":"aic-total","as":"aic","reducer":"sum","filter":{"predicates":[{"field":"positive-aic","equals":true}]}}]}},{"name":"workflow-aic-totals","subject":"Summarize observed AI Credit usage by declared workflow.","objective":"Expose retained AI Credit consumption per workflow for bounded cost review alongside observed execution.","acceptance":"Sum only positive recorded aic-total by organization, repository, and workflow; exclude zero and missing costs rather than treating them as free execution.","description":"Observed AI Credit totals for each declared workflow.","from":"workflow-aic-run-totals","filter":{"predicates":[{"field":"aic-runs","gte":1}]},"select":[{"field":"organization"},{"field":"repository"},{"field":"workflow"},{"field":"aic"},{"field":"aic-runs"}]},{"name":"mcp-tool-workflow-totals","subject":"Summarize observed MCP calls by tool and workflow before the tool inventory is materialized.","objective":"Keep MCP inventory intermediates bounded without dropping calls or changing byte totals.","acceptance":"Count retained observation identities and sum request and response bytes per server, tool, and workflow; retain safe-output-server classification for downstream exclusion.","from":"mcp-calls","compute":[{"as":"safe-output-server","function":"equals-any","args":[{"field":"mcp-server"},{"value":"safe_outputs"},{"value":"safeoutputs"}]},{"as":"mcp-tool-label","function":"concat","args":[{"field":"mcp-server"},{"value":"/"},{"field":"mcp-tool"}]},{"as":"workflow-key","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"},{"value":":"},{"field":"workflow"}]}],"aggregate":{"by":["safe-output-server","mcp-tool-label","mcp-server","mcp-tool","workflow-key"],"values":[{"field":"mcp-observation","as":"calls","reducer":"count"},{"field":"request-bytes","as":"request-bytes","reducer":"sum"},{"field":"response-bytes","as":"response-bytes","reducer":"sum"}]}},{"name":"mcp-tool-calls","subject":"Prepare MCP tool calls for aggregation with safe-output-server calls identified for downstream exclusion.","objective":"Identify retained MCP call labels and safe-output-server classification for downstream tool-use investigation.","acceptance":"Preserve each retained call with its workflow key and tool label and mark safe-output-server calls explicitly; downstream exclusion must not be mistaken for absence of those calls or complete tool telemetry.","description":"Observed MCP tool calls labeled with whether they belong to the internal safe outputs server.","from":"mcp-calls","compute":[{"as":"safe-output-server","function":"equals-any","args":[{"field":"mcp-server"},{"value":"safe_outputs"},{"value":"safeoutputs"}]},{"as":"mcp-tool-label","function":"concat","args":[{"field":"mcp-server"},{"value":"/"},{"field":"mcp-tool"}]},{"as":"workflow-key","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"},{"value":":"},{"field":"workflow"}]}]},{"name":"issue-safe-outputs","subject":"List retained GitHub issue safe outputs.","objective":"Inspect retained issue safe outputs and their observed closure state before deciding which items need follow-up.","acceptance":"Include only safe_output.result issue records, not pull requests; preserve issue and run links, timestamps, state, and status detail. Unknown or unobserved closure state must not be presented as closed.","description":"Issue-only projection of retained safe-output items.","from":"issues","filter":{"predicates":[{"field":"event-type","equals":"safe_output.result"},{"field":"is-pull-request","equals":false}]},"joins":[{"source":"runs","type":"left","on":[{"left":"organization","right":"organization"},{"left":"repository","right":"repository"},{"left":"workflow","right":"workflow"},{"left":"run","right":"run"},{"left":"run-attempt","right":"run-attempt"}],"fields":[{"field":"run-link","as":"linked-run"}]}],"compute":[{"as":"_issue-state-open","function":"equals-any","args":[{"field":"issue-state"},{"value":"OPEN"}]},{"as":"_issue-state-closed","function":"equals-any","args":[{"field":"issue-state"},{"value":"CLOSED"}]},{"as":"_issue-open-status","function":"if","args":[{"field":"_issue-state-open"},{"value":"Open"},{"value":"Unknown"}]},{"as":"issue-status","function":"if","args":[{"field":"_issue-state-closed"},{"value":"Closed"},{"field":"_issue-open-status"}]},{"as":"_issue-closing-reason","function":"coalesce","args":[{"field":"issue-state-reason"},{"value":"unknown"}]},{"as":"_issue-closing-reason-normalized","function":"lower","args":[{"field":"_issue-closing-reason"}]},{"as":"issue-closing-status","function":"title-case","args":[{"field":"_issue-closing-reason-normalized"}]},{"as":"_issue-closed-status-detail","function":"concat","args":[{"value":"Closed: "},{"field":"issue-closing-status"}]},{"as":"issue-status-detail","function":"if","args":[{"field":"_issue-state-closed"},{"field":"_issue-closed-status-detail"},{"field":"issue-status"}]}],"select":[{"field":"event-timestamp","as":"observed-at"},{"field":"github-entity-type"},{"field":"is-pull-request"},{"field":"safe-output-type"},{"field":"issue-state"},{"field":"issue-closed"},{"field":"issue-state-reason"},{"field":"issue-status"},{"field":"issue-closing-status"},{"field":"issue-status-detail"},{"field":"issue-closed-at"},{"field":"issue-status-observed-at"},{"field":"event-summary"},{"field":"correlation-id","as":"entity-url"},{"field":"organization"},{"field":"repository"},{"field":"workflow"},{"field":"run"},{"field":"linked-run","as":"run-link"}],"order-by":[{"field":"observed-at","direction":"desc"},{"field":"entity-url","direction":"asc"}]},{"name":"issue-safe-output-label-options","subject":"List observed safe-output badges for the issue list Labels filter.","objective":"Choose retained safe-output types without scanning or filtering presented cards.","acceptance":"Return distinct observed badge values in ascending order; missing evidence is not an empty label inventory.","from":"issue-safe-outputs","aggregate":{"by":["safe-output-type"],"values":[{"field":"entity-url","as":"items","reducer":"count"}]},"order-by":[{"field":"safe-output-type","direction":"asc"}]},{"name":"issue-status-label-options","subject":"List observed status badges for the issue list Status filter.","objective":"Choose retained issue states and closing reasons without inferring resolution.","acceptance":"Return distinct observed status details in ascending order; Unknown remains distinct from Open and Closed.","from":"issue-safe-outputs","aggregate":{"by":["issue-status-detail"],"values":[{"field":"entity-url","as":"items","reducer":"count"}]},"order-by":[{"field":"issue-status-detail","direction":"asc"}]},{"name":"issue-repository-totals","subject":"Rank the ten repositories with the most retained GitHub issue safe outputs.","objective":"Locate repositories with the largest observed issue-safe-output volume for a bounded review of linked records.","acceptance":"Return at most ten repository coordinates ordered by retained issue-record count; ties or missing issue evidence must not imply a complete fleet ranking or unique issue count.","description":"Top repositories by retained issue safe-output count.","from":"issue-safe-outputs","compute":[{"as":"repository-coordinate","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"}]}],"aggregate":{"by":["repository-coordinate"],"values":[{"field":"entity-url","as":"issues","reducer":"count"}]},"order-by":[{"field":"issues","direction":"desc"},{"field":"repository-coordinate","direction":"asc"}],"limit":10},{"name":"campaign-import-audit-count","subject":"Count retained audit identities for campaign inventory source quality.","objective":"Retain audit provenance without reconstructing run coverage.","acceptance":"Count canonical audit IDs; missing evidence stays unavailable and the count is not displayed as import coverage.","from":"audits","aggregate":{"values":[{"field":"id","as":"records","reducer":"count"}]}},{"name":"campaign-import-domain-count","subject":"Count retained domain identities for campaign inventory source quality.","objective":"Retain domain provenance without reconstructing run coverage.","acceptance":"Count canonical domain IDs; missing evidence stays unavailable and the count is not displayed as import coverage.","from":"domains","aggregate":{"values":[{"field":"id","as":"records","reducer":"count"}]}},{"name":"campaign-import-tool-count","subject":"Count retained tool identities for campaign inventory source quality.","objective":"Retain tool provenance without reconstructing run coverage.","acceptance":"Count canonical tool IDs; missing evidence stays unavailable and the count is not displayed as import coverage.","from":"tools","aggregate":{"values":[{"field":"id","as":"records","reducer":"count"}]}},{"name":"campaign-import-issue-count","subject":"Count retained issue identities for campaign inventory source quality.","objective":"Retain issue provenance without reconstructing run coverage.","acceptance":"Count canonical issue IDs; missing evidence stays unavailable and the count is not displayed as import coverage.","from":"issues","aggregate":{"values":[{"field":"id","as":"records","reducer":"count"}]}},{"name":"campaign-workflow-import-evidence","subject":"Compose retained import-source quality for campaign workflow execution totals.","objective":"Preserve all four import dependencies without counting unused per-run or per-workflow coverage.","acceptance":"Compose audit, domain, tool, and issue availability, freshness, and completeness exactly as event-runs. The retained-record count carries source quality only; it is not displayed or used as horizon-specific import coverage, executions, or outcomes. Run and AI Credit totals retain their selected horizon.","from":"campaign-import-audit-count","union":["campaign-import-domain-count","campaign-import-tool-count","campaign-import-issue-count"],"time":{"range":"all"},"compute":[{"as":"import-scope","function":"literal","args":[{"value":"retained"}]}],"aggregate":{"by":["import-scope"],"values":[{"field":"records","as":"events","reducer":"sum"}]}},{"name":"campaign-workflow-execution-base","subject":"Summarize retained run attempts and AI Credits before campaign workflow enrichment.","objective":"Read run identity and recorded AI Credits together instead of enriching every run with import status.","acceptance":"Count distinct run-attempt identities and sum aic-total per organization, repository, and workflow; missing retained evidence is not proof of no execution or cost.","from":"runs","compute":[{"as":"import-scope","function":"literal","args":[{"value":"retained"}]},{"as":"run-attempt-identity","function":"concat","args":[{"field":"run"},{"value":":"},{"field":"run-attempt"}]},{"as":"positive-aic","function":"greater-than","args":[{"field":"aic-total"},{"value":0}]}],"aggregate":{"by":["organization","repository","workflow","import-scope"],"values":[{"field":"run-attempt-identity","as":"runs","reducer":"distinct-count"},{"field":"aic-total","as":"aic","reducer":"sum","filter":{"predicates":[{"field":"positive-aic","equals":true}]}}]}},{"name":"campaign-workflow-execution-totals","subject":"Attach retained import-evidence quality to compact workflow execution totals.","objective":"Preserve the public inventory's run and import availability composition after aggregating run evidence.","acceptance":"Keep runs and AI Credits unchanged; unavailable run evidence fails closed and optional import evidence degrades quality exactly as in run-import-status.","description":"Only source quality is consumed from import evidence. Join its compact retained-source summary after run aggregation; do not build unused run-level import coverage or change horizon-specific execution totals.","from":"campaign-workflow-execution-base","joins":[{"source":"campaign-workflow-import-evidence","type":"left","on":[{"left":"import-scope","right":"import-scope"}],"fields":[{"field":"events","as":"imported-events"}]}],"select":[{"field":"organization"},{"field":"repository"},{"field":"workflow"},{"field":"runs"},{"field":"aic"}]},{"name":"campaign-workflow-declarations","subject":"Project reusable campaign workflow declarations without execution evidence.","objective":"Share declaration display fields between structural topology and execution inventory without joining runs or import evidence.","acceptance":"Preserve raw organization, repository, workflow and declaration fields for joins. Select orchestrator and worker roles once, retaining inactive and unknown declarations; only list consumers select active entries. Display defaults and repository links do not establish execution, enrollment or authority.","from":"workflows","filter":{"predicates":[{"field":"workflow-role","in":["orchestrator","worker"]}]},"compute":[{"as":"repository-slug","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"}]},{"as":"declared-mode","function":"coalesce","args":[{"field":"rollout-mode"},{"value":"unknown"}]},{"as":"declared-registration","function":"coalesce","args":[{"field":"workflow-active"},{"value":"unknown"}]},{"as":"campaign-title","function":"title-case","args":[{"field":"campaign"}]},{"as":"campaign-display-name","function":"coalesce","args":[{"field":"campaign-name"},{"field":"campaign-title"},{"value":"Repository-owned"}]},{"as":"workflow-display-name","function":"coalesce","args":[{"field":"workflow-name"},{"field":"workflow"}]},{"as":"encoded-repository","function":"url-encode","args":[{"field":"repository-slug"}]},{"as":"repository-dashboard-href","function":"concat","args":[{"value":"#page-repository-detail?repository="},{"field":"encoded-repository"}]},{"as":"repository-dashboard-label","function":"concat","args":[{"value":"View "},{"field":"repository-slug"},{"value":" repository dashboard"}]},{"as":"repository-dashboard-link","function":"dashboard-link","args":[{"field":"repository-link"},{"field":"repository-dashboard-href"},{"field":"repository-dashboard-label"},{"field":"repository-slug"}]}],"select":[{"field":"organization"},{"field":"repository"},{"field":"workflow"},{"field":"campaign"},{"field":"campaign-name"},{"field":"workflow-name"},{"field":"workflow-role"},{"field":"rollout-mode"},{"field":"workflow-active"},{"field":"repository-link"},{"field":"workflow-link"},{"field":"repository-slug"},{"field":"declared-mode"},{"field":"declared-registration"},{"field":"campaign-display-name"},{"field":"workflow-display-name"},{"field":"repository-dashboard-link"}]},{"name":"campaign-workflow-inventory","subject":"Project declared campaign workflows with lean execution and configuration evidence.","objective":"Provide campaign totals and lists from shared declarations with separate execution and import-quality evidence.","acceptance":"Keep all declared orchestrators and workers, including inactive and unobserved entries; preserve inventory ordering, configuration defaults, execution totals, and import-evidence quality.","description":"Lean campaign inventory with execution totals that retain the public workflow inventory's evidence-quality dependencies.","from":"campaign-workflow-declarations","joins":[{"source":"campaign-workflow-execution-totals","type":"left","on":[{"left":"organization","right":"organization"},{"left":"repository","right":"repository"},{"left":"workflow","right":"workflow"}],"fields":[{"field":"runs","as":"observed-runs"},{"field":"aic","as":"observed-aic"}]}],"compute":[{"as":"total-runs","function":"coalesce","args":[{"field":"observed-runs"},{"value":0}]},{"as":"total-aic","function":"coalesce","args":[{"field":"observed-aic"},{"value":0}]}],"select":[{"field":"campaign"},{"field":"campaign-name"},{"field":"organization"},{"field":"repository-slug","as":"repository"},{"field":"workflow"},{"field":"workflow-name"},{"field":"workflow-role"},{"field":"declared-mode","as":"rollout-mode"},{"field":"declared-registration","as":"workflow-active"},{"field":"total-runs","as":"runs"},{"field":"total-aic","as":"aic"},{"field":"repository-link"},{"field":"workflow-link"},{"field":"campaign-display-name"},{"field":"workflow-display-name"},{"field":"repository-dashboard-link"}],"order-by":[{"field":"repository","direction":"asc"},{"field":"workflow","direction":"asc"}]},{"name":"workflow-inventory","subject":"List declared workflows with their campaign, repository, configuration, and observed execution totals.","objective":"Compare declared workflow configuration with retained run, import-coverage, and AI Credit evidence to select a workflow for closer inspection.","acceptance":"Keep one row per declared workflow with identity, role, mode, registration, links, observed totals, and ingestion indicator; zero joined totals and missing evidence must not be treated as proof of no execution or complete ingestion.","description":"Central campaign and repository-owned workflow inventory with observed execution totals.","from":"workflows","joins":[{"source":"workflow-run-totals","type":"left","on":[{"left":"organization","right":"organization"},{"left":"repository","right":"repository"},{"left":"workflow","right":"workflow"}],"fields":[{"field":"runs","as":"observed-runs"},{"field":"successful-runs","as":"observed-successful-runs"},{"field":"failed-runs","as":"observed-failed-runs"},{"field":"imported-runs","as":"observed-imported-runs"}]},{"source":"workflow-aic-totals","type":"left","on":[{"left":"organization","right":"organization"},{"left":"repository","right":"repository"},{"left":"workflow","right":"workflow"}],"fields":[{"field":"aic","as":"observed-aic"},{"field":"aic-runs","as":"observed-aic-runs"}]}],"compute":[{"as":"campaign-title","function":"title-case","args":[{"field":"campaign"}]},{"as":"campaign-display-name","function":"coalesce","args":[{"field":"campaign-name"},{"field":"campaign-title"},{"value":"Repository-owned"}]},{"as":"repository-slug","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"}]},{"as":"workflow-display-name","function":"coalesce","args":[{"field":"workflow-name"},{"field":"workflow"}]},{"as":"declared-role","function":"coalesce","args":[{"field":"workflow-role"},{"value":"standalone"}]},{"as":"declared-mode","function":"coalesce","args":[{"field":"rollout-mode"},{"value":"unknown"}]},{"as":"declared-registration","function":"coalesce","args":[{"field":"workflow-active"},{"value":"unknown"}]},{"as":"total-runs","function":"coalesce","args":[{"field":"observed-runs"},{"value":0}]},{"as":"total-successful-runs","function":"coalesce","args":[{"field":"observed-successful-runs"},{"value":0}]},{"as":"has-observed-runs","function":"greater-than","args":[{"field":"total-runs"},{"value":0}]},{"as":"total-failed-runs","function":"coalesce","args":[{"field":"observed-failed-runs"},{"value":0}]},{"as":"total-aic","function":"coalesce","args":[{"field":"observed-aic"},{"value":0}]},{"as":"aic-per-run","function":"quotient","args":[{"field":"total-aic"},{"field":"observed-aic-runs"}]},{"as":"total-imported-runs","function":"coalesce","args":[{"field":"observed-imported-runs"},{"value":0}]},{"as":"ingestion-rate","function":"quotient","args":[{"field":"total-imported-runs"},{"field":"total-runs"}]},{"as":"ingestion","function":"format-percent","args":[{"field":"ingestion-rate"}]},{"as":"encoded-campaign","function":"url-encode","args":[{"field":"campaign"}]},{"as":"campaign-dashboard-href","function":"concat","args":[{"value":"#page-campaign-insights?campaign="},{"field":"encoded-campaign"}]},{"as":"campaign-dashboard-label","function":"concat","args":[{"value":"View "},{"field":"campaign-display-name"},{"value":" campaign dashboard"}]},{"as":"campaign-dashboard-link","function":"dashboard-link","args":[{"field":"repository-link"},{"field":"campaign-dashboard-href"},{"field":"campaign-dashboard-label"},{"field":"campaign"}]},{"as":"encoded-repository","function":"url-encode","args":[{"field":"repository-slug"}]},{"as":"repository-dashboard-href","function":"concat","args":[{"value":"#page-repository-detail?repository="},{"field":"encoded-repository"}]},{"as":"repository-dashboard-label","function":"concat","args":[{"value":"View "},{"field":"repository-slug"},{"value":" repository dashboard"}]},{"as":"repository-dashboard-link","function":"dashboard-link","args":[{"field":"repository-link"},{"field":"repository-dashboard-href"},{"field":"repository-dashboard-label"},{"field":"repository-slug"}]},{"as":"workflow-identity","function":"concat","args":[{"field":"repository-slug"},{"value":":"},{"field":"workflow"}]},{"as":"encoded-workflow","function":"url-encode","args":[{"field":"workflow-identity"}]},{"as":"workflow-dashboard-href","function":"concat","args":[{"value":"#page-workflow-runtime?workflow="},{"field":"encoded-workflow"}]},{"as":"workflow-dashboard-label","function":"concat","args":[{"value":"View "},{"field":"workflow-display-name"},{"value":" workflow dashboard"}]},{"as":"workflow-dashboard-link","function":"dashboard-link","args":[{"field":"workflow-link"},{"field":"workflow-dashboard-href"},{"field":"workflow-dashboard-label"},{"field":"workflow-identity"}]}],"select":[{"field":"campaign"},{"field":"campaign-display-name","as":"campaign-name"},{"field":"organization"},{"field":"repository-slug","as":"repository"},{"field":"workflow"},{"field":"workflow-display-name","as":"workflow-name"},{"field":"workflow-identity","as":"workflow-label"},{"field":"declared-role","as":"workflow-role"},{"field":"declared-mode","as":"rollout-mode"},{"field":"declared-registration","as":"workflow-active"},{"field":"total-aic","as":"aic"},{"field":"total-runs","as":"runs"},{"field":"total-successful-runs","as":"successful-runs"},{"field":"total-failed-runs","as":"failed-runs"},{"field":"aic-per-run"},{"field":"has-observed-runs"},{"field":"ingestion"},{"field":"campaign-dashboard-link","as":"campaign-link"},{"field":"repository-dashboard-link","as":"repository-link"},{"field":"workflow-dashboard-link","as":"workflow-link"}],"order-by":[{"field":"repository","direction":"asc"},{"field":"workflow","direction":"asc"}]},{"name":"repository-run-statistics","subject":"Reduce run counts, conclusions, and positive AI Credits before repository enrichment.","objective":"Share one row-local run aggregate between repository execution and cost summaries.","acceptance":"Keep organization/repository grain, distinct run IDs, existing failure and approval counts, and positive recorded AIC. Reduce before joins; missing evidence is not zero activity or free execution.","from":"runs","compute":[{"as":"positive-aic","function":"greater-than","args":[{"field":"aic-total"},{"value":0}]}],"aggregate":{"by":["organization","repository"],"values":[{"field":"run","as":"runs","reducer":"distinct-count"},{"field":"run-conclusion","as":"failed","reducer":"count","filter":{"predicates":[{"field":"run-conclusion","in":["failure","startup-failure","timed-out"]}]}},{"field":"run-conclusion","as":"action-required","reducer":"count","filter":{"predicates":[{"field":"run-conclusion","equals":"action-required"}]}},{"field":"run","as":"aic-runs","reducer":"count","filter":{"predicates":[{"field":"positive-aic","equals":true}]}},{"field":"aic-total","as":"aic","reducer":"sum","filter":{"predicates":[{"field":"positive-aic","equals":true}]}}]}},{"name":"repository-aic-totals","subject":"Summarize observed AI Credit usage by repository.","objective":"Provide repository-level retained AI Credit totals for comparing observed usage with run activity.","acceptance":"Sum only positive recorded aic-total by organization and repository; exclude zero and missing costs rather than treating them as free execution.","description":"Observed AI Credit totals for each repository.","from":"repository-run-statistics","filter":{"predicates":[{"field":"aic-runs","gte":1}]},"select":[{"field":"organization"},{"field":"repository"},{"field":"aic"}]},{"name":"maintenance-campaign-packages","subject":"Installed campaign packages with retained source coordinates and update evidence.","objective":"Show installed/current source revisions and gate update actions on exact retained provenance.","acceptance":"Return every package. Set campaign-update-action-visible only for update-available rows with a non-empty source; missing provenance stays visible and non-actionable.","from":"campaigns","compute":[{"as":"campaign-source-unavailable","function":"equals-any","args":[{"field":"campaign-source"},{"value":""},{"value":"unknown"},{"value":null}]},{"as":"campaign-action-state","function":"if","args":[{"field":"campaign-source-unavailable"},{"value":"unknown"},{"field":"campaign-update-state"}]},{"as":"campaign-update-action-visible","function":"equals-any","args":[{"field":"campaign-action-state"},{"value":"update-available"}]}],"select":[{"field":"campaign"},{"field":"campaign-name"},{"field":"campaign-description"},{"field":"campaign-icon"},{"field":"campaign-source"},{"field":"campaign-version"},{"field":"campaign-current-version"},{"field":"campaign-update-state"},{"field":"campaign-registration"},{"field":"campaign-update-action-visible"}],"order-by":[{"field":"campaign-name","direction":"asc"}]},{"name":"maintenance-standalone-workflows","subject":"Standalone workflows with retained upstream provenance and update evidence.","objective":"Represent source-managed and local workflows without synthetic campaign membership.","acceptance":"Retain exact coordinates and revisions for source-managed rows; keep local or incomplete rows visible and non-actionable with an explicit reason.","from":"workflows","filter":{"predicates":[{"field":"workflow-role","equals":"standalone"},{"field":"workflow-source-kind","in":["source-managed","local"]}]},"compute":[{"as":"workflow-source-installed-unavailable","function":"equals-any","args":[{"field":"workflow-source-version"},{"value":""},{"value":"unknown"},{"value":null}]},{"as":"workflow-source-latest-unavailable","function":"equals-any","args":[{"field":"workflow-source-current-version"},{"value":""},{"value":"unknown"},{"value":null}]},{"as":"workflow-is-local","function":"equals-any","args":[{"field":"workflow-source-kind"},{"value":"local"}]},{"as":"workflow-source-state","function":"if","args":[{"field":"workflow-is-local"},{"value":"local"},{"field":"workflow-source-update-state"}]},{"as":"workflow-source-update-available","function":"equals-any","args":[{"field":"workflow-source-state"},{"value":"update-available"}]},{"as":"workflow-source-update-unknown","function":"equals-any","args":[{"field":"workflow-source-state"},{"value":"unknown"}]},{"as":"workflow-update-state-known","function":"if","args":[{"field":"workflow-source-update-available"},{"value":"Update available"},{"value":"Current"}]},{"as":"workflow-update-state-with-unknown","function":"if","args":[{"field":"workflow-source-update-unknown"},{"value":"Update status unavailable"},{"field":"workflow-update-state-known"}]},{"as":"workflow-update-state","function":"if","args":[{"field":"workflow-is-local"},{"value":"Local workflow"},{"field":"workflow-update-state-with-unknown"}]},{"as":"workflow-update-reason-installed","function":"if","args":[{"field":"workflow-source-installed-unavailable"},{"value":"Installed source revision unavailable."},{"value":"Installed and upstream source revisions are available."}]},{"as":"workflow-update-reason-latest","function":"if","args":[{"field":"workflow-source-latest-unavailable"},{"value":"Latest upstream source revision unavailable."},{"field":"workflow-update-reason-installed"}]},{"as":"workflow-update-status-reason","function":"if","args":[{"field":"workflow-is-local"},{"value":"No upstream source coordinate was retained; update manually."},{"field":"workflow-update-reason-latest"}]},{"as":"workflow-update-action-visible","function":"equals-any","args":[{"field":"workflow-source-state"},{"value":"update-available"}]}],"select":[{"field":"organization"},{"field":"repository"},{"field":"workflow"},{"field":"workflow-name"},{"field":"workflow-source-kind"},{"field":"workflow-source"},{"field":"workflow-source-version"},{"field":"workflow-source-current-version"},{"field":"workflow-source-update-state"},{"field":"workflow-update-state"},{"field":"workflow-update-status-reason"},{"field":"workflow-update-action-visible"}],"order-by":[{"field":"workflow-update-action-visible","direction":"desc"},{"field":"workflow-name","direction":"asc"}]},{"name":"maintenance-repository-versions","subject":"Group installed and current gh-aw compiler versions and upgrade evidence by repository.","objective":"Identify repositories with declared Markdown workflows whose retained compiler-version evidence warrants upgrade review.","acceptance":"Group Markdown workflow declarations by repository coordinate and return distinct known installed/current version lists, distinct counts, upgrade-required evidence, and separate missing-installed/missing-latest flags. Never infer unavailable versions.","from":"workflows","filter":{"predicates":[{"field":"workflow","includes":".md"}]},"compute":[{"as":"repository-coordinate","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"}]},{"as":"installed-version-unavailable","function":"equals-any","args":[{"field":"gh-aw-version"},{"value":""},{"value":"unknown"},{"value":null}]},{"as":"current-version-unavailable","function":"equals-any","args":[{"field":"gh-aw-current-version"},{"value":""},{"value":"unknown"},{"value":null}]},{"as":"known-installed-version","function":"if","args":[{"field":"installed-version-unavailable"},{"value":null},{"field":"gh-aw-version"}]},{"as":"known-current-version","function":"if","args":[{"field":"current-version-unavailable"},{"value":null},{"field":"gh-aw-current-version"}]},{"as":"installed-version-unavailable-value","function":"if","args":[{"field":"installed-version-unavailable"},{"value":1},{"value":0}]},{"as":"current-version-unavailable-value","function":"if","args":[{"field":"current-version-unavailable"},{"value":1},{"value":0}]},{"as":"compiler-versions-match","function":"equals-any","args":[{"field":"gh-aw-version"},{"field":"gh-aw-current-version"}]},{"as":"upgrade-candidate-value","function":"if","args":[{"field":"compiler-versions-match"},{"value":0},{"value":1}]},{"as":"upgrade-with-current-evidence","function":"if","args":[{"field":"current-version-unavailable"},{"value":0},{"field":"upgrade-candidate-value"}]},{"as":"upgrade-required-value","function":"if","args":[{"field":"installed-version-unavailable"},{"value":0},{"field":"upgrade-with-current-evidence"}]}],"aggregate":{"by":["repository-coordinate"],"values":[{"field":"known-installed-version","as":"gh-aw-version","reducer":"distinct-list"},{"field":"known-current-version","as":"gh-aw-current-version","reducer":"distinct-list"},{"field":"known-installed-version","as":"installed-version-count","reducer":"distinct-count"},{"field":"known-current-version","as":"current-version-count","reducer":"distinct-count"},{"field":"upgrade-required-value","as":"upgrade-required","reducer":"max"},{"field":"installed-version-unavailable-value","as":"installed-version-unavailable","reducer":"max"},{"field":"current-version-unavailable-value","as":"current-version-unavailable","reducer":"max"}]}},{"name":"maintenance-repositories","subject":"List each repository with recorded compiler versions and computed upgrade state.","objective":"Expose recorded compiler versions, computed upgrade state, and a concise evidence diagnostic per repository, with its GitHub home URL for inspection.","acceptance":"Return repository, repository-url, known version lists, upgrade-required, upgrade-state, upgrade-status-reason, and upgrade-action-visible. Show Upgrade only when known evidence establishes an outdated compiler; missing or conflicting evidence stays visible and non-actionable.","from":"maintenance-repository-versions","compute":[{"as":"repository-url","function":"concat","args":[{"value":"https://github.com/"},{"field":"repository-coordinate"}]},{"as":"should-upgrade","function":"equals-any","args":[{"field":"upgrade-required"},{"value":1}]},{"as":"installed-version-mixed","function":"greater-than","args":[{"field":"installed-version-count"},{"value":1}]},{"as":"current-version-conflicting","function":"greater-than","args":[{"field":"current-version-count"},{"value":1}]},{"as":"installed-version-missing","function":"equals-any","args":[{"field":"installed-version-unavailable"},{"value":1}]},{"as":"current-version-missing","function":"equals-any","args":[{"field":"current-version-unavailable"},{"value":1}]},{"as":"latest-version-evidence-unavailable","function":"if","args":[{"field":"current-version-missing"},{"value":true},{"field":"current-version-conflicting"}]},{"as":"upgrade-status-unavailable","function":"if","args":[{"field":"installed-version-missing"},{"value":true},{"field":"latest-version-evidence-unavailable"}]},{"as":"current-or-unavailable","function":"if","args":[{"field":"should-upgrade"},{"value":true},{"field":"upgrade-status-unavailable"}]},{"as":"upgrade-state-known","function":"if","args":[{"field":"should-upgrade"},{"value":"Upgrade recommended"},{"value":"Current"}]},{"as":"upgrade-state","function":"if","args":[{"field":"upgrade-status-unavailable"},{"value":"Upgrade status unavailable"},{"field":"upgrade-state-known"}]},{"as":"upgrade-reason-known","function":"if","args":[{"field":"should-upgrade"},{"value":"At least one retained workflow uses an older gh-aw compiler version."},{"value":"All retained workflow compiler versions match the latest stable gh-aw release."}]},{"as":"upgrade-reason-mixed","function":"if","args":[{"field":"installed-version-mixed"},{"value":"Mixed installed gh-aw compiler versions were retained; at least one upgrade is recommended."},{"field":"upgrade-reason-known"}]},{"as":"upgrade-reason-installed","function":"if","args":[{"field":"installed-version-missing"},{"value":"Installed gh-aw compiler version unavailable for one or more workflows."},{"field":"upgrade-reason-mixed"}]},{"as":"upgrade-reason-current","function":"if","args":[{"field":"current-version-missing"},{"value":"Latest stable gh-aw release unavailable."},{"field":"upgrade-reason-installed"}]},{"as":"both-compiler-versions-missing","function":"if","args":[{"field":"installed-version-missing"},{"field":"current-version-missing"},{"value":false}]},{"as":"upgrade-reason-both","function":"if","args":[{"field":"both-compiler-versions-missing"},{"value":"Installed compiler version and latest stable gh-aw release are unavailable."},{"field":"upgrade-reason-current"}]},{"as":"upgrade-status-reason","function":"if","args":[{"field":"current-version-conflicting"},{"value":"Conflicting latest gh-aw release evidence was retained."},{"field":"upgrade-reason-both"}]},{"as":"upgrade-action-visible","function":"if","args":[{"field":"upgrade-status-unavailable"},{"value":false},{"field":"should-upgrade"}]},{"as":"installed-version-available","function":"greater-than","args":[{"field":"installed-version-count"},{"value":0}]},{"as":"current-version-available","function":"greater-than","args":[{"field":"current-version-count"},{"value":0}]},{"as":"gh-aw-version-label","function":"if","args":[{"field":"installed-version-available"},{"field":"gh-aw-version"},{"value":"unknown"}]},{"as":"gh-aw-current-version-label","function":"if","args":[{"field":"current-version-available"},{"field":"gh-aw-current-version"},{"value":"unknown"}]}],"select":[{"field":"repository-coordinate","as":"repository"},{"field":"repository-url"},{"field":"gh-aw-version-label","as":"gh-aw-version"},{"field":"gh-aw-current-version-label","as":"gh-aw-current-version"},{"field":"upgrade-required"},{"field":"upgrade-action-visible"},{"field":"upgrade-state"},{"field":"upgrade-status-reason"}],"order-by":[{"field":"repository","direction":"asc"}]},{"name":"maintenance-campaign-updates","subject":"Expose at most one CAO package update row for the Updates navigation indicator.","objective":"Determine whether retained campaign metadata contains an update-available signal for the Updates indicator.","acceptance":"Return zero or one campaign-update-state row only when it equals update-available; an empty result means no matching retained signal, not that every campaign is current.","from":"maintenance-campaign-packages","filter":{"predicates":[{"field":"campaign-update-action-visible","equals":true}]},"select":[{"field":"campaign-update-action-visible"}],"limit":1},{"name":"maintenance-standalone-updates","subject":"Expose at most one standalone workflow source update row for the Updates navigation indicator.","objective":"Determine whether retained source-managed standalone workflow metadata contains an actionable update signal for the Updates indicator.","acceptance":"Return zero or one workflow-update-action-visible row only when it is true; unmanaged local workflows and incomplete source evidence do not activate the indicator.","from":"maintenance-standalone-workflows","filter":{"predicates":[{"field":"workflow-update-action-visible","equals":true}]},"select":[{"field":"workflow-update-action-visible"}],"limit":1},{"name":"maintenance-repository-upgrades","subject":"Expose at most one gh-aw compiler upgrade row for the Updates navigation indicator.","objective":"Determine whether repository compiler metadata contains an upgrade-required signal for the Updates indicator.","acceptance":"Return zero or one upgrade-action-visible row only when known retained evidence establishes an outdated compiler; missing evidence remains non-actionable and does not activate the indicator.","from":"maintenance-repositories","filter":{"predicates":[{"field":"upgrade-action-visible","equals":true}]},"select":[{"field":"upgrade-action-visible"}],"limit":1},{"name":"run-incomplete-outcomes","subject":"Project retained report-incomplete terminal outcomes as concise run diagnoses.","objective":"Find recorded report_incomplete terminal outcomes that can explain a specific run's incomplete reporting.","acceptance":"Include only runs with a recorded report_incomplete terminal outcome, preserving run-attempt identity, outcome kind, and recorded diagnosis; absence is not proof that reporting completed.","description":"One retained incomplete-evidence diagnosis per workflow Run when the agent explicitly reported that required evidence or access was unavailable.","from":"runs","filter":{"predicates":[{"field":"terminal-outcome","equals":"report_incomplete"}]},"select":[{"field":"organization"},{"field":"repository"},{"field":"workflow"},{"field":"run"},{"field":"run-attempt"},{"field":"terminal-outcome","as":"outcome-kind"},{"field":"terminal-outcome-detail","as":"outcome-diagnosis"}]},{"name":"campaign-runs","subject":"Project workflow runs with campaign attribution and retained failure evidence.","objective":"Connect retained run status and failure details to declared campaign/workflow identity for run-level diagnosis.","acceptance":"Expose run and attempt identity, declared attribution, runtime and target repositories, status, failure and incomplete-outcome evidence, timestamps, and drill-down links; do not infer an outcome from runtime success or missing details.","description":"Canonical workflow runs joined to their declared campaign and workflow identity.","from":"runs","joins":[{"source":"workflows","type":"left","on":[{"left":"organization","right":"organization"},{"left":"repository","right":"repository"},{"left":"workflow","right":"workflow"}],"fields":[{"field":"campaign","as":"declared-campaign"},{"field":"campaign-name","as":"declared-campaign-name"},{"field":"workflow-name","as":"declared-workflow-name"},{"field":"workflow-role","as":"declared-workflow-role"},{"field":"workflow-link","as":"declared-workflow-link"}]},{"source":"run-incomplete-outcomes","type":"left","on":[{"left":"organization","right":"organization"},{"left":"repository","right":"repository"},{"left":"workflow","right":"workflow"},{"left":"run","right":"run"},{"left":"run-attempt","right":"run-attempt"}],"fields":[{"field":"outcome-kind","as":"outcome-kind"},{"field":"outcome-diagnosis","as":"outcome-diagnosis"}]}],"compute":[{"as":"status","function":"coalesce","args":[{"field":"run-conclusion"},{"field":"run-status"},{"value":"unknown"}]},{"as":"effective-outcome-kind","function":"coalesce","args":[{"field":"outcome-kind"},{"field":"terminal-outcome"},{"value":""}]},{"as":"is-incomplete-outcome","function":"equals-any","args":[{"field":"effective-outcome-kind"},{"value":"report_incomplete"}]},{"as":"diagnosis-kind","function":"if","args":[{"field":"is-incomplete-outcome"},{"value":"incomplete_evidence"},{"value":""}]},{"as":"error-signature","function":"coalesce","args":[{"field":"diagnosis-kind"},{"field":"failure-kind"},{"field":"classification"},{"field":"status"}]},{"as":"_error-signature-default-label","function":"title-case","args":[{"field":"error-signature"}]},{"as":"_is-driver-exit","function":"equals-any","args":[{"field":"error-signature"},{"value":"driver_exit"},{"value":"driver-exit"}]},{"as":"error-signature-label","function":"if","args":[{"field":"_is-driver-exit"},{"value":"Agent process exited unexpectedly"},{"field":"_error-signature-default-label"}]},{"as":"status-detail","function":"coalesce","args":[{"field":"outcome-diagnosis"},{"field":"terminal-outcome-detail"},{"field":"failure-detail"},{"field":"failure-message"},{"field":"failure-step"},{"field":"admission-reason"},{"value":""}]},{"as":"runtime-repository","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"}]},{"as":"is-worker","function":"equals-any","args":[{"field":"declared-workflow-role"},{"value":"worker"}]},{"as":"is-orchestrator","function":"equals-any","args":[{"field":"declared-workflow-role"},{"value":"orchestrator"}]},{"as":"root-dispatch-type","function":"if","args":[{"field":"is-orchestrator"},{"value":"Campaign orchestrator"},{"value":"Standalone workflow"}]},{"as":"dispatch-type","function":"if","args":[{"field":"is-worker"},{"value":"Campaign worker"},{"field":"root-dispatch-type"}]},{"as":"campaign-display-name","function":"coalesce","args":[{"field":"declared-campaign-name"},{"field":"declared-campaign"}]},{"as":"workflow-display-name","function":"coalesce","args":[{"field":"declared-workflow-name"},{"field":"workflow"}]},{"as":"encoded-campaign","function":"url-encode","args":[{"field":"declared-campaign"}]},{"as":"campaign-dashboard-href","function":"concat","args":[{"value":"#page-campaign-insights?campaign="},{"field":"encoded-campaign"}]},{"as":"campaign-dashboard-label","function":"concat","args":[{"value":"View "},{"field":"campaign-display-name"},{"value":" campaign dashboard"}]},{"as":"campaign-dashboard-link","function":"dashboard-link","args":[{"field":"repository-link"},{"field":"campaign-dashboard-href"},{"field":"campaign-dashboard-label"},{"field":"declared-campaign"}]},{"as":"encoded-repository","function":"url-encode","args":[{"field":"runtime-repository"}]},{"as":"repository-dashboard-href","function":"concat","args":[{"value":"#page-repository-detail?repository="},{"field":"encoded-repository"}]},{"as":"repository-dashboard-label","function":"concat","args":[{"value":"View "},{"field":"runtime-repository"},{"value":" repository dashboard"}]},{"as":"repository-dashboard-link","function":"dashboard-link","args":[{"field":"repository-link"},{"field":"repository-dashboard-href"},{"field":"repository-dashboard-label"},{"field":"runtime-repository"}]},{"as":"workflow-identity","function":"concat","args":[{"field":"runtime-repository"},{"value":":"},{"field":"workflow"}]},{"as":"encoded-workflow","function":"url-encode","args":[{"field":"workflow-identity"}]},{"as":"workflow-dashboard-href","function":"concat","args":[{"value":"#page-workflow-runtime?workflow="},{"field":"encoded-workflow"}]},{"as":"workflow-dashboard-label","function":"concat","args":[{"value":"View "},{"field":"workflow-display-name"},{"value":" workflow dashboard"}]},{"as":"workflow-dashboard-link","function":"dashboard-link","args":[{"field":"workflow-link"},{"field":"workflow-dashboard-href"},{"field":"workflow-dashboard-label"},{"field":"workflow-identity"}]}],"select":[{"field":"started-at"},{"field":"dispatch-type"},{"field":"declared-campaign","as":"campaign"},{"field":"declared-campaign-name","as":"campaign-name"},{"field":"declared-workflow-name","as":"workflow-name"},{"field":"run"},{"field":"run-attempt"},{"field":"run-title"},{"field":"event"},{"field":"runtime-repository"},{"field":"target-repository"},{"field":"rollout-mode"},{"field":"status"},{"field":"run-status"},{"field":"error-signature"},{"field":"error-signature-label"},{"field":"status-detail"},{"field":"outcome-kind"},{"field":"outcome-diagnosis"},{"field":"declared-workflow-role","as":"workflow-role"},{"field":"failure-job"},{"field":"failure-message"},{"field":"failure-step"},{"field":"failure-log"},{"field":"engine"},{"field":"engine-version"},{"field":"gh-aw-version"},{"field":"requested-model"},{"field":"resolved-model"},{"field":"aic-total"},{"field":"safe-items-count"},{"field":"resource-reset-at","as":"status-detail-at"},{"field":"organization"},{"field":"repository"},{"field":"workflow"},{"field":"declared-workflow-link","as":"workflow-source-link"},{"field":"run-link"},{"field":"campaign-dashboard-link","as":"campaign-link"},{"field":"repository-dashboard-link","as":"repository-link"},{"field":"workflow-dashboard-link","as":"workflow-link"}],"order-by":[{"field":"started-at","direction":"desc"}]},{"name":"campaign-runtime-health-runs","subject":"Project only the run and workflow fields required to classify current campaign runtime health.","objective":"Provide the retained run identity, timing, role, dispatch type, repository, and status needed to assess campaign runtime-health groups.","acceptance":"Project the selected fields from overview-runs without converting missing statuses or unattributed workflows into failures; unavailable run history leaves health assessment incomplete.","description":"A bounded runtime-health input that excludes audit outcomes and presentation-only campaign run fields.","from":"overview-runs","compute":[{"as":"status","function":"coalesce","args":[{"field":"run-conclusion"},{"field":"run-status"},{"value":"unknown"}]},{"as":"runtime-repository","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"}]},{"as":"is-worker","function":"equals-any","args":[{"field":"workflow-role"},{"value":"worker"}]},{"as":"is-orchestrator","function":"equals-any","args":[{"field":"workflow-role"},{"value":"orchestrator"}]},{"as":"root-dispatch-type","function":"if","args":[{"field":"is-orchestrator"},{"value":"Campaign orchestrator"},{"value":"Standalone workflow"}]},{"as":"dispatch-type","function":"if","args":[{"field":"is-worker"},{"value":"Campaign worker"},{"field":"root-dispatch-type"}]}],"select":[{"field":"started-at"},{"field":"campaign"},{"field":"campaign-name"},{"field":"workflow"},{"field":"workflow-name"},{"field":"workflow-role"},{"field":"dispatch-type"},{"field":"runtime-repository"},{"field":"run"},{"field":"run-status"},{"field":"status"}]},{"name":"campaign-runtime-health-groups","subject":"Compute each campaign workflow and runtime repository's latest consecutive failure streak in the selected horizon.","objective":"Locate campaign workflow/runtime-repository groups whose most recent retained completed runs have consecutive runtime failures.","acceptance":"Group completed runs by campaign, workflow, role, dispatch type, and runtime repository; failure-count is the latest retained failure streak, not a rate or a claim about runs outside the available horizon.","description":"Current retained failure streaks grouped by campaign workflow and runtime repository, considering only concluded Runs so an in-flight retry cannot mask an active failure streak.","from":"campaign-runtime-health-runs","filter":{"predicates":[{"field":"run-status","equals":"completed"}]},"compute":[{"as":"is-runtime-failure","function":"equals-any","args":[{"field":"status"},{"value":"failure"},{"value":"startup-failure"},{"value":"stale"},{"value":"timed-out"}]},{"as":"runtime-failure-streak-point","function":"failure-streak-point","args":[{"field":"started-at"},{"field":"run"},{"field":"is-runtime-failure"}]}],"aggregate":{"by":["campaign","campaign-name","workflow","workflow-name","workflow-role","dispatch-type","runtime-repository"],"values":[{"field":"runtime-failure-streak-point","as":"failure-count","reducer":"latest-failure-streak"}]}},{"name":"workflow-run-observation-counts","subject":"Count retained Runs for each workflow identity in the selected horizon.","objective":"Measure retained run presence by workflow identity to compare with active orchestrator declarations.","acceptance":"Count overview-runs by organization, repository, and workflow; a missing group indicates no retained matching run in the available horizon, not proof of no executions.","description":"One row per organization, repository, and workflow with retained Run counts, safe to join without row multiplication.","from":"overview-runs","aggregate":{"by":["organization","repository","workflow"],"values":[{"field":"run","as":"observed-run-count","reducer":"count"}]}},{"name":"campaign-active-orchestrator-run-presence","subject":"Count retained Runs for each active campaign orchestrator in the selected horizon.","objective":"Compare active orchestrator declarations with retained run observations to identify missing visibility.","acceptance":"Keep only workflows declared active with orchestrator role and expose their identity, runtime repository, and observed-run-count; a zero joined count means no retained match, not necessarily a stopped schedule.","description":"Active campaign orchestrators annotated with retained Run presence.","from":"workflows","joins":[{"source":"workflow-run-observation-counts","type":"left","on":[{"left":"organization","right":"organization"},{"left":"repository","right":"repository"},{"left":"workflow","right":"workflow"}],"fields":[{"field":"observed-run-count","as":"joined-observed-run-count"}]}],"filter":{"predicates":[{"field":"workflow-role","equals":"orchestrator"},{"field":"workflow-active","equals":"true"}]},"compute":[{"as":"runtime-repository","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"}]},{"as":"observed-run-count","function":"coalesce","args":[{"field":"joined-observed-run-count"},{"value":0}]}],"select":[{"field":"campaign"},{"field":"campaign-name"},{"field":"workflow"},{"field":"workflow-name"},{"field":"workflow-role"},{"field":"runtime-repository"},{"field":"observed-run-count"}]},{"name":"campaign-unobserved-orchestrator-candidates","subject":"Mark active campaign orchestrators with no retained Runs in the selected horizon.","objective":"Mark active orchestrators lacking retained run evidence for bounded telemetry or schedule review.","acceptance":"Preserve active orchestrator identity and observed-run-count; is-unobserved marks zero retained matches and must not be interpreted as a runtime failure or evidence that dispatch was expected.","description":"Active orchestrators annotated with whether runtime evidence is absent.","from":"campaign-active-orchestrator-run-presence","compute":[{"as":"is-unobserved","function":"equals-any","args":[{"field":"observed-run-count"},{"value":0}]},{"as":"failure-count","function":"sum","args":[{"value":0},{"value":0}]},{"as":"dispatch-type","function":"coalesce","args":[{"value":"Campaign orchestrator"},{"value":"Campaign orchestrator"}]},{"as":"problem-kind","function":"coalesce","args":[{"value":"not-observed"},{"value":"not-observed"}]}]},{"name":"campaign-unobserved-orchestrators","subject":"Show active campaign orchestrators with no retained Runs in the selected horizon.","objective":"List active orchestrator declarations with no retained run observations for follow-up on evidence availability.","acceptance":"Return only is-unobserved candidates with their workflow and repository identity; an empty result does not certify run completeness or scheduler health.","description":"Active campaign orchestrators whose runtime state cannot be established from retained evidence.","from":"campaign-unobserved-orchestrator-candidates","filter":{"predicates":[{"field":"is-unobserved","equals":true}]}},{"name":"dispatches","subject":"Select workflow-dispatch runs from campaign-attributed workflow run evidence.","objective":"Inspect retained workflow_dispatch runs attributed to campaigns before comparing campaign dispatch activity.","acceptance":"Include only campaign-runs with event workflow_dispatch and preserve run, attempt, attribution, status, and time; absence does not establish that no dispatch occurred beyond retained evidence.","description":"Canonical workflow runs whose authoritative trigger is workflow_dispatch.","from":"campaign-runs","filter":{"predicates":[{"field":"event","equals":"workflow_dispatch"}]},"order-by":[{"field":"started-at","direction":"desc"}]},{"name":"campaign-dispatch-inventory","subject":"Project retained dispatch identity and campaign attribution before campaign counting.","objective":"Count dispatches without materializing run diagnoses and presentation links.","acceptance":"Keep workflow_dispatch runs in timestamp order with declared campaign attribution; preserve workflow and incomplete-outcome join quality and duplicate-key failure behavior.","description":"Lean dispatch-count input; the incomplete-outcome join preserves the full campaign run source's evidence quality and fail-closed validation.","from":"runs","joins":[{"source":"workflows","type":"left","on":[{"left":"organization","right":"organization"},{"left":"repository","right":"repository"},{"left":"workflow","right":"workflow"}],"fields":[{"field":"campaign","as":"declared-campaign"}]},{"source":"run-incomplete-outcomes","type":"left","on":[{"left":"organization","right":"organization"},{"left":"repository","right":"repository"},{"left":"workflow","right":"workflow"},{"left":"run","right":"run"},{"left":"run-attempt","right":"run-attempt"}],"fields":[{"field":"outcome-kind","as":"outcome-kind"}]}],"filter":{"predicates":[{"field":"event","equals":"workflow_dispatch"}]},"select":[{"field":"declared-campaign","as":"campaign"},{"field":"run"},{"field":"started-at"}],"order-by":[{"field":"started-at","direction":"desc"}]},{"name":"campaign-dispatch-totals","subject":"Summarize observed workflow dispatches for each centrally managed campaign.","objective":"Compare retained workflow_dispatch run counts across attributed campaigns.","acceptance":"Count distinct run identifiers per campaign from dispatches; do not treat missing campaign attribution or unretained dispatches as zero actual activity.","description":"Observed workflow-dispatch run totals grouped by campaign.","from":"campaign-dispatch-inventory","aggregate":{"by":["campaign"],"values":[{"field":"run","as":"dispatches","reducer":"distinct-count"}]}},{"name":"campaign-workflow-totals","subject":"Summarize observed workflow and execution totals for each centrally managed campaign.","objective":"Compare declared orchestrator/worker composition, rollout registration, observed runs, and AI Credit usage by campaign.","acceptance":"Group only orchestrator and worker workflow-inventory rows by campaign; retain workflow count, distinct roles/modes/registration and summed observed runs and AIC, without inferring successful outcomes.","description":"Observed workflow, rollout, run, and AI Credit totals grouped by campaign.","from":"campaign-workflow-inventory","aggregate":{"by":["campaign"],"values":[{"field":"workflow","as":"workflows","reducer":"count"},{"field":"workflow-role","as":"roles","reducer":"distinct-list"},{"field":"rollout-mode","as":"modes","reducer":"distinct-list"},{"field":"workflow-active","as":"registration","reducer":"distinct-list"},{"field":"runs","as":"runs","reducer":"sum"},{"field":"aic","as":"aic","reducer":"sum"}]}},{"name":"campaign-repository-coverage","subject":"Count distinct registered target repositories reached by successful worker dispatches for each campaign.","objective":"Estimate observed campaign target reach from successful worker workflow_dispatch runs joined to registered repositories.","acceptance":"Count distinct matched target-repository values per campaign only for successful worker dispatches; this is observed reach, not verified target outcomes or complete fleet coverage.","description":"Campaign repository coverage derived from successful worker dispatch runs in the selected horizon.","from":"runs","joins":[{"source":"workflows","type":"inner","on":[{"left":"organization","right":"organization"},{"left":"repository","right":"repository"},{"left":"workflow","right":"workflow"}],"fields":[{"field":"campaign","as":"campaign"},{"field":"workflow-role","as":"workflow-role"}]},{"source":"repositories","type":"inner","on":[{"left":"target-repository","right":"repository-coordinate"}],"fields":[{"field":"repository-coordinate","as":"registered-target-repository"}]}],"filter":{"predicates":[{"field":"event","equals":"workflow_dispatch"},{"field":"run-conclusion","equals":"success"},{"field":"workflow-role","equals":"worker"}]},"aggregate":{"by":["campaign"],"values":[{"field":"target-repository","as":"covered-repositories","reducer":"distinct-count"}]}},{"name":"campaign-inventory-preview","subject":"Show declared campaigns before execution evidence is evaluated.","objective":"Expose campaign identities and navigation links while observed totals remain pending.","acceptance":"Preserve every declared campaign and its dashboard link without reporting missing execution totals as zero.","from":"campaigns","compute":[{"as":"encoded-campaign","function":"url-encode","args":[{"field":"campaign"}]},{"as":"campaign-dashboard-href","function":"concat","args":[{"value":"#page-campaign-insights?campaign="},{"field":"encoded-campaign"}]},{"as":"campaign-dashboard-label","function":"concat","args":[{"value":"View "},{"field":"campaign-name"},{"value":" campaign dashboard"}]},{"as":"campaign-dashboard-link","function":"dashboard-link","args":[{"value":""},{"field":"campaign-dashboard-href"},{"field":"campaign-dashboard-label"},{"field":"campaign"}]}],"select":[{"field":"campaign"},{"field":"campaign-name"},{"field":"campaign-dashboard-link"}],"order-by":[{"field":"campaign-name","direction":"asc"}]},{"name":"campaign-inventory","subject":"List centrally managed campaigns with their observed workflow and execution totals.","objective":"Compare declared campaigns with retained workflow composition, dispatches, target reach, runs, and AIC to choose an evidence-backed drill-down.","acceptance":"Keep declared campaigns with campaign identity and link plus joined totals; defaulted zero values mean no matching retained evidence and cannot certify no activity, complete coverage, or successful outcomes.","description":"Canonical campaign inventory enriched with observed workflow, rollout, run, repository coverage, and AI Credit totals.","from":"campaigns","joins":[{"source":"campaign-workflow-totals","type":"left","on":[{"left":"campaign","right":"campaign"}],"fields":[{"field":"workflows","as":"observed-workflows"},{"field":"roles","as":"observed-roles"},{"field":"modes","as":"observed-modes"},{"field":"registration","as":"observed-registration"},{"field":"runs","as":"observed-runs"},{"field":"aic","as":"observed-aic"}]},{"source":"campaign-dispatch-totals","type":"left","on":[{"left":"campaign","right":"campaign"}],"fields":[{"field":"dispatches","as":"observed-dispatches"}]},{"source":"campaign-repository-coverage","type":"left","on":[{"left":"campaign","right":"campaign"}],"fields":[{"field":"covered-repositories","as":"observed-covered-repositories"}]}],"compute":[{"as":"workflows","function":"coalesce","args":[{"field":"observed-workflows"},{"value":0}]},{"as":"roles","function":"coalesce","args":[{"field":"observed-roles"},{"value":""}]},{"as":"modes","function":"coalesce","args":[{"field":"observed-modes"},{"field":"campaign-mode"}]},{"as":"registration","function":"coalesce","args":[{"field":"observed-registration"},{"field":"campaign-registration"}]},{"as":"runs","function":"coalesce","args":[{"field":"observed-runs"},{"value":0}]},{"as":"dispatches","function":"coalesce","args":[{"field":"observed-dispatches"},{"value":0}]},{"as":"covered-repositories","function":"coalesce","args":[{"field":"observed-covered-repositories"},{"value":0}]},{"as":"aic","function":"coalesce","args":[{"field":"observed-aic"},{"value":0}]},{"as":"encoded-campaign","function":"url-encode","args":[{"field":"campaign"}]},{"as":"campaign-dashboard-href","function":"concat","args":[{"value":"#page-campaign-insights?campaign="},{"field":"encoded-campaign"}]},{"as":"campaign-dashboard-label","function":"concat","args":[{"value":"View "},{"field":"campaign-name"},{"value":" campaign dashboard"}]},{"as":"campaign-dashboard-link","function":"dashboard-link","args":[{"value":""},{"field":"campaign-dashboard-href"},{"field":"campaign-dashboard-label"},{"field":"campaign"}]}],"select":[{"field":"campaign"},{"field":"campaign-name"},{"field":"campaign-dashboard-link"},{"field":"workflows"},{"field":"roles"},{"field":"modes"},{"field":"registration"},{"field":"runs"},{"field":"dispatches"},{"field":"covered-repositories"},{"field":"aic"}],"order-by":[{"field":"campaign-name","direction":"asc"}]},{"name":"firewall-domain-totals","subject":"Show each observed firewall domain with the number of runs and total accepted and blocked requests.","objective":"Identify domains with observed denied requests for a closer review of firewall evidence.","acceptance":"Report distinct observed runs and native accepted and blocked request totals by domain; a denied request alone does not justify allowing egress, and no row does not prove no requests occurred.","description":"Distinct runs and accepted and blocked request totals by firewall domain.","from":"firewall-observations","filter":{"predicates":[{"field":"decision","in":["allowed","denied"]}]},"aggregate":{"by":["domain"],"values":[{"field":"run","as":"run","reducer":"distinct-count"},{"field":"request-count","as":"accepted","reducer":"sum","filter":{"predicates":[{"field":"decision","equals":"allowed"}]}},{"field":"request-count","as":"blocked","reducer":"sum","filter":{"predicates":[{"field":"decision","equals":"denied"}]}}]},"order-by":[{"field":"blocked","direction":"desc"},{"field":"accepted","direction":"desc"},{"field":"domain","direction":"asc"}]},{"name":"firewall-most-blocked-domains","subject":"Highlight the domains with the most blocked firewall requests.","objective":"Prioritize up to ten observed domains by blocked request total for investigation.","acceptance":"Rank by observed blocked totals and inspect underlying domain/workflow evidence before deciding whether a block needs attention; the ranking is not a policy authorization or an incidence rate.","description":"The ten domains with the highest observed blocked request totals.","from":"firewall-domain-totals","order-by":[{"field":"blocked","direction":"desc"},{"field":"domain","direction":"asc"}],"limit":10},{"name":"firewall-domain-workflows","subject":"Show workflows that allowed or blocked requests to each observed firewall domain.","objective":"Locate which observed workflows contributed accepted or denied requests for a domain.","acceptance":"Preserve workflow scope, source link, distinct runs, and native accepted and blocked totals; investigate the run and egress context rather than assuming a denied request is a failure or grounds for wider access.","description":"Workflow-level accepted and blocked request totals by firewall domain.","from":"firewall-observations","filter":{"predicates":[{"field":"decision","in":["allowed","denied"]}]},"compute":[{"as":"workflow-source-url","function":"link-href","args":[{"field":"workflow-link"}]}],"aggregate":{"by":["domain","organization","repository","workflow","workflow-source-url"],"values":[{"field":"run","as":"runs","reducer":"distinct-count"},{"field":"request-count","as":"accepted","reducer":"sum","filter":{"predicates":[{"field":"decision","equals":"allowed"}]}},{"field":"request-count","as":"blocked","reducer":"sum","filter":{"predicates":[{"field":"decision","equals":"denied"}]}}]},"order-by":[{"field":"blocked","direction":"desc"},{"field":"accepted","direction":"desc"},{"field":"repository","direction":"asc"},{"field":"workflow","direction":"asc"}]},{"name":"mcp-tool-totals","subject":"Group observed MCP activity by tool and count calls and calling workflows, excluding the internal safe outputs server.","objective":"Expose tool-level call, workflow, and byte totals to investigate observed MCP usage.","acceptance":"Group only observed non-safe-output-server calls by server and tool, preserving counts and byte totals; lack of calls does not establish no access, and call volume does not establish value or permission.","description":"Observed MCP tool-call totals grouped by MCP server and tool, with the number of distinct calling workflows.","from":"mcp-tool-workflow-totals","filter":{"predicates":[{"field":"safe-output-server","equals":false}]},"aggregate":{"by":["mcp-tool-label","mcp-server","mcp-tool"],"values":[{"field":"calls","as":"calls","reducer":"sum"},{"field":"workflow-key","as":"workflows","reducer":"distinct-count"},{"field":"request-bytes","as":"request-bytes","reducer":"sum"},{"field":"response-bytes","as":"response-bytes","reducer":"sum"}]},"select":[{"field":"mcp-tool-label"},{"field":"mcp-tool"},{"field":"mcp-server"},{"field":"calls"},{"field":"workflows"},{"field":"request-bytes"},{"field":"response-bytes"}],"order-by":[{"field":"calls","direction":"desc"},{"field":"mcp-tool-label","direction":"asc"}]},{"name":"mcp-top-tools","subject":"Show the ten most frequently called MCP tools.","objective":"Identify up to ten tools with the highest observed non-safe-output-server call counts for inspection.","acceptance":"Rank observed calls by tool label and inspect grouped tool evidence before drawing conclusions; do not treat popularity as effectiveness or authority to add tools.","description":"The ten MCP tools with the most observed calls, excluding the internal safe outputs server.","from":"mcp-tool-totals","order-by":[{"field":"calls","direction":"desc"},{"field":"mcp-tool-label","direction":"asc"}],"limit":10},{"name":"steering-events","subject":"Prepare observed gateway steering warnings for aggregation by steering type and workflow.","objective":"Expose warning identity, run context, type, and timestamp for downstream steering diagnostics.","acceptance":"Project recorded gateway steering events with workflow and run attribution where available; a warning is not a completed budget overrun, failure, or reason to increase limits.","description":"Gateway steering warnings emitted when a run approaches its AI Credit budget, time limit, or another declared limit, labelled with a readable steering type.","from":"audits","filter":{"predicates":[{"field":"event-type","equals":"firewall.steering"}]},"joins":[{"source":"workflows","type":"left","on":[{"left":"organization","right":"organization"},{"left":"repository","right":"repository"},{"left":"workflow","right":"workflow"}],"fields":[{"field":"campaign","as":"campaign"},{"field":"workflow-name","as":"workflow-name"}]}],"compute":[{"as":"steering-code","function":"coalesce","args":[{"field":"code"},{"field":"event-status"},{"value":"unknown"}]},{"as":"_token-steering","function":"equals-any","args":[{"field":"steering-code"},{"value":"token_steering"}]},{"as":"_timeout-steering","function":"equals-any","args":[{"field":"steering-code"},{"value":"timeout_steering"}]},{"as":"_turn-steering","function":"equals-any","args":[{"field":"steering-code"},{"value":"turn_steering"},{"value":"max_turns_steering"}]},{"as":"_turn-steering-type","function":"if","args":[{"field":"_turn-steering"},{"value":"Running out of turns"},{"field":"steering-code"}]},{"as":"_timeout-steering-type","function":"if","args":[{"field":"_timeout-steering"},{"value":"Running out of time"},{"field":"_turn-steering-type"}]},{"as":"steering-type","function":"if","args":[{"field":"_token-steering"},{"value":"Running out of tokens"},{"field":"_timeout-steering-type"}]},{"as":"workflow-coordinate","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"},{"value":":"},{"field":"workflow"}]},{"as":"workflow-label","function":"coalesce","args":[{"field":"workflow-name"},{"field":"workflow-coordinate"}]}],"select":[{"field":"id"},{"field":"organization"},{"field":"repository"},{"field":"workflow"},{"field":"workflow-name"},{"field":"workflow-coordinate"},{"field":"workflow-label"},{"field":"campaign"},{"field":"run"},{"field":"run-link"},{"field":"steering-code"},{"field":"steering-type"},{"field":"event-summary"},{"field":"observed-at"}]},{"name":"steering-type-totals","subject":"Show how often each kind of steering warning occurred.","objective":"Identify steering warning categories to inspect in their run context.","acceptance":"Report observed event totals and distinct runs and workflows by type; confirm underlying warnings before interpreting frequency, and do not infer actual limit breaches.","description":"Observed gateway steering warnings grouped by steering type with the number of affected runs and workflows.","from":"steering-events","aggregate":{"by":["steering-type","steering-code"],"values":[{"field":"id","as":"events","reducer":"count"},{"field":"run","as":"runs","reducer":"distinct-count"},{"field":"workflow-coordinate","as":"workflows","reducer":"distinct-count"}]},"select":[{"field":"steering-type"},{"field":"steering-code"},{"field":"events"},{"field":"runs"},{"field":"workflows"}],"order-by":[{"field":"events","direction":"desc"},{"field":"steering-type","direction":"asc"}]},{"name":"steering-workflow-totals","subject":"Count steering warnings for each workflow.","objective":"Expose workflow-level warning totals and token/time warning breakdowns for downstream review.","acceptance":"Count recorded events and distinct runs by workflow, retaining the declared token/time categories; other types remain in total events and no warning alone establishes a failure.","description":"Gateway steering warnings grouped by workflow, split into token-budget and time-limit warnings.","from":"steering-events","aggregate":{"by":["workflow-coordinate","organization","repository","workflow","workflow-label","campaign"],"values":[{"field":"id","as":"events","reducer":"count"},{"field":"run","as":"runs","reducer":"distinct-count"},{"field":"id","as":"token-events","reducer":"count","filter":{"predicates":[{"field":"steering-code","equals":"token_steering"}]}},{"field":"id","as":"time-events","reducer":"count","filter":{"predicates":[{"field":"steering-code","equals":"timeout_steering"}]}},{"field":"steering-type","as":"steering-types","reducer":"distinct-count"}]},"order-by":[{"field":"events","direction":"desc"},{"field":"workflow-coordinate","direction":"asc"}]},{"name":"steering-workflows","subject":"Present workflow steering totals with a link to each workflow dashboard.","objective":"Show observed workflow steering totals with navigation to the affected run context.","acceptance":"Keep workflow identity, link, events, runs, and warning breakdowns tied to their grouped evidence; use drill-through before recommending changes, not warning counts as a basis to widen budgets.","description":"Workflow steering totals labelled with a link to the workflow runtime page.","from":"steering-workflow-totals","compute":[{"as":"encoded-workflow","function":"url-encode","args":[{"field":"workflow-coordinate"}]},{"as":"workflow-dashboard-href","function":"concat","args":[{"value":"#page-workflow-runtime?workflow="},{"field":"encoded-workflow"}]},{"as":"workflow-dashboard-label","function":"concat","args":[{"value":"View "},{"field":"workflow-coordinate"},{"value":" workflow dashboard"}]},{"as":"workflow-dashboard-link","function":"dashboard-link","args":[{"value":""},{"field":"workflow-dashboard-href"},{"field":"workflow-dashboard-label"},{"field":"workflow-label"}]}],"select":[{"field":"workflow-coordinate"},{"field":"workflow-label"},{"field":"workflow-dashboard-link"},{"field":"organization"},{"field":"repository"},{"field":"campaign"},{"field":"events"},{"field":"runs"},{"field":"token-events"},{"field":"time-events"},{"field":"steering-types"}],"order-by":[{"field":"events","direction":"desc"},{"field":"workflow-coordinate","direction":"asc"}]},{"name":"steering-top-workflows","subject":"Highlight the workflows with the most steering warnings.","objective":"Prioritize up to ten workflows by observed warning count for investigation.","acceptance":"Rank recorded warning totals with workflow context, checking underlying events and telemetry coverage; a high rank neither proves overrun nor justifies a limit change.","description":"The ten workflows with the highest observed gateway steering warning totals.","from":"steering-workflows","order-by":[{"field":"events","direction":"desc"},{"field":"workflow-coordinate","direction":"asc"}],"limit":10},{"name":"entity-workflow-run-totals","subject":"Summarize run outcomes and AI Credit consumption for reusable workflow cards.","objective":"Compare retained run-attempt activity, recorded conclusions, and AI Credit usage per workflow card.","acceptance":"Group by organization, repository, and workflow; expose distinct run-attempt count, success/failure conclusion counts, and sum of recorded AIC, without treating missing run history as zero actual activity.","from":"runs","compute":[{"as":"run-attempt-identity","function":"concat","args":[{"field":"run"},{"value":":"},{"field":"run-attempt"}]},{"as":"positive-aic","function":"greater-than","args":[{"field":"aic-total"},{"value":0}]}],"aggregate":{"by":["organization","repository","workflow"],"values":[{"field":"run-attempt-identity","as":"runs","reducer":"distinct-count"},{"field":"run-attempt-identity","as":"aic-runs","reducer":"distinct-count","filter":{"predicates":[{"field":"positive-aic","equals":true}]}},{"field":"run-conclusion","as":"successful-runs","reducer":"count","filter":{"predicates":[{"field":"run-conclusion","equals":"success"}]}},{"field":"run-conclusion","as":"failed-runs","reducer":"count","filter":{"predicates":[{"field":"run-conclusion","in":["failure","startup-failure","stale","timed-out"]}]}},{"field":"aic-total","as":"aic","reducer":"sum","filter":{"predicates":[{"field":"positive-aic","equals":true}]}}]}},{"name":"entity-workflows","subject":"Project workflow entities for reusable workflow cards and repository drill-down.","objective":"Relate declared workflows to observed run and AIC totals for workflow-level drill-down.","acceptance":"Keep declared workflow identity, role, registration, campaign, link, and joined totals; a missing run match defaults to displayed zeros but does not establish no executions or outcomes.","from":"workflows","joins":[{"source":"entity-workflow-run-totals","type":"left","on":[{"left":"organization","right":"organization"},{"left":"repository","right":"repository"},{"left":"workflow","right":"workflow"}],"fields":[{"field":"runs","as":"observed-runs"},{"field":"successful-runs","as":"observed-successful-runs"},{"field":"failed-runs","as":"observed-failed-runs"},{"field":"aic","as":"observed-aic"},{"field":"aic-runs","as":"observed-aic-runs"}]}],"compute":[{"as":"runs","function":"coalesce","args":[{"field":"observed-runs"},{"value":0}]},{"as":"successful-runs","function":"coalesce","args":[{"field":"observed-successful-runs"},{"value":0}]},{"as":"failed-runs","function":"coalesce","args":[{"field":"observed-failed-runs"},{"value":0}]},{"as":"aic","function":"coalesce","args":[{"field":"observed-aic"},{"value":0}]},{"as":"aic-per-run","function":"quotient","args":[{"field":"aic"},{"field":"observed-aic-runs"}]}],"select":[{"field":"organization"},{"field":"repository"},{"field":"workflow"},{"field":"workflow-name"},{"field":"workflow-role"},{"field":"workflow-active"},{"field":"campaign-name"},{"field":"observed-at"},{"field":"runs"},{"field":"successful-runs"},{"field":"failed-runs"},{"field":"aic-per-run"},{"field":"workflow-link"}],"order-by":[{"field":"repository","direction":"asc"},{"field":"workflow","direction":"asc"}]},{"name":"repository-runs","subject":"Project canonical runs into repository-addressable run evidence.","objective":"Expose retained run chronology and status for a selected repository's drill-down.","acceptance":"Retain repository coordinate, workflow, run identity, title, event, start time, conclusion, mode, AIC, and run link; absent details or runs do not establish a healthy or idle repository.","description":"Workflow runs with a stable repository route key.","from":"runs","compute":[{"as":"repository-coordinate","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"}]}],"select":[{"field":"repository-coordinate"},{"field":"workflow"},{"field":"run"},{"field":"run-title"},{"field":"event"},{"field":"started-at"},{"field":"run-status"},{"field":"run-conclusion"},{"field":"rollout-mode"},{"field":"aic-total"},{"field":"run-link"}],"order-by":[{"field":"started-at","direction":"desc"},{"field":"run","direction":"desc"}]},{"name":"repository-workflow-totals","subject":"Summarize declared and disabled workflow counts by repository.","objective":"Compare declared and disabled workflow counts for each repository in the retained workflow inventory.","acceptance":"Count declared workflows and workflow-active=false entries by organization and repository; missing declarations must not be interpreted as a complete zero-workflow inventory.","description":"Declared and disabled workflow totals for each repository.","from":"workflows","aggregate":{"by":["organization","repository"],"values":[{"field":"workflow","as":"workflows","reducer":"count"},{"field":"workflow","as":"disabled","reducer":"count","filter":{"predicates":[{"field":"workflow-active","equals":"false"}]}}]}},{"name":"repository-report-totals","subject":"Summarize published outcome report counts by repository.","objective":"Show retained outcome-report volume per repository for comparison with observed execution.","acceptance":"Count retained outcome rows by organization and repository; a missing aggregate does not prove no reports were published or that reported outcomes succeeded.","description":"Published report totals for each repository.","from":"outcomes","aggregate":{"by":["organization","repository"],"values":[{"field":"repository","as":"reports","reducer":"count"}]}},{"name":"repository-run-identities","subject":"Project the run-attempt identities needed to match imported evidence.","objective":"Keep import-coverage joins narrow without carrying run details, links, or costs.","acceptance":"Preserve each selected run attempt and its organization, repository, workflow, run, and attempt keys. Do not deduplicate attempts or change selected-horizon semantics.","from":"runs","select":[{"field":"organization"},{"field":"repository"},{"field":"workflow"},{"field":"run"},{"field":"run-attempt"}]},{"name":"repository-import-totals","subject":"Count selected run attempts with matching retained imported records.","objective":"Join compact run identities to already reduced event evidence, then reduce import coverage by repository.","acceptance":"Match all five run-attempt keys and count each selected run row once when events are positive. Preserve optional-evidence quality and horizon filters; records for unselected runs do not establish coverage.","from":"repository-run-identities","joins":[{"source":"event-runs","type":"left","on":[{"left":"organization","right":"organization"},{"left":"repository","right":"repository"},{"left":"workflow","right":"workflow"},{"left":"run","right":"run"},{"left":"run-attempt","right":"run-attempt"}],"fields":[{"field":"events","as":"imported-events"}]}],"compute":[{"as":"imported","function":"greater-than","args":[{"field":"imported-events"},{"value":0}]}],"aggregate":{"by":["organization","repository"],"values":[{"field":"imported","as":"imported-runs","reducer":"sum"}]}},{"name":"repository-run-totals","subject":"Summarize distinct runs, failures, and approval-required runs by repository.","objective":"Join already reduced run statistics and import coverage at repository grain.","acceptance":"Group by organization and repository; preserve distinct run IDs, configured failure/action-required conclusion counts, and imported-run sums. Missing enrichment or run history must not be treated as complete coverage.","description":"Distinct run and conclusion totals for each repository.","from":"repository-run-statistics","joins":[{"source":"repository-import-totals","type":"left","on":[{"left":"organization","right":"organization"},{"left":"repository","right":"repository"}],"fields":[{"field":"imported-runs","as":"imported-runs"}]}],"select":[{"field":"organization"},{"field":"repository"},{"field":"runs"},{"field":"failed"},{"field":"action-required"},{"field":"imported-runs"}]},{"name":"repository-activity-preview","subject":"List repository identities before execution metrics are computed.","objective":"Show retained repository identities and drill links while activity metrics are pending.","acceptance":"List repositories by organization with repository drill links; this preview does not establish activity totals or outcomes.","description":"Fast repository inventory with drill links; activity fields remain pending.","from":"repositories","compute":[{"as":"repository-slug","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"}]},{"as":"encoded-repository","function":"url-encode","args":[{"field":"repository-slug"}]},{"as":"repository-dashboard-href","function":"concat","args":[{"value":"#page-repository-detail?repository="},{"field":"encoded-repository"}]},{"as":"repository-dashboard-label","function":"concat","args":[{"value":"View "},{"field":"repository-slug"},{"value":" repository dashboard"}]},{"as":"repository-dashboard-link","function":"dashboard-link","args":[{"field":"repository-link"},{"field":"repository-dashboard-href"},{"field":"repository-dashboard-label"},{"field":"repository-slug"}]}],"select":[{"field":"organization"},{"field":"repository-slug","as":"repository"},{"field":"repository-dashboard-link","as":"repository-link"}],"order-by":[{"field":"repository","direction":"asc"}]},{"name":"repository-activity-core","subject":"Join each repository with its workflow, report, and run totals.","objective":"Attach retained workflow, report, and run aggregates to each repository for bounded inventory review.","acceptance":"Preserve each repository and the available joined aggregates by organization and repository; unmatched metrics remain missing evidence, not confirmed zero activity or evaluated outcomes.","description":"Repository inventory joined with workflow, report, evaluation, and run totals.","from":"repositories","joins":[{"source":"repository-workflow-totals","type":"left","on":[{"left":"organization","right":"organization"},{"left":"repository","right":"repository"}],"fields":[{"field":"workflows","as":"observed-workflows"},{"field":"disabled","as":"observed-disabled"}]},{"source":"repository-report-totals","type":"left","on":[{"left":"organization","right":"organization"},{"left":"repository","right":"repository"}],"fields":[{"field":"reports","as":"observed-reports"}]},{"source":"repository-run-totals","type":"left","on":[{"left":"organization","right":"organization"},{"left":"repository","right":"repository"}],"fields":[{"field":"runs","as":"observed-runs"},{"field":"failed","as":"observed-failed"},{"field":"action-required","as":"observed-action-required"},{"field":"imported-runs","as":"observed-imported-runs"}]}]},{"name":"repository-activity","subject":"Show repository-level execution health, outcome activity, and AI Credit usage in an actionable inventory.","objective":"Prioritize repository drill-down using declared workflows, observed runs, reports, failures, import coverage, and AIC.","acceptance":"Return repository identity and link with retained counts, ingestion indicator, failure summary, AIC, and computed status; statuses describe retained evidence only, and an empty or unavailable preview cannot verify health, outcomes, or zero activity.","description":"Repository-local execution health and attributed outcome totals.","from":"repository-activity-core","joins":[{"source":"repository-aic-totals","type":"left","on":[{"left":"organization","right":"organization"},{"left":"repository","right":"repository"}],"fields":[{"field":"aic","as":"observed-aic"}]}],"compute":[{"as":"repository-slug","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"}]},{"as":"workflows","function":"coalesce","args":[{"field":"observed-workflows"},{"value":0}]},{"as":"disabled","function":"coalesce","args":[{"field":"observed-disabled"},{"value":0}]},{"as":"runs","function":"coalesce","args":[{"field":"observed-runs"},{"value":0}]},{"as":"failed","function":"coalesce","args":[{"field":"observed-failed"},{"value":0}]},{"as":"imported-runs","function":"coalesce","args":[{"field":"observed-imported-runs"},{"value":0}]},{"as":"ingestion-rate","function":"quotient","args":[{"field":"imported-runs"},{"field":"runs"}]},{"as":"ingestion","function":"format-percent","args":[{"field":"ingestion-rate"}]},{"as":"action-required","function":"coalesce","args":[{"field":"observed-action-required"},{"value":0}]},{"as":"aic","function":"coalesce","args":[{"field":"observed-aic"},{"value":0}]},{"as":"has-failures","function":"greater-than","args":[{"field":"failed"},{"value":0}]},{"as":"has-action-required","function":"greater-than","args":[{"field":"action-required"},{"value":0}]},{"as":"has-runs","function":"greater-than","args":[{"field":"runs"},{"value":0}]},{"as":"has-disabled","function":"greater-than","args":[{"field":"disabled"},{"value":0}]},{"as":"outcomes-observed","function":"coalesce","args":[{"field":"observed-reports"},{"value":0}]},{"as":"has-outcomes","function":"greater-than","args":[{"field":"outcomes-observed"},{"value":0}]},{"as":"failure-rate","function":"quotient","args":[{"field":"failed"},{"field":"runs"}]},{"as":"failure-percent","function":"format-percent","args":[{"field":"failure-rate"}]},{"as":"failure-count","function":"format-count","args":[{"field":"failed"}]},{"as":"observed-failure-summary","function":"concat","args":[{"field":"failure-percent"},{"value":" · "},{"field":"failure-count"},{"value":" failed"}]},{"as":"failure-summary","function":"if","args":[{"field":"has-runs"},{"field":"observed-failure-summary"},{"value":"—"}]},{"as":"outcome-status","function":"if","args":[{"field":"has-outcomes"},{"value":"Outcomes observed"},{"value":"No recent activity"}]},{"as":"disabled-status","function":"if","args":[{"field":"has-disabled"},{"value":"Disabled workflows"},{"field":"outcome-status"}]},{"as":"run-status","function":"if","args":[{"field":"has-runs"},{"value":"No failures observed"},{"field":"disabled-status"}]},{"as":"action-status","function":"if","args":[{"field":"has-action-required"},{"value":"Approval required"},{"field":"run-status"}]},{"as":"status","function":"if","args":[{"field":"has-failures"},{"value":"Needs attention"},{"field":"action-status"}]},{"as":"encoded-repository","function":"url-encode","args":[{"field":"repository-slug"}]},{"as":"repository-dashboard-href","function":"concat","args":[{"value":"#page-repository-detail?repository="},{"field":"encoded-repository"}]},{"as":"repository-dashboard-label","function":"concat","args":[{"value":"View "},{"field":"repository-slug"},{"value":" repository dashboard"}]},{"as":"repository-dashboard-link","function":"dashboard-link","args":[{"field":"repository-link"},{"field":"repository-dashboard-href"},{"field":"repository-dashboard-label"},{"field":"repository-slug"}]}],"select":[{"field":"organization"},{"field":"repository","as":"repository-name"},{"field":"repository-slug","as":"repository"},{"field":"workflows"},{"field":"observed-reports","as":"reports"},{"field":"runs"},{"field":"ingestion"},{"field":"failure-summary"},{"field":"aic"},{"field":"status"},{"field":"repository-dashboard-link","as":"repository-link"},{"field":"failed"}],"order-by":[{"field":"failed","direction":"desc"},{"field":"runs","direction":"desc"},{"field":"repository","direction":"asc"}]},{"name":"repository-daily-run-buckets","subject":"Select repository run counts by whole UTC start-day buckets.","objective":"Keep count selection independent of retained Run detail.","acceptance":"Use UTC midnight and request bounds, matching the Runs daily chart; do not fabricate sub-day totals or missing days.","from":"daily-run-counts","compute":[{"as":"day-midnight","function":"concat","args":[{"field":"day"},{"value":"T00:00:00Z"}]},{"as":"day-ms","function":"timestamp","args":[{"field":"day-midnight"}]},{"as":"start-ms","function":"timestamp","args":[{"context":"time-start"}]},{"as":"end-ms","function":"timestamp","args":[{"context":"time-end"}]},{"as":"before-start","function":"greater-than","args":[{"field":"start-ms"},{"field":"day-ms"}]},{"as":"before-end","function":"greater-than","args":[{"field":"end-ms"},{"field":"day-ms"}]}]},{"name":"repository-observed-run-counts","subject":"Count observed logical Runs by repository from persistent daily buckets.","objective":"Supply the run-volume chart without computing activity health, ingestion coverage, or workflow costs.","acceptance":"Sum daily totals, not attempts or retained detail. Select whole UTC start-day buckets by midnight and preserve partial or unavailable coverage.","from":"repository-daily-run-buckets","filter":{"predicates":[{"field":"before-start","in":[false,null]},{"field":"before-end","in":[true,null]}]},"compute":[{"as":"repository-coordinate","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"}]}],"aggregate":{"by":["organization","repository-coordinate"],"values":[{"field":"total","as":"runs","reducer":"sum"}]}},{"name":"repository-run-inventory","subject":"Registered repositories and observed daily logical Run counts.","objective":"Compare repository execution volume and choose repositories for drill-down.","acceptance":"Keep top 100 identities and drill links with stable count and repository ordering. Zero means no admitted dated Runs in selected UTC buckets, not inactivity. Preserve partial coverage; unavailable daily evidence must not produce zeros. Table keeps full inventory.","from":"repository-activity-preview","joins":[{"source":"repository-observed-run-counts","type":"left","on":[{"left":"organization","right":"organization"},{"left":"repository","right":"repository-coordinate"}],"fields":[{"field":"runs","as":"observed-runs"}]}],"compute":[{"as":"runs","function":"coalesce","args":[{"field":"observed-runs"},{"value":0}]}],"select":[{"field":"organization"},{"field":"repository"},{"field":"runs"},{"field":"repository-link"}],"order-by":[{"field":"runs","direction":"desc"},{"field":"repository","direction":"asc"}],"limit":100},{"name":"workflow-route-record","subject":"Project the selected workflow's identity and registration for its route shell.","objective":"Identify the workflow and its recorded campaign registration before inspecting route-specific evidence.","acceptance":"Preserve organization, repository, workflow identity, recorded role, activation, campaign, rollout mode, and source link; absent registration is not inferred from runs, and displayed activation does not grant execution authority.","from":"workflows","select":[{"field":"organization"},{"field":"repository"},{"field":"workflow"},{"field":"workflow-name"},{"field":"workflow-role"},{"field":"workflow-active"},{"field":"campaign"},{"field":"campaign-name"},{"field":"rollout-mode"},{"field":"workflow-link"}]},{"name":"workflow-runtime-health-summary","subject":"Sum daily runtime conclusion counts for the selected workflow.","objective":"Inspect observed dated runs independently of retained detail.","acceptance":"Sum by organization/repository/workflow without adding detail; successful, failed, approval, pending, and other sum to total. Dates use UTC run start; undated evidence is incomplete and missing projection is unavailable. Pending is last-observed state, success is not a verified outcome, and sub-day filters are unsupported.","from":"daily-run-counts","aggregate":{"by":["organization","repository","workflow"],"values":[{"field":"total","as":"total","reducer":"sum"},{"field":"successful","as":"successful","reducer":"sum"},{"field":"failed","as":"failed","reducer":"sum"},{"field":"approval","as":"approval","reducer":"sum"},{"field":"pending","as":"pending","reducer":"sum"},{"field":"other","as":"other","reducer":"sum"}]}},{"name":"workflow-runtime-usage-summary","subject":"Sum retained AI Credits and count telemetry rows for the selected workflow without transferring runs.","objective":"Inspect a workflow's observed AI Credit consumption together with the amount of retained usage telemetry.","acceptance":"AI Credits sum the retained aic values within each organization, repository, and workflow, and telemetry-count counts its usage records; absent telemetry does not establish zero cost or complete run coverage.","from":"usage","compute":[{"as":"positive-aic","function":"greater-than","args":[{"field":"aic"},{"value":0}]}],"aggregate":{"by":["organization","repository","workflow"],"values":[{"field":"aic","as":"aic","reducer":"sum","filter":{"predicates":[{"field":"positive-aic","equals":true}]}},{"field":"run","as":"telemetry-count","reducer":"count"}]}},{"name":"outcome-route-record","subject":"Project the selected safe-output record for the outcome route and its sections.","objective":"Inspect a retained safe output's recorded disposition and follow its durable evidence links.","acceptance":"Preserve safe-output and run identity, title, category, disposition, summary, timestamps, rollout mode, workflow context, and retained links; missing fields stay unknown and a recorded disposition is not independently verified operational impact.","from":"outcomes","select":[{"field":"safe-output"},{"field":"run"},{"field":"outcome-title"},{"field":"outcome-number"},{"field":"outcome-category"},{"field":"outcome-status"},{"field":"outcome-state"},{"field":"outcome-summary"},{"field":"published-at"},{"field":"observed-at"},{"field":"rollout-mode"},{"field":"workflow"},{"field":"workflow-name"},{"field":"workflow-link"},{"field":"external-link"},{"field":"issue-link"},{"field":"pull-request-link"},{"field":"run-link"}]},{"name":"entity-runs","subject":"Project run entities for reusable run cards and workflow drill-down.","objective":"Expose retained run-attempt identity, execution timing, conclusion, and link for a bounded workflow-run inspection.","acceptance":"Keep organization, repository, workflow, run and attempt with status, conclusion, event, branch, duration, timestamps, and run link; missing timing or conclusion remains unknown rather than inferred success.","from":"runs","select":[{"field":"organization"},{"field":"repository"},{"field":"workflow"},{"field":"target-repository"},{"field":"run"},{"field":"run-attempt"},{"field":"run-title"},{"field":"run-status"},{"field":"run-conclusion"},{"field":"event"},{"field":"branch"},{"field":"duration"},{"field":"started-at"},{"field":"ended-at"},{"field":"run-link"}],"order-by":[{"field":"started-at","direction":"desc"}]},{"name":"workflow-runs","subject":"Project canonical runs into route-addressable workflow run evidence.","objective":"Trace retained runs and recorded failure evidence for a selected workflow route.","acceptance":"Preserve workflow route, run identity, timing, recorded Actions minutes and AI Credits, status, conclusion, failure fields, mode, engine/model metadata, and run link; missing failure details do not prove success or rule out incomplete import.","description":"Workflow runs with a stable repository and workflow route key.","from":"runs","compute":[{"as":"repository-coordinate","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"}]},{"as":"workflow-route","function":"concat","args":[{"field":"repository-coordinate"},{"value":":"},{"field":"workflow"}]}],"select":[{"field":"workflow-route"},{"field":"organization"},{"field":"repository"},{"field":"workflow"},{"field":"run"},{"field":"run-title"},{"field":"event"},{"field":"started-at"},{"field":"ended-at"},{"field":"action-minutes"},{"field":"aic-total"},{"field":"run-status"},{"field":"run-conclusion"},{"field":"failure-job"},{"field":"failure-message"},{"field":"failure-step"},{"field":"failure-log"},{"field":"rollout-mode"},{"field":"engine"},{"field":"engine-version"},{"field":"gh-aw-version"},{"field":"requested-model"},{"field":"resolved-model"},{"field":"run-link"}],"order-by":[{"field":"started-at","direction":"desc"},{"field":"run","direction":"desc"}]},{"name":"workflow-failure-trend","subject":"Show recent failure counts and their change for each workflow.","objective":"Spot a change in observed workflow failure activity without treating unknown conclusions as failures.","acceptance":"Each observed failure counts once within its own workflow; the first change is undefined and the seven-observation window is not a seven-day calendar interval.","from":"workflow-runs","compute":[{"as":"is-failure","function":"equals-any","args":[{"field":"run-conclusion"},{"value":"failure"},{"value":"timed_out"}]},{"as":"failure-count","function":"if","args":[{"field":"is-failure"},{"value":1},{"value":0}]}],"window":[{"operation":"rolling","field":"failure-count","as":"recent-failure-count","frame":7,"reducer":"sum","order-by":[{"field":"started-at","direction":"asc"},{"field":"run","direction":"asc"}],"groupby":["workflow-route"]},{"operation":"change","field":"recent-failure-count","as":"failure-count-change","mode":"absolute","order-by":[{"field":"started-at","direction":"asc"},{"field":"run","direction":"asc"}],"groupby":["workflow-route"]}]},{"name":"workflow-reports","subject":"Project retained outcomes into route-addressable workflow reports.","objective":"Review retained workflow outcome reports separately from execution status before interpreting operational results.","acceptance":"Keep route, safe output, report title and summary, recorded status, category, observation time, metadata, and external link; missing reports or status do not imply success or no work.","description":"Workflow outcome reports with stable route keys and disposition fields.","from":"outcomes","compute":[{"as":"report-repository","function":"coalesce","args":[{"field":"runtime-repository"},{"field":"repository"}]},{"as":"workflow-route","function":"concat","args":[{"field":"report-repository"},{"value":":"},{"field":"workflow"}]},{"as":"report-status","function":"coalesce","args":[{"field":"outcome-status"},{"field":"outcome-state"},{"value":"unknown"}]}],"select":[{"field":"workflow-route"},{"field":"safe-output"},{"field":"outcome-title"},{"field":"outcome-summary"},{"field":"report-status","as":"outcome-status"},{"field":"rollout-mode"},{"field":"engine"},{"field":"engine-version"},{"field":"requested-model"},{"field":"resolved-model"},{"field":"outcome-category"},{"field":"observed-at"},{"field":"external-link"}],"order-by":[{"field":"observed-at","direction":"desc"},{"field":"outcome-title","direction":"asc"}]},{"name":"value-measurement-facts","subject":"Original native primary and diagnostic observations from reviewed batch evaluators.","objective":"Keep periods, native units, evaluator identity and missingness inspectable without inventing delivery events.","acceptance":"Null is unavailable, not zero. Interval measurements are not snapshots or cumulative accepted contributions.","from":"workflow-value-measurements","time":{"range":"all"},"compute":[{"as":"measurement-marker","function":"literal","args":[{"value":1}]},{"as":"measurement-missing","function":"equals-any","args":[{"field":"value"},{"value":null}]},{"as":"known-measurement","function":"concat","args":[{"field":"value"},{"value":" "},{"field":"metric-unit"}]},{"as":"measurement-label","function":"if","args":[{"field":"measurement-missing"},{"value":"Not measured"},{"field":"known-measurement"}]},{"as":"measurement-context","function":"concat","args":[{"field":"repository"},{"value":" · "},{"field":"workflow-name"}]}]},{"name":"value-measurement-order","subject":"Latest assessment of each workflow measure, including unavailable assessments.","objective":"Do not let an older numeric value hide a newer incomplete period.","acceptance":"Choose latest cutoff and assessment before considering value or coverage; preserve evaluator digest.","from":"value-measurement-facts","window":[{"operation":"change","field":"measurement-marker","as":"older-measurement","mode":"absolute","groupby":["repository","workflow-route","workflow-slug","campaign","value-id"],"order-by":[{"field":"window-end","direction":"desc"},{"field":"observed-at","direction":"desc"}]}]},{"name":"value-current-measurements","subject":"Latest native primary measurements, separately from event-ledger reports.","objective":"Expose ordinary reviewed batch results on the same Value surface.","acceptance":"Do not infer healthy outcomes, accepted implementations or complete coverage from a non-null value.","from":"value-measurement-order","filter":{"predicates":[{"field":"older-measurement","equals":"unknown"},{"field":"metric-role","equals":"primary"}]}},{"name":"value-evidence-facts","subject":"Published original evidence for frozen workflow value contracts.","objective":"Keep report identity, target repository, workflow and capture together.","acceptance":"Read canonical evidence only. No GitHub acquisition, HTML loading or fabricated evidence on navigation.","from":"operational-value-evidence","time":{"range":"all"}},{"name":"value-contracts","subject":"One retained contract per repository, workflow and versioned native measure.","objective":"Compute each report independently before selecting current workflow results.","acceptance":"Preserve separate versions and exact report identity. Latest-version selection belongs to the workflow result query.","from":"value-evidence-facts","filter":{"predicates":[{"field":"fact-kind","equals":"contract"}]},"compute":[{"as":"report-marker","function":"literal","args":[{"value":1}]}]},{"name":"value-measurement-captures","subject":"Accepted complete native batch assessments, separately from collection decisions.","objective":"Expose actual retained capture clocks without advancing them on failure or partial data.","acceptance":"Only mature complete non-null primary assessments establish an accepted capture; zero remains valid.","from":"value-measurement-facts","filter":{"predicates":[{"field":"metric-role","equals":"primary"},{"field":"measurement-missing","equals":false},{"field":"coverage-status","equals":"complete"},{"field":"maturity-status","equals":"matured"}]},"compute":[{"as":"report-marker","function":"literal","args":[{"value":1}]}],"select":[{"field":"workflow-route"},{"field":"observed-at"},{"field":"window-end"},{"field":"id","as":"capture-id"},{"field":"report-marker"}]},{"name":"value-contract-captures","subject":"Original capture clocks from accepted rich evidence packets.","objective":"Align capture metadata without merging measured populations.","acceptance":"This union is capture metadata only, never combined metric totals.","from":"value-contracts","select":[{"field":"workflow-route"},{"field":"observed-at"},{"field":"window-end"},{"field":"report-id","as":"capture-id"},{"field":"report-marker"}]},{"name":"value-capture-order","subject":"Actual captures across the retained measures of each workflow.","objective":"Expose the last accepted capture independently of collection decisions.","acceptance":"Select by original capture time. A deferred or failed check cannot advance evidence clocks.","from":"value-contract-captures","union":["value-measurement-captures"],"window":[{"operation":"change","field":"report-marker","as":"later-capture","mode":"absolute","groupby":["workflow-route"],"order-by":[{"field":"observed-at","direction":"desc"},{"field":"capture-id","direction":"desc"}]}]},{"name":"value-latest-capture","subject":"One last accepted capture per workflow, not a freshness claim.","objective":"Join capture and cutoff without multiplying collection registrations.","acceptance":"Missing packets remain unavailable, never zero or an inferred successful collection.","from":"value-capture-order","filter":{"predicates":[{"field":"later-capture","equals":"unknown"}]}},{"name":"value-collection-health","subject":"Reviewed registration and authoritative collection decisions, with independently retained evidence.","objective":"Explain disabled, unconfigured, deferred, failed and not-yet-captured workflows.","acceptance":"Use published collector facts, not missing result cards. Preserve decision, attempt, capture and cutoff as distinct clocks.","from":"workflow-value-collections","time":{"range":"all"},"joins":[{"source":"value-latest-capture","type":"left","on":[{"left":"workflow-route","right":"workflow-route"}],"fields":[{"field":"observed-at","as":"captured-at"},{"field":"window-end","as":"evidence-cutoff"}]}],"compute":[{"as":"workflow-context","function":"concat","args":[{"field":"workflow"},{"value":" · "},{"field":"organization"},{"value":"/"},{"field":"repository"}]},{"as":"capture-missing","function":"equals-any","args":[{"field":"captured-at"},{"value":null}]},{"as":"evidence-state","function":"if","args":[{"field":"capture-missing"},{"value":"No retained capture"},{"value":"Retained evidence available"}]}],"order-by":[{"field":"organization","direction":"asc"},{"field":"repository","direction":"asc"},{"field":"workflow","direction":"asc"}]},{"name":"value-snapshots","subject":"Independent repository-state observations and exact item drill-downs.","objective":"Keep everyone's changes separate from workflow-linked delivery.","acceptance":"Retain observed native values, dates and immutable references. Do not invent intermediate observations.","from":"value-evidence-facts","filter":{"predicates":[{"field":"fact-kind","equals":"snapshot"}]},"compute":[{"as":"snapshot-marker","function":"literal","args":[{"value":1}]},{"as":"encoded-snapshot","function":"url-encode","args":[{"field":"snapshot-route"}]},{"as":"snapshot-href","function":"concat","args":[{"value":"#page-value-snapshot?snapshot="},{"field":"encoded-snapshot"}]}],"order-by":[{"field":"at","direction":"asc"},{"field":"fact-id","direction":"asc"}]},{"name":"value-first-snapshot-order","subject":"First independently observed repository state.","objective":"Name the actual first-snapshot reference rather than an invented baseline.","acceptance":"Strictly use retained snapshot time. A post-adoption snapshot is not a pre-adoption baseline.","from":"value-snapshots","window":[{"operation":"change","field":"snapshot-marker","as":"earlier-snapshot","mode":"absolute","groupby":["report-id","workflow-route"],"order-by":[{"field":"at","direction":"asc"}]}]},{"name":"value-first-snapshot","subject":"First retained snapshot per report.","objective":"Provide the explicit reference value and date.","acceptance":"No retained reference means no comparison.","from":"value-first-snapshot-order","filter":{"predicates":[{"field":"earlier-snapshot","equals":"unknown"}]}},{"name":"value-last-snapshot-order","subject":"Latest independently observed repository state.","objective":"Show the actual last measurement rather than an extrapolation.","acceptance":"Preserve the latest retained snapshot even if unchanged.","from":"value-snapshots","window":[{"operation":"change","field":"snapshot-marker","as":"later-snapshot","mode":"absolute","groupby":["report-id","workflow-route"],"order-by":[{"field":"at","direction":"desc"}]}]},{"name":"value-last-snapshot","subject":"Last retained snapshot per report.","objective":"Provide the current native observation.","acceptance":"One snapshot establishes state, not movement.","from":"value-last-snapshot-order","filter":{"predicates":[{"field":"later-snapshot","equals":"unknown"}]}},{"name":"value-output-counts","subject":"Retained safe outputs and applied creation receipts.","objective":"Describe output activity without treating it as accepted value.","acceptance":"Count distinct validated output facts. Tracking corroboration is not an applied receipt.","from":"value-evidence-facts","filter":{"predicates":[{"field":"fact-kind","equals":"output"}]},"aggregate":{"by":["report-id","workflow-route"],"values":[{"field":"fact-id","as":"retained-outputs","reducer":"count"},{"field":"fact-id","as":"receipt-outputs","reducer":"count","filter":{"predicates":[{"field":"origin","equals":"receipt-verified"}]}}]}},{"name":"value-implementation-counts","subject":"Distinct accepted implementations and their measured native effects.","objective":"Count each accepted implementation once, including zero and negative effects.","acceptance":"Validated implementation identities are unique; many-to-many output edges must not multiply value. Complete coverage is checked separately.","from":"value-evidence-facts","filter":{"predicates":[{"field":"fact-kind","equals":"implementation"}]},"compute":[{"as":"accepted-ms","function":"timestamp","args":[{"field":"at"}]},{"as":"cutoff-ms","function":"timestamp","args":[{"field":"window-end"}]},{"as":"current-start","function":"difference","args":[{"field":"cutoff-ms"},{"value":2419200000}]},{"as":"previous-start","function":"difference","args":[{"field":"cutoff-ms"},{"value":4838400000}]},{"as":"before-current","function":"greater-than","args":[{"field":"current-start"},{"field":"accepted-ms"}]},{"as":"before-previous","function":"greater-than","args":[{"field":"previous-start"},{"field":"accepted-ms"}]},{"as":"current-effect","function":"if","args":[{"field":"before-current"},{"value":0},{"field":"value"}]},{"as":"previous-candidate","function":"if","args":[{"field":"before-previous"},{"value":0},{"field":"value"}]},{"as":"previous-effect","function":"if","args":[{"field":"before-current"},{"field":"previous-candidate"},{"value":0}]}],"aggregate":{"by":["report-id","workflow-route"],"values":[{"field":"fact-id","as":"accepted-implementations","reducer":"count"},{"field":"value","as":"known-result","reducer":"sum"},{"field":"current-effect","as":"known-recent","reducer":"sum"},{"field":"previous-effect","as":"known-previous","reducer":"sum"}]}},{"name":"value-covered-durations","subject":"Explicit complete evidence durations in the report and adjacent 28-day delivery periods.","objective":"Distinguish known zero from gaps or incomplete evidence.","acceptance":"The producer validates non-overlapping bounded coverage. Count only complete intervals, clipped to each exact half-open period.","from":"value-evidence-facts","filter":{"predicates":[{"field":"fact-kind","equals":"coverage"},{"field":"coverage-status","equals":"complete"}]},"compute":[{"as":"left-ms","function":"timestamp","args":[{"field":"at"}]},{"as":"right-ms","function":"timestamp","args":[{"field":"end-at"}]},{"as":"cutoff-ms","function":"timestamp","args":[{"field":"window-end"}]},{"as":"current-start","function":"difference","args":[{"field":"cutoff-ms"},{"value":2419200000}]},{"as":"previous-start","function":"difference","args":[{"field":"cutoff-ms"},{"value":4838400000}]},{"as":"after-current","function":"greater-than","args":[{"field":"left-ms"},{"field":"current-start"}]},{"as":"after-previous","function":"greater-than","args":[{"field":"left-ms"},{"field":"previous-start"}]},{"as":"before-current-end","function":"greater-than","args":[{"field":"current-start"},{"field":"right-ms"}]},{"as":"current-left","function":"if","args":[{"field":"after-current"},{"field":"left-ms"},{"field":"current-start"}]},{"as":"previous-left","function":"if","args":[{"field":"after-previous"},{"field":"left-ms"},{"field":"previous-start"}]},{"as":"previous-right","function":"if","args":[{"field":"before-current-end"},{"field":"right-ms"},{"field":"current-start"}]},{"as":"duration","function":"difference","args":[{"field":"right-ms"},{"field":"left-ms"}]},{"as":"current-duration","function":"difference","args":[{"field":"right-ms"},{"field":"current-left"}]},{"as":"previous-duration","function":"difference","args":[{"field":"previous-right"},{"field":"previous-left"}]},{"as":"positive-current","function":"greater-than","args":[{"field":"current-duration"},{"value":0}]},{"as":"positive-previous","function":"greater-than","args":[{"field":"previous-duration"},{"value":0}]},{"as":"covered-current","function":"if","args":[{"field":"positive-current"},{"field":"current-duration"},{"value":0}]},{"as":"covered-previous","function":"if","args":[{"field":"positive-previous"},{"field":"previous-duration"},{"value":0}]}],"aggregate":{"by":["report-id","workflow-route"],"values":[{"field":"duration","as":"covered-duration","reducer":"sum"},{"field":"covered-current","as":"covered-current","reducer":"sum"},{"field":"covered-previous","as":"covered-previous","reducer":"sum"}]}},{"name":"value-report-delivery","subject":"Evidence-qualified output and accepted-contribution totals.","objective":"Keep populations and native units separate without an implied conversion rate.","acceptance":"Absent output context is unknown. Missing coverage withholds complete totals and recent zero, retaining labelled known subtotals.","from":"value-contracts","joins":[{"source":"value-output-counts","type":"left","on":[{"left":"report-id","right":"report-id"},{"left":"workflow-route","right":"workflow-route"}],"fields":[{"field":"retained-outputs","as":"retained-outputs"},{"field":"receipt-outputs","as":"retained-receipts"}]},{"source":"value-implementation-counts","type":"left","on":[{"left":"report-id","right":"report-id"},{"left":"workflow-route","right":"workflow-route"}],"fields":[{"field":"accepted-implementations","as":"retained-implementations"},{"field":"known-result","as":"known-result"},{"field":"known-recent","as":"known-recent"},{"field":"known-previous","as":"known-previous"}]},{"source":"value-covered-durations","type":"left","on":[{"left":"report-id","right":"report-id"},{"left":"workflow-route","right":"workflow-route"}],"fields":[{"field":"covered-duration","as":"covered-duration"},{"field":"covered-current","as":"covered-current"},{"field":"covered-previous","as":"covered-previous"}]}],"compute":[{"as":"start-ms","function":"timestamp","args":[{"field":"window-start"}]},{"as":"end-ms","function":"timestamp","args":[{"field":"window-end"}]},{"as":"report-duration","function":"difference","args":[{"field":"end-ms"},{"field":"start-ms"}]},{"as":"complete-report","function":"equals-any","args":[{"field":"covered-duration"},{"field":"report-duration"}]},{"as":"complete-current","function":"equals-any","args":[{"field":"covered-current"},{"value":2419200000}]},{"as":"complete-previous","function":"equals-any","args":[{"field":"covered-previous"},{"value":2419200000}]},{"as":"show-workflow-trail","function":"equals-any","args":[{"field":"measurement-basis"},{"value":"workflow-contribution"}]},{"as":"known-output-count","function":"coalesce","args":[{"field":"retained-outputs"},{"value":0}]},{"as":"known-receipt-count","function":"coalesce","args":[{"field":"retained-receipts"},{"value":0}]},{"as":"receipt-outputs","function":"if","args":[{"field":"outputs-available"},{"field":"known-receipt-count"},{"value":null}]},{"as":"accepted-implementations","function":"coalesce","args":[{"field":"retained-implementations"},{"value":0}]},{"as":"output-count","function":"if","args":[{"field":"outputs-available"},{"field":"known-output-count"},{"value":null}]},{"as":"native-result","function":"coalesce","args":[{"field":"known-result"},{"value":0}]},{"as":"current-subtotal","function":"coalesce","args":[{"field":"known-recent"},{"value":0}]},{"as":"previous-subtotal","function":"coalesce","args":[{"field":"known-previous"},{"value":0}]},{"as":"recent-result","function":"if","args":[{"field":"complete-current"},{"field":"current-subtotal"},{"value":null}]},{"as":"previous-result","function":"if","args":[{"field":"complete-previous"},{"field":"previous-subtotal"},{"value":null}]}]},{"name":"value-report-summary","subject":"Shared native card and report comparison against the first retained snapshot.","objective":"Show signed repository-wide movement, the goal direction and the exact comparison dates.","acceptance":"This first/last snapshot comparison is not the adjacent-period alert policy, a pre-adoption baseline or causal workflow credit. One snapshot is not zero change.","from":"value-report-delivery","joins":[{"source":"value-first-snapshot","type":"left","on":[{"left":"report-id","right":"report-id"},{"left":"workflow-route","right":"workflow-route"}],"fields":[{"field":"value","as":"reference-value"},{"field":"at","as":"reference-at"}]},{"source":"value-last-snapshot","type":"left","on":[{"left":"report-id","right":"report-id"},{"left":"workflow-route","right":"workflow-route"}],"fields":[{"field":"value","as":"current-value"},{"field":"at","as":"current-at"},{"field":"snapshot-href","as":"current-snapshot-href"}]}],"compute":[{"as":"same-snapshot","function":"equals-any","args":[{"field":"reference-at"},{"field":"current-at"}]},{"as":"raw-change","function":"difference","args":[{"field":"current-value"},{"field":"reference-value"}]},{"as":"native-change","function":"if","args":[{"field":"same-snapshot"},{"value":null},{"field":"raw-change"}]},{"as":"change-missing","function":"equals-any","args":[{"field":"native-change"},{"value":null}]},{"as":"rising","function":"greater-than","args":[{"field":"native-change"},{"value":0}]},{"as":"falling","function":"greater-than","args":[{"value":0},{"field":"native-change"}]},{"as":"unchanged","function":"equals-any","args":[{"field":"native-change"},{"value":0}]},{"as":"decrease-goal","function":"equals-any","args":[{"field":"snapshot-direction"},{"value":"decrease"}]},{"as":"increase-goal","function":"equals-any","args":[{"field":"snapshot-direction"},{"value":"increase"}]},{"as":"increase-movement","function":"if","args":[{"field":"rising"},{"value":"Better"},{"value":"Worse"}]},{"as":"decrease-movement","function":"if","args":[{"field":"falling"},{"value":"Better"},{"value":"Worse"}]},{"as":"directed-movement","function":"if","args":[{"field":"decrease-goal"},{"field":"decrease-movement"},{"field":"increase-movement"}]},{"as":"known-movement","function":"if","args":[{"field":"unchanged"},{"value":"Unchanged"},{"field":"directed-movement"}]},{"as":"movement","function":"if","args":[{"field":"change-missing"},{"value":"Comparison unavailable"},{"field":"known-movement"}]},{"as":"increase-direction-label","function":"if","args":[{"field":"increase-goal"},{"value":"↑ Higher is better"},{"value":"Direction not retained"}]},{"as":"direction-label","function":"if","args":[{"field":"decrease-goal"},{"value":"↓ Lower is better"},{"field":"increase-direction-label"}]},{"as":"change-arrow","function":"if","args":[{"field":"rising"},{"value":"↑ +"},{"value":"↓ "}]},{"as":"change-number","function":"format-count","args":[{"field":"native-change"}]},{"as":"directional-delta","function":"concat","args":[{"field":"change-arrow"},{"field":"change-number"},{"value":" "},{"field":"snapshot-unit"}]},{"as":"known-delta","function":"if","args":[{"field":"unchanged"},{"value":"Unchanged"},{"field":"directional-delta"}]},{"as":"delta-label","function":"if","args":[{"field":"change-missing"},{"value":"Comparison unavailable"},{"field":"known-delta"}]},{"as":"signed-change","function":"concat","args":[{"field":"change-arrow"},{"field":"change-number"},{"value":" "},{"field":"snapshot-unit"},{"value":" · "},{"field":"movement"}]},{"as":"unchanged-change","function":"if","args":[{"field":"unchanged"},{"value":"Unchanged"},{"field":"signed-change"}]},{"as":"change-label","function":"if","args":[{"field":"change-missing"},{"value":"Comparison unavailable"},{"field":"unchanged-change"}]},{"as":"reference-day","function":"date-day","args":[{"field":"reference-at"}]},{"as":"known-comparison-label","function":"concat","args":[{"value":"Since "},{"field":"reference-day"},{"value":" · Everyone's work"}]},{"as":"comparison-label","function":"if","args":[{"field":"change-missing"},{"value":"No earlier snapshot for comparison"},{"field":"known-comparison-label"}]},{"as":"workflow-label","function":"coalesce","args":[{"field":"workflow-name"},{"field":"workflow"}]},{"as":"workflow-context","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"},{"value":" · "},{"field":"workflow-label"}]},{"as":"encoded-workflow","function":"url-encode","args":[{"field":"workflow-route"}]},{"as":"workflow-value-href","function":"concat","args":[{"value":"#page-workflow-value?workflow="},{"field":"encoded-workflow"}]},{"as":"encoded-report","function":"url-encode","args":[{"field":"report-id"}]},{"as":"report-href","function":"concat","args":[{"value":"#page-value-report?report="},{"field":"encoded-report"}]}]},{"name":"value-workflow-result-order","subject":"Version ordering after independently computing each report.","objective":"Keep exact report queries partition-local without changing latest-version selection.","acceptance":"Rank cutoffs then captures within each workflow and measure. Explicit report links do not need other report facts.","from":"value-report-summary","window":[{"operation":"change","field":"report-marker","as":"older-report","mode":"absolute","groupby":["organization","repository","workflow","workflow-route","metric-id"],"order-by":[{"field":"window-end","direction":"desc"},{"field":"observed-at","direction":"desc"},{"field":"report-id","direction":"desc"}]}]},{"name":"value-workflow-results","subject":"Current published report results per native measure.","objective":"Expose the latest coherent packet on the workflow Value tab.","acceptance":"Never replace missing facts with an older measured version. Explicit report links retain their own version.","from":"value-workflow-result-order","filter":{"predicates":[{"field":"older-report","equals":"unknown"}]}},{"name":"value-workflow-headline-order","subject":"Most recent current report across the measures of each workflow.","objective":"Give each workflow and repository one headline result; other measures stay on the workflow page.","acceptance":"Select by cutoff then capture. Never replace a missing result with an older or zero value.","from":"value-workflow-results","window":[{"operation":"change","field":"report-marker","as":"older-headline","mode":"absolute","groupby":["workflow-route"],"order-by":[{"field":"window-end","direction":"desc"},{"field":"observed-at","direction":"desc"},{"field":"report-id","direction":"desc"}]}]},{"name":"value-workflow-headlines","subject":"One headline result per workflow and repository.","objective":"Join cleanly to collection health without multiplying rows.","acceptance":"Exactly one row per workflow route.","from":"value-workflow-headline-order","filter":{"predicates":[{"field":"older-headline","equals":"unknown"}]}},{"name":"value-native-headline-order","subject":"Most recent primary native measurement for each repository and workflow.","objective":"Let ordinary batch Value functions participate in the universal Value inventory without requiring a rich report packet.","acceptance":"Select by evidence cutoff then assessment time. A newer unavailable assessment remains current and must not reveal an older numeric value.","from":"value-current-measurements","compute":[{"as":"headline-marker","function":"literal","args":[{"value":1}]}],"window":[{"operation":"change","field":"headline-marker","as":"older-native-headline","mode":"absolute","groupby":["workflow-route"],"order-by":[{"field":"window-end","direction":"desc"},{"field":"observed-at","direction":"desc"},{"field":"value-id","direction":"asc"}]}]},{"name":"value-native-headlines","subject":"One current primary native measurement per repository and workflow.","objective":"Supply a bounded workflow headline when no richer evidence report exists.","acceptance":"Keep missing value, coverage, maturity, native unit and campaign context unchanged.","from":"value-native-headline-order","filter":{"predicates":[{"field":"older-native-headline","equals":"unknown"}]}},{"name":"value-rich-headline-overview","subject":"Rich evidence report headlines normalized for universal Value subject selection.","objective":"Reuse the existing repository movement result without changing its evidence identity or comparison.","acceptance":"Retain the report route and first-to-last native movement; campaign context remains unknown unless another canonical source supplies it.","from":"value-workflow-headlines","compute":[{"as":"repository-coordinate","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"}]},{"as":"headline-campaign","function":"literal","args":[{"value":null}]},{"as":"headline-evidence","function":"literal","args":[{"value":"Rich evidence retained"}]},{"as":"headline-priority","function":"literal","args":[{"value":2}]},{"as":"headline-marker","function":"literal","args":[{"value":1}]}],"select":[{"field":"report-id","as":"headline-id"},{"field":"workflow-route"},{"field":"repository-coordinate"},{"field":"workflow-label"},{"field":"headline-campaign"},{"field":"observed-at","as":"headline-captured"},{"field":"window-end","as":"headline-cutoff"},{"field":"change-label","as":"headline-trend-label"},{"field":"movement","as":"headline-trend-movement"},{"field":"snapshot-name","as":"headline-trend-measure"},{"field":"headline-evidence"},{"field":"report-href","as":"headline-href"},{"field":"headline-priority"},{"field":"headline-marker"}]},{"name":"value-native-headline-overview","subject":"Native batch measurements normalized for universal Value subject selection.","objective":"Expose the current native result while keeping comparison unavailable unless a reviewed comparison exists.","acceptance":"A numeric measurement is not a trend or causal result. Missing remains unavailable and routes to workflow detail.","from":"value-native-headlines","compute":[{"as":"workflow-label","function":"coalesce","args":[{"field":"workflow-name"},{"field":"workflow-slug"}]},{"as":"headline-trend-movement","function":"if","args":[{"field":"measurement-missing"},{"value":"Measurement unavailable"},{"value":"Native value retained"}]},{"as":"headline-evidence","function":"if","args":[{"field":"measurement-missing"},{"value":"Latest assessment unavailable"},{"value":"Native measurement retained"}]},{"as":"encoded-workflow","function":"url-encode","args":[{"field":"workflow-route"}]},{"as":"headline-href","function":"concat","args":[{"value":"#page-workflow-value?workflow="},{"field":"encoded-workflow"}]},{"as":"headline-priority","function":"literal","args":[{"value":1}]}],"select":[{"field":"id","as":"headline-id"},{"field":"workflow-route"},{"field":"repository","as":"repository-coordinate"},{"field":"workflow-label"},{"field":"campaign","as":"headline-campaign"},{"field":"observed-at","as":"headline-captured"},{"field":"window-end","as":"headline-cutoff"},{"field":"measurement-label","as":"headline-trend-label"},{"field":"headline-trend-movement"},{"field":"metric-name","as":"headline-trend-measure"},{"field":"headline-evidence"},{"field":"headline-href"},{"field":"headline-priority"},{"field":"headline-marker"}]},{"name":"value-headline-candidates","subject":"Rich and native headline candidates for one exact repository and workflow deployment.","objective":"Choose one current drill target without combining unlike measurements.","acceptance":"Order by evidence cutoff and capture before preferring richer presentation. Never aggregate headline values.","from":"value-rich-headline-overview","union":["value-native-headline-overview"]},{"name":"value-headline-order","subject":"Current headline ordering for each exact repository and workflow deployment.","objective":"Prefer the newest evidence, then a rich evidence route when timestamps are equal.","acceptance":"A newer unavailable native assessment remains current. Rich presentation priority cannot cross an evidence-time gap.","from":"value-headline-candidates","window":[{"operation":"change","field":"headline-marker","as":"older-headline-candidate","mode":"absolute","groupby":["workflow-route"],"order-by":[{"field":"headline-cutoff","direction":"desc"},{"field":"headline-captured","direction":"desc"},{"field":"headline-priority","direction":"desc"},{"field":"headline-id","direction":"asc"}]}]},{"name":"value-headlines","subject":"One current Value headline per exact repository and workflow deployment.","objective":"Join current evidence to collection health and workflow topology without multiplying subjects.","acceptance":"Exactly one row per workflow route, with no cross-metric aggregation.","from":"value-headline-order","filter":{"predicates":[{"field":"older-headline-candidate","equals":"unknown"}]}},{"name":"value-workflow-topology","subject":"Canonical workflow deployment topology for Value grouping.","objective":"Classify exact workflow identities as campaign workers, orchestrators or standalone workflows without copying topology into evidence.","acceptance":"Campaign and role come only from canonical workflow inventory. The inventory identity is the paged subject grain.","from":"workflow-subject-topology","compute":[{"as":"repository-coordinate","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"}]},{"as":"workflow-route","function":"concat","args":[{"field":"repository-coordinate"},{"value":":"},{"field":"workflow"}]},{"as":"workflow-label","function":"coalesce","args":[{"field":"workflow-name"},{"field":"workflow"}]}],"select":[{"field":"repositoryId"},{"field":"path"},{"field":"id"},{"field":"workflow-route"},{"field":"repository-coordinate"},{"field":"workflow-label"},{"field":"workflow-label","as":"declared-workflow-label"},{"field":"workflow-role","as":"declared-workflow-role"},{"field":"campaign","as":"declared-campaign"},{"field":"campaign-name","as":"declared-campaign-name"},{"field":"campaign-icon","as":"declared-campaign-icon"}],"order-by":[{"field":"repositoryId","direction":"asc"},{"field":"path","direction":"asc"},{"field":"id","direction":"asc"}]},{"name":"value-workflow-overview","subject":"One universal row per repository and workflow deployment with topology, collection health and current Value evidence.","objective":"Compare campaign and standalone Value subjects through one honest card contract.","acceptance":"Every canonical workflow remains visible. Missing health is unknown and missing evidence is unavailable; neither becomes zero or inferred success.","from":"value-workflow-topology","joins":[{"source":"value-collection-health","type":"left","on":[{"left":"workflow-route","right":"workflow-route"}],"fields":[{"field":"registration","as":"collection-registration"},{"field":"collection-state","as":"collection-state"},{"field":"reason","as":"collection-reason"},{"field":"evidence-state","as":"health-evidence-state"},{"field":"captured-at","as":"health-captured"},{"field":"evidence-cutoff","as":"health-cutoff"}]},{"source":"value-headlines","type":"left","on":[{"left":"workflow-route","right":"workflow-route"}],"fields":[{"field":"headline-id","as":"headline-id"},{"field":"workflow-label","as":"headline-workflow-label"},{"field":"headline-campaign","as":"headline-campaign"},{"field":"headline-captured","as":"headline-captured"},{"field":"headline-cutoff","as":"headline-cutoff"},{"field":"headline-trend-label","as":"headline-trend-label"},{"field":"headline-trend-movement","as":"headline-trend-movement"},{"field":"headline-trend-measure","as":"headline-trend-measure"},{"field":"headline-evidence","as":"headline-evidence"},{"field":"headline-href","as":"headline-href"}]}],"compute":[{"as":"preferred-workflow-label","function":"coalesce","args":[{"field":"declared-workflow-label"},{"field":"headline-workflow-label"}]},{"as":"overview-workflow-label","function":"coalesce","args":[{"field":"preferred-workflow-label"},{"field":"workflow-label"}]},{"as":"overview-title","function":"concat","args":[{"field":"repository-coordinate"},{"value":" · "},{"field":"overview-workflow-label"}]},{"as":"registration","function":"coalesce","args":[{"field":"collection-registration"},{"value":"unknown"}]},{"as":"overview-state","function":"coalesce","args":[{"field":"collection-state"},{"value":"unknown"}]},{"as":"overview-reason","function":"coalesce","args":[{"field":"collection-reason"},{"value":"Collection status unavailable"}]},{"as":"overview-captured","function":"coalesce","args":[{"field":"headline-captured"},{"field":"health-captured"}]},{"as":"overview-cutoff","function":"coalesce","args":[{"field":"headline-cutoff"},{"field":"health-cutoff"}]},{"as":"headline-missing","function":"equals-any","args":[{"field":"headline-id"},{"value":null}]},{"as":"missing-evidence-label","function":"coalesce","args":[{"field":"health-evidence-state"},{"value":"No retained result"}]},{"as":"overview-evidence","function":"if","args":[{"field":"headline-missing"},{"field":"missing-evidence-label"},{"field":"headline-evidence"}]},{"as":"trend-label","function":"if","args":[{"field":"headline-missing"},{"value":"No retained result"},{"field":"headline-trend-label"}]},{"as":"trend-movement","function":"if","args":[{"field":"headline-missing"},{"value":"No result to compare"},{"field":"headline-trend-movement"}]},{"as":"trend-measure","function":"if","args":[{"field":"headline-missing"},{"value":"Not available"},{"field":"headline-trend-measure"}]},{"as":"encoded-workflow","function":"url-encode","args":[{"field":"workflow-route"}]},{"as":"workflow-href","function":"concat","args":[{"value":"#page-workflow-value?workflow="},{"field":"encoded-workflow"}]},{"as":"overview-href","function":"if","args":[{"field":"headline-missing"},{"field":"workflow-href"},{"field":"headline-href"}]},{"as":"workflow-role","function":"coalesce","args":[{"field":"declared-workflow-role"},{"value":"unknown"}]},{"as":"campaign","function":"coalesce","args":[{"field":"declared-campaign"},{"field":"headline-campaign"}]},{"as":"campaign-name","function":"coalesce","args":[{"field":"declared-campaign-name"},{"field":"campaign"}]},{"as":"campaign-icon","function":"coalesce","args":[{"field":"declared-campaign-icon"},{"value":"goal"}]},{"as":"standalone-workflow","function":"equals-any","args":[{"field":"workflow-role"},{"value":"standalone"}]},{"as":"campaign-missing","function":"equals-any","args":[{"field":"campaign"},{"value":null}]},{"as":"campaign-scope","function":"if","args":[{"field":"campaign-missing"},{"value":"Unclassified"},{"value":"Campaign"}]},{"as":"value-scope","function":"if","args":[{"field":"standalone-workflow"},{"value":"Standalone"},{"field":"campaign-scope"}]},{"as":"configured-registration","function":"equals-any","args":[{"field":"registration"},{"value":"enabled"},{"value":"disabled"}]},{"as":"configured-value","function":"if","args":[{"field":"configured-registration"},{"value":1},{"value":0}]},{"as":"unconfigured-state","function":"equals-any","args":[{"field":"overview-state"},{"value":"unconfigured"}]},{"as":"unconfigured-value","function":"if","args":[{"field":"unconfigured-state"},{"value":1},{"value":0}]},{"as":"deferred-state","function":"equals-any","args":[{"field":"overview-state"},{"value":"deferred"}]},{"as":"deferred-value","function":"if","args":[{"field":"deferred-state"},{"value":1},{"value":0}]},{"as":"failed-state","function":"equals-any","args":[{"field":"overview-state"},{"value":"failed"}]},{"as":"failed-value","function":"if","args":[{"field":"failed-state"},{"value":1},{"value":0}]},{"as":"current-evidence-value","function":"if","args":[{"field":"headline-missing"},{"value":0},{"value":1}]},{"as":"worse-movement","function":"equals-any","args":[{"field":"trend-movement"},{"value":"Worse"}]},{"as":"attention-state","function":"equals-any","args":[{"field":"overview-state"},{"value":"unconfigured"},{"value":"deferred"},{"value":"failed"}]},{"as":"state-or-missing-review","function":"if","args":[{"field":"attention-state"},{"value":true},{"field":"headline-missing"}]},{"as":"needs-review","function":"if","args":[{"field":"worse-movement"},{"value":true},{"field":"state-or-missing-review"}]},{"as":"missing-attention-reason","function":"if","args":[{"field":"headline-missing"},{"value":"No retained Value result"},{"value":"No review triggered"}]},{"as":"state-attention-reason","function":"if","args":[{"field":"attention-state"},{"field":"overview-reason"},{"field":"missing-attention-reason"}]},{"as":"attention-reason","function":"if","args":[{"field":"worse-movement"},{"value":"Measured outcome worsened"},{"field":"state-attention-reason"}]},{"as":"review-value","function":"if","args":[{"field":"needs-review"},{"value":1},{"value":0}]}],"order-by":[{"field":"overview-title","direction":"asc"}]},{"name":"value-campaign-complete-topology","subject":"Complete canonical campaign workflow topology.","objective":"Provide unpaged workflow routes for complete campaign coverage aggregation.","acceptance":"Every canonical workflow remains at its exact repository and workflow identity.","from":"workflows","compute":[{"as":"repository-coordinate","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"}]},{"as":"workflow-route","function":"concat","args":[{"field":"repository-coordinate"},{"value":":"},{"field":"workflow"}]},{"as":"campaign-missing","function":"equals-any","args":[{"field":"campaign"},{"value":null}]}]},{"name":"value-campaign-complete-deployments","subject":"Complete canonical campaign workflow deployment population with collection and current evidence state.","objective":"Keep campaign coverage aggregates complete while workflow card lists use request-scoped subject pages.","acceptance":"Every declared campaign workflow is included once. Missing health or evidence remains explicit and no paged cohort is used.","from":"value-campaign-complete-topology","joins":[{"source":"value-collection-health","type":"left","on":[{"left":"workflow-route","right":"workflow-route"}],"fields":[{"field":"registration","as":"collection-registration"},{"field":"collection-state","as":"collection-state"}]},{"source":"value-headlines","type":"left","on":[{"left":"workflow-route","right":"workflow-route"}],"fields":[{"field":"headline-id","as":"headline-id"},{"field":"headline-trend-movement","as":"headline-trend-movement"}]}],"compute":[{"as":"registration","function":"coalesce","args":[{"field":"collection-registration"},{"value":"unknown"}]},{"as":"overview-state","function":"coalesce","args":[{"field":"collection-state"},{"value":"unknown"}]},{"as":"headline-missing","function":"equals-any","args":[{"field":"headline-id"},{"value":null}]},{"as":"configured-registration","function":"equals-any","args":[{"field":"registration"},{"value":"enabled"},{"value":"disabled"}]},{"as":"configured-value","function":"if","args":[{"field":"configured-registration"},{"value":1},{"value":0}]},{"as":"unconfigured-state","function":"equals-any","args":[{"field":"overview-state"},{"value":"unconfigured"}]},{"as":"unconfigured-value","function":"if","args":[{"field":"unconfigured-state"},{"value":1},{"value":0}]},{"as":"deferred-state","function":"equals-any","args":[{"field":"overview-state"},{"value":"deferred"}]},{"as":"deferred-value","function":"if","args":[{"field":"deferred-state"},{"value":1},{"value":0}]},{"as":"failed-state","function":"equals-any","args":[{"field":"overview-state"},{"value":"failed"}]},{"as":"failed-value","function":"if","args":[{"field":"failed-state"},{"value":1},{"value":0}]},{"as":"current-evidence-value","function":"if","args":[{"field":"headline-missing"},{"value":0},{"value":1}]},{"as":"worse-movement","function":"equals-any","args":[{"field":"headline-trend-movement"},{"value":"Worse"}]},{"as":"attention-state","function":"equals-any","args":[{"field":"overview-state"},{"value":"unconfigured"},{"value":"deferred"},{"value":"failed"}]},{"as":"state-or-missing-review","function":"if","args":[{"field":"attention-state"},{"value":true},{"field":"headline-missing"}]},{"as":"needs-review","function":"if","args":[{"field":"worse-movement"},{"value":true},{"field":"state-or-missing-review"}]},{"as":"review-value","function":"if","args":[{"field":"needs-review"},{"value":1},{"value":0}]}],"filter":{"predicates":[{"field":"campaign-missing","equals":false}]},"select":[{"field":"workflow-route"},{"field":"repository-coordinate"},{"field":"campaign"},{"field":"campaign-name"},{"field":"campaign-icon"},{"field":"configured-value"},{"field":"current-evidence-value"},{"field":"unconfigured-value"},{"field":"deferred-value"},{"field":"failed-value"},{"field":"review-value"}]},{"name":"value-campaign-coverage-deployments","subject":"Universal Value deployments grouped under a declared campaign.","objective":"Support complete campaign coverage without creating a separate evidence system.","acceptance":"Only rows with canonical campaign context are included. Unclassified deployments remain visible in All and Needs review.","from":"value-campaign-complete-deployments"},{"name":"value-campaign-totals","subject":"Campaign Value coverage and attention summary over exact workflow deployments.","objective":"Aggregate campaign coverage and attention counts before presentation fields are derived.","acceptance":"Counts describe deployment coverage and attention only. They do not average native outcomes or create a campaign score.","from":"value-campaign-coverage-deployments","aggregate":{"by":["campaign","campaign-name","campaign-icon"],"values":[{"field":"workflow-route","as":"value-deployments","reducer":"count"},{"field":"repository-coordinate","as":"value-repositories","reducer":"distinct-count"},{"field":"configured-value","as":"configured-deployments","reducer":"sum"},{"field":"current-evidence-value","as":"current-evidence-deployments","reducer":"sum"},{"field":"unconfigured-value","as":"unconfigured-deployments","reducer":"sum"},{"field":"deferred-value","as":"deferred-deployments","reducer":"sum"},{"field":"failed-value","as":"failed-deployments","reducer":"sum"},{"field":"review-value","as":"review-deployments","reducer":"sum"}]}},{"name":"value-campaign-overview","subject":"Campaign Value coverage and attention presentation.","objective":"Find campaigns requiring evidence or outcome review before drilling into their workers.","acceptance":"Presentation fields derive only from bounded campaign deployment counts. No native outcome values are combined.","from":"value-campaign-totals","compute":[{"as":"review-present","function":"greater-than","args":[{"field":"review-deployments"},{"value":0}]},{"as":"review-count-label","function":"format-count","args":[{"field":"review-deployments"}]},{"as":"review-status-label","function":"concat","args":[{"field":"review-count-label"},{"value":" need review"}]},{"as":"campaign-value-status","function":"if","args":[{"field":"review-present"},{"field":"review-status-label"},{"value":"No review triggered"}]},{"as":"encoded-campaign","function":"url-encode","args":[{"field":"campaign"}]},{"as":"campaign-value-href","function":"concat","args":[{"value":"#page-campaign-value?campaign="},{"field":"encoded-campaign"}]}],"order-by":[{"field":"review-deployments","direction":"desc"},{"field":"campaign-name","direction":"asc"}]},{"name":"value-campaign-deployments","subject":"Paged exact Value deployments for one declared campaign.","objective":"Support campaign workflow drilldown through the bounded universal workflow card path.","acceptance":"Only rows with canonical campaign context are included. Every row preserves its exact collection and evidence state.","from":"value-workflow-overview","filter":{"predicates":[{"field":"value-scope","equals":"Campaign"}]}},{"name":"value-standalone-overview","subject":"Standalone workflow Value deployments.","objective":"Inspect standalone workflows through the same collection, outcome and evidence contract as campaign workers.","acceptance":"Standalone is a canonical workflow role, not inferred from missing campaign evidence.","from":"value-workflow-overview","filter":{"predicates":[{"field":"value-scope","equals":"Standalone"}]}},{"name":"value-review-overview","subject":"Value deployments with measured deterioration or incomplete collection/evidence state.","objective":"Prioritize exact deployments needing outcome or evidence investigation.","acceptance":"Each row preserves its explicit reason. Missing evidence, failed collection and worsening outcome are not interchangeable.","from":"value-workflow-overview","filter":{"predicates":[{"field":"needs-review","equals":true}]},"order-by":[{"field":"attention-reason","direction":"asc"},{"field":"overview-title","direction":"asc"}]},{"name":"value-intent-sources","subject":"Immutable extracted workflow intent sources.","objective":"Let readers inspect the original goal and requirements.","acceptance":"Only retained HTTPS evidence is linked; workflow text remains untrusted.","from":"value-evidence-facts","filter":{"predicates":[{"field":"fact-kind","equals":"intent-source"}]}},{"name":"value-requirements","subject":"Original full acceptance requirements.","objective":"Distinguish the measured structural facet from all workflow safeguards.","acceptance":"Requirements are source text, not proof they passed.","from":"value-evidence-facts","filter":{"predicates":[{"field":"fact-kind","equals":"requirement"}]}},{"name":"value-outputs","subject":"Retained safe-output lifecycle facts.","objective":"Show receipts, current-at-cutoff state and originating evidence.","acceptance":"A closed output is not automatically an accepted implementation; absence of a link is unknown.","from":"value-evidence-facts","filter":{"predicates":[{"field":"fact-kind","equals":"output"}]},"order-by":[{"field":"at","direction":"desc"},{"field":"fact-id","direction":"asc"}]},{"name":"value-output-origin-evidence","subject":"Retained producer and applied safe-output evidence.","objective":"Let readers distinguish receipt-confirmed creation from corroborated tracking.","acceptance":"Tracking identities locate outputs but do not establish accepted value. Keep unavailable producer evidence explicit.","from":"value-evidence-facts","filter":{"predicates":[{"field":"fact-kind","equals":"output-evidence"}]},"joins":[{"source":"value-outputs","type":"inner","on":[{"left":"report-id","right":"report-id"},{"left":"parent-id","right":"fact-id"}],"fields":[{"field":"label","as":"output-label"},{"field":"url","as":"output-url"}]}]},{"name":"value-implementations","subject":"Accepted implementations and native before/after effects.","objective":"Expose delivery time and immutable acceptance evidence.","acceptance":"Do not equate acceptance with full quality verification or omit negative effects.","from":"value-evidence-facts","filter":{"predicates":[{"field":"fact-kind","equals":"implementation"}]},"order-by":[{"field":"at","direction":"desc"},{"field":"fact-id","direction":"asc"}]},{"name":"value-output-trails","subject":"Explicit output-to-implementation edges.","objective":"Make the trail from a proposal to an accepted measured change inspectable.","acceptance":"Use retained dated edges only. Many-to-many links do not duplicate headline counts or values.","from":"value-evidence-facts","filter":{"predicates":[{"field":"fact-kind","equals":"output-implementation"}]},"joins":[{"source":"value-outputs","type":"inner","on":[{"left":"report-id","right":"report-id"},{"left":"parent-id","right":"fact-id"}],"fields":[{"field":"label","as":"output-label"},{"field":"url","as":"output-url"}]},{"source":"value-implementations","type":"inner","on":[{"left":"report-id","right":"report-id"},{"left":"related-id","right":"fact-id"}],"fields":[{"field":"label","as":"implementation-label"},{"field":"url","as":"implementation-url"},{"field":"value","as":"implementation-value"},{"field":"at","as":"trail-accepted-at"}]}]},{"name":"value-implementation-files","subject":"Measured implementation files and retained lineage sources.","objective":"Link to exact Git facts rather than only a repository tree.","acceptance":"No URL is reconstructed from an unrelated revision. Preserve before, after and replacement file evidence.","from":"value-evidence-facts","filter":{"predicates":[{"field":"fact-kind","in":["implementation-evidence","implementation-lineage"]}]},"joins":[{"source":"value-implementations","type":"inner","on":[{"left":"report-id","right":"report-id"},{"left":"parent-id","right":"fact-id"}],"fields":[{"field":"label","as":"implementation-label"},{"field":"url","as":"implementation-url"}]}]},{"name":"value-quality-checks","subject":"Explicit independent verification checks.","objective":"Keep unverified behavior, tests and other safeguards visible.","acceptance":"Missing or not-verified is not a passing check.","from":"value-evidence-facts","filter":{"predicates":[{"field":"fact-kind","equals":"quality-check"}]}},{"name":"value-limitations","subject":"Retained evidence and attribution limitations.","objective":"Qualify claims without inventing completeness.","acceptance":"Treat source limitations as untrusted text and never suppress them.","from":"value-evidence-facts","filter":{"predicates":[{"field":"fact-kind","equals":"limitation"}]}},{"name":"value-snapshot-items","subject":"Actual counted items at an independent immutable snapshot.","objective":"Open exact per-item evidence from the plotted observation.","acceptance":"Only retained items are shown. Missing item evidence must not look like an empty measured population.","from":"value-evidence-facts","filter":{"predicates":[{"field":"fact-kind","equals":"snapshot-item"}]},"joins":[{"source":"value-snapshots","type":"inner","on":[{"left":"report-id","right":"report-id"},{"left":"parent-id","right":"fact-id"},{"left":"snapshot-route","right":"snapshot-route"}],"fields":[{"field":"at","as":"snapshot-at"}]}]},{"name":"campaign-navigation-availability","subject":"Detect available campaign inventory for dashboard navigation.","objective":"Enable Campaigns only when collected campaign information is present.","acceptance":"Return at most one canonical campaign identity; missing or empty inventory does not enable Campaigns, and partial inventory does not imply complete campaign coverage.","from":"campaigns","select":[{"field":"campaign"}],"limit":1},{"name":"audit-event-summary-buckets","subject":"Aggregate high- and medium-severity audit events with the same severity and summary by workflow.","objective":"Select recurring high- or medium-severity audit summaries for run-level investigation.","acceptance":"Each bucket's event count is traceable to retained audit or tool observations with the same campaign, severity, workflow, and summary; missing workflow attribution stays unknown, and a count alone does not verify impact.","description":"High- and medium-severity audit event counts grouped by severity, workflow, and shared summary.","from":"audits","union":["tools"],"filter":{"predicates":[{"field":"event-type","in":["audit.finding","audit.observability","audit.recommendation","audit.missing_tool","audit.missing_data","audit.noop","audit.mcp_failure","skill.invoked"]},{"field":"event-status","in":["high","medium"]}]},"joins":[{"source":"workflows","type":"left","on":[{"left":"organization","right":"organization"},{"left":"repository","right":"repository"},{"left":"workflow","right":"workflow"}],"fields":[{"field":"campaign","as":"campaign"}]}],"aggregate":{"by":["campaign","event-status","workflow","event-summary"],"values":[{"field":"event","as":"events","reducer":"count"}]},"select":[{"field":"campaign"},{"field":"event-status"},{"field":"workflow"},{"field":"event-summary"},{"field":"events"}],"order-by":[{"field":"event-status","direction":"asc"},{"field":"events","direction":"desc"},{"field":"workflow","direction":"asc"},{"field":"event-summary","direction":"asc"}]},{"name":"campaign-workflows","subject":"List campaign-owned orchestrator and worker workflows with database-backed execution totals.","objective":"Choose an active campaign workflow whose observed execution warrants inspection.","acceptance":"Listed workflows match active declared orchestrator or worker inventory entries; runs and AI Credits agree with the selected-horizon inventory, and absence is not evidence of disabled authority or no executions. Rollout mode is context, not permission to change policy.","description":"Campaign workflows projected from lean canonical inventory, with shared declaration names and active-only workflow drill-down links.","from":"campaign-workflow-inventory","filter":{"predicates":[{"field":"workflow-active","equals":"true"}]},"compute":[{"as":"workflow-identity","function":"concat","args":[{"field":"repository"},{"value":":"},{"field":"workflow"}]},{"as":"encoded-workflow","function":"url-encode","args":[{"field":"workflow-identity"}]},{"as":"workflow-dashboard-href","function":"concat","args":[{"value":"#page-workflow-runtime?workflow="},{"field":"encoded-workflow"}]},{"as":"workflow-dashboard-label","function":"concat","args":[{"value":"View "},{"field":"workflow-display-name"},{"value":" workflow dashboard"}]},{"as":"workflow-dashboard-link","function":"dashboard-link","args":[{"field":"workflow-link"},{"field":"workflow-dashboard-href"},{"field":"workflow-dashboard-label"},{"field":"workflow-identity"}]}],"select":[{"field":"campaign"},{"field":"campaign-display-name","as":"campaign-name"},{"field":"organization"},{"field":"repository"},{"field":"workflow"},{"field":"workflow-display-name","as":"workflow-name"},{"field":"workflow-role"},{"field":"rollout-mode"},{"field":"workflow-active"},{"field":"runs"},{"field":"aic"},{"field":"repository-dashboard-link","as":"repository-link"},{"field":"workflow-dashboard-link","as":"workflow-link"}],"order-by":[{"field":"campaign-name","direction":"asc"},{"field":"workflow-role","direction":"asc"},{"field":"workflow-name","direction":"asc"}]},{"name":"campaign-repository-declarations","subject":"List active declared campaign workflows and their owning repositories without execution evidence.","objective":"Inspect campaign repository topology without computing unused run totals or import coverage.","acceptance":"Preserve active orchestrator and worker identities, display names, rollout context, links, and ordering. Declaration counts are not target enrollment, dispatch coverage, or execution totals. Empty inventory and unavailable workflow evidence remain distinct.","description":"Declaration-only repository topology. Run totals and import-evidence quality belong to execution views, not this inventory.","from":"campaign-workflow-declarations","filter":{"predicates":[{"field":"workflow-active","equals":"true"}]},"select":[{"field":"campaign"},{"field":"campaign-display-name","as":"campaign-name"},{"field":"organization"},{"field":"repository-slug","as":"repository"},{"field":"workflow"},{"field":"workflow-display-name","as":"workflow-name"},{"field":"workflow-role"},{"field":"declared-mode","as":"rollout-mode"},{"field":"workflow-active"},{"field":"repository-dashboard-link","as":"repository-link"}],"order-by":[{"field":"repository","direction":"asc"},{"field":"workflow","direction":"asc"}]},{"name":"campaign-repository-inventory","subject":"Present declared campaign repository topology in workflow display order.","objective":"Filter and search projected repository coordinates and workflow names without time-filtering structural declarations.","acceptance":"Preserve the campaign workflow list's stable ordering and declaration-only evidence quality; runtime horizons must not remove declared workflows.","from":"campaign-repository-declarations","order-by":[{"field":"campaign-name","direction":"asc"},{"field":"workflow-role","direction":"asc"},{"field":"workflow-name","direction":"asc"}]},{"name":"campaign-reports","subject":"Project retained outcomes into campaign-addressable report evidence.","objective":"Identify a campaign report whose durable outcome record needs follow-up.","acceptance":"Each report's campaign, title, source link, observation time, and disposition match its retained outcome; missing status is labeled unknown rather than accepted or resolved, and report production is not verified impact.","description":"Campaign outcome reports with database-backed disposition fields.","from":"outcomes","compute":[{"as":"report-status","function":"coalesce","args":[{"field":"outcome-status"},{"field":"outcome-state"},{"value":"unknown"}]}],"select":[{"field":"campaign"},{"field":"safe-output"},{"field":"outcome-title"},{"field":"outcome-summary"},{"field":"report-status","as":"outcome-status"},{"field":"rollout-mode"},{"field":"engine"},{"field":"engine-version"},{"field":"requested-model"},{"field":"resolved-model"},{"field":"outcome-category"},{"field":"observed-at"},{"field":"external-link"}],"order-by":[{"field":"observed-at","direction":"desc"},{"field":"outcome-title","direction":"asc"}]},{"name":"campaign-worker-issues","subject":"Project issue outcomes created by campaign worker workflows.","objective":"Choose a campaign worker issue whose current recorded disposition needs review.","acceptance":"Include only issues whose producing run joins declared worker inventory on organization, repository, and workflow, even when the issue lands elsewhere. Preserve campaign and role across Activity imports. Retain run and status evidence; missing closure details stay unknown and closure is not proof of resolution.","description":"Campaign-addressable issue outcomes restricted to declared worker workflows.","from":"outcomes","joins":[{"source":"workflows","type":"inner","on":[{"left":"organization","right":"organization"},{"left":"repository","right":"repository"},{"left":"workflow","right":"workflow"}],"fields":[{"field":"workflow-role","as":"declared-workflow-role"}]}],"filter":{"predicates":[{"field":"outcome-category","equals":"issue"},{"field":"declared-workflow-role","equals":"worker"}]},"select":[{"field":"campaign"},{"field":"organization"},{"field":"repository"},{"field":"safe-output"},{"field":"outcome-number"},{"field":"outcome-title","as":"event-summary"},{"field":"outcome-title"},{"field":"outcome-summary"},{"field":"outcome-status"},{"field":"outcome-state"},{"field":"issue-state"},{"field":"issue-closed"},{"field":"issue-state-reason"},{"field":"issue-status"},{"field":"issue-closing-status"},{"field":"issue-status-detail"},{"field":"issue-closed-at"},{"field":"issue-status-observed-at"},{"field":"outcome-category","as":"safe-output-type"},{"field":"workflow"},{"field":"workflow-name"},{"field":"run"},{"field":"observed-at"},{"field":"issue-link"},{"field":"external-link"},{"field":"run-link"}],"order-by":[{"field":"observed-at","direction":"desc"}]},{"name":"campaign-issue-tab-counts","subject":"Count the retained worker issues available for each campaign Reports tab.","objective":"Decide whether a campaign has retained worker issue reports to inspect.","acceptance":"For each returned campaign, items equals the number of rows in campaign-worker-issues for that campaign in the same horizon; missing campaigns are not treated as zero issues or verified resolution.","description":"One campaign row with the number of retained issue outcomes produced by campaign workers.","from":"campaign-worker-issues","aggregate":{"by":["campaign"],"values":[{"field":"campaign","as":"items","reducer":"count"}]}},{"name":"campaign-readme-orchestrators","subject":"Resolve one repository link for each campaign README from its declared orchestrator workflow.","objective":"Locate the declared orchestrator repository to contextualize a campaign README.","acceptance":"Each returned campaign and repository link traces to a declared orchestrator workflow; missing or multiple declarations are reported as uncertain rather than inventing a canonical repository.","from":"workflows","filter":{"predicates":[{"field":"workflow-role","equals":"orchestrator"}]},"select":[{"field":"campaign"},{"field":"repository-link"}]},{"name":"campaign-readme-details","subject":"Present retained campaign README content with its repository-relative link context.","objective":"Open the campaign's retained README in its declared repository context before relying on its guidance.","acceptance":"The README text and path match the campaign record and any repository link resolves through a declared orchestrator; absent content or repository linkage remains unavailable, not inferred.","from":"campaigns","joins":[{"source":"campaign-readme-orchestrators","type":"left","on":[{"left":"campaign","right":"campaign"}],"fields":[{"field":"repository-link","as":"repository-link"}]}],"select":[{"field":"campaign"},{"field":"campaign-readme"},{"field":"campaign-readme-path"},{"field":"repository-link"}]},{"name":"campaign-memory-campaigns","subject":"Provide the registered campaigns whose repository memory can be browsed together.","objective":"Choose a registered campaign for repository-memory inspection.","acceptance":"Each campaign identity and display name matches the retained campaign registry in the selected scope; listing a campaign does not establish that memory observations exist or are complete.","description":"Registered campaigns ordered for the all-campaign repository-memory browser.","from":"campaigns","select":[{"field":"campaign"},{"field":"campaign-name"}],"order-by":[{"field":"campaign-name","direction":"asc"}]},{"name":"campaign-performance-baseline-totals","subject":"Establish a selected-horizon campaign baseline from concluded run attempts while keeping reliability, unverified production, and efficiency as separate facts.","objective":"Select campaigns whose retained run reliability, output production, or AI Credit efficiency merits closer examination.","acceptance":"Concluded and successful attempts, outputs, and mean AI Credits reconcile to filtered retained runs; absent denominators or costs stay unknown. Produced outputs are unverified, not operational value.","description":"Canonical campaign run attempts aggregated into bounded selected-horizon baseline totals without treating runtime success or produced outputs as operational value.","from":"campaign-runs","compute":[{"as":"run-attempt-identity","function":"concat","args":[{"field":"run"},{"value":":"},{"field":"run-attempt"}]},{"as":"positive-aic","function":"greater-than","args":[{"field":"aic-total"},{"value":0}]}],"aggregate":{"by":["campaign"],"values":[{"field":"run-attempt-identity","as":"concluded-runs","reducer":"count","filter":{"predicates":[{"field":"status","in":["success","failure","cancelled","timed-out","action-required","neutral","skipped","stale","startup-failure"]}]}},{"field":"run-attempt-identity","as":"successful-runs","reducer":"count","filter":{"predicates":[{"field":"status","equals":"success"}]}},{"field":"safe-items-count","as":"runs-with-output-evidence","reducer":"count","filter":{"predicates":[{"field":"status","equals":"success"}]}},{"field":"safe-items-count","as":"produced-outputs","reducer":"sum","filter":{"predicates":[{"field":"status","equals":"success"}]}},{"field":"aic-total","as":"aic-per-successful-run","reducer":"mean","filter":{"predicates":[{"field":"status","equals":"success"},{"field":"positive-aic","equals":true}]}}]}},{"name":"campaign-run-status-counts","subject":"Count retained workflow runs by observed status for each campaign.","objective":"Show the distribution of run statuses so failed or stalled campaign runs can be identified.","acceptance":"Each count reconciles to campaign-runs rows with a start time for the same campaign and status; an empty result is not proof of healthy execution.","description":"Worker-side status distribution of campaign-attributed workflow runs.","from":"campaign-runs","aggregate":{"by":["campaign","status"],"values":[{"field":"started-at","as":"runs","reducer":"count"}]}},{"name":"campaign-dispatch-failure-reasons","subject":"Count retained failed workflow dispatches by failure reason for each campaign.","objective":"Prioritize which failure reasons need investigation first.","acceptance":"Each count reconciles to failed, startup-failure, timed-out, or stale dispatches for the same campaign and reason; missing reasons stay unknown and an empty result is not proof of healthy dispatch.","description":"Worker-side distribution of failure reasons across campaign workflow dispatches.","from":"dispatches","filter":{"predicates":[{"field":"status","in":["failure","startup-failure","timed-out","stale"]}]},"aggregate":{"by":["campaign","status-detail"],"values":[{"field":"run","as":"failed-dispatches","reducer":"count"}]},"order-by":[{"field":"failed-dispatches","direction":"desc"}]},{"name":"campaign-performance-baseline","subject":"Turn each campaign's selected-horizon baseline totals into deterministic reliability and production signals with an explicit successful-run efficiency fact.","objective":"Decide which campaign baseline signal needs run- or output-level verification next.","acceptance":"Success-rate and signal labels follow the retained totals and their explicit denominators; no concluded attempts or output evidence is distinguished from zero verified impact, and AI Credits per successful run remain a separate cost fact rather than a value score.","description":"A bounded, explainable baseline that distinguishes runtime reliability, unverified output production, and AI Credit efficiency.","from":"campaign-performance-baseline-totals","compute":[{"as":"success-rate","function":"quotient","args":[{"field":"successful-runs"},{"field":"concluded-runs"}]},{"as":"success-rate-display","function":"format-percent","args":[{"field":"success-rate"}]},{"as":"success-rate-percent","function":"product","args":[{"field":"success-rate"},{"value":100}]},{"as":"has-concluded-runs","function":"greater-than","args":[{"field":"concluded-runs"},{"value":0}]},{"as":"has-unsuccessful-runs","function":"greater-than","args":[{"field":"concluded-runs"},{"field":"successful-runs"}]},{"as":"observed-reliability-signal","function":"if","args":[{"field":"has-unsuccessful-runs"},{"value":"Unsuccessful runs observed"},{"value":"No unsuccessful runs observed"}]},{"as":"reliability-signal","function":"if","args":[{"field":"has-concluded-runs"},{"field":"observed-reliability-signal"},{"value":"No concluded runs observed"}]},{"as":"has-output-evidence","function":"greater-than","args":[{"field":"runs-with-output-evidence"},{"value":0}]},{"as":"has-produced-outputs","function":"greater-than","args":[{"field":"produced-outputs"},{"value":0}]},{"as":"observed-production-signal","function":"if","args":[{"field":"has-produced-outputs"},{"value":"Outputs produced; acceptance unverified"},{"value":"No outputs observed"}]},{"as":"production-signal","function":"if","args":[{"field":"has-output-evidence"},{"field":"observed-production-signal"},{"value":"Output evidence unavailable"}]}],"select":[{"field":"campaign"},{"field":"concluded-runs"},{"field":"successful-runs"},{"field":"success-rate"},{"field":"success-rate-display"},{"field":"success-rate-percent"},{"field":"reliability-signal"},{"field":"produced-outputs"},{"field":"production-signal"},{"field":"aic-per-successful-run"}]},{"name":"campaign-problem-runs","subject":"List retained failed runs for campaign problem investigation.","objective":"Choose a recent failed campaign run to investigate with its diagnostic evidence.","acceptance":"Each row corresponds to a retained campaign run with a declared failure, startup-failure, stale, or timed-out status; campaign-problem-run-evidence orders matching rows newest first. Absence is not proof of healthy execution or complete ingestion.","description":"Private failed-run input with retained diagnostic metadata; the evidence consumer orders only runs matching current runtime problems.","from":"campaign-runs","filter":{"predicates":[{"field":"status","in":["failure","startup-failure","stale","timed-out"]}]}},{"name":"campaign-problem-runtime-failures","subject":"Select current failing runtime partitions without presentation ordering.","objective":"Retain the exact current-failure eligibility needed by the problem evidence join.","acceptance":"A latest failure streak is a nonnegative integer, so failure-count at least one is equivalent to has-current-failure; missing or incomplete runtime evidence remains unknown.","description":"Private unsorted failure partitions for problem evidence; ordering is supplied by the retained failed runs.","from":"campaign-runtime-health-groups","filter":{"predicates":[{"field":"failure-count","gte":1}]},"compute":[{"as":"problem-kind","function":"coalesce","args":[{"value":"failure"},{"value":"failure"}]}]},{"name":"campaign-problem-runtime-partitions","subject":"Project current runtime problem keys and diagnoses for the failed-run evidence join.","objective":"Avoid sorting and retaining unused runtime problem presentation fields.","acceptance":"Retain both current failures and unobserved orchestrators, including their metadata and duplicate-key failure semantics; this projection does not establish health or root cause.","description":"Private compact equivalent of campaign-runtime-problems for equality enrichment, not presentation.","from":"campaign-problem-runtime-failures","union":["campaign-unobserved-orchestrators"],"select":[{"field":"campaign"},{"field":"workflow"},{"field":"runtime-repository"},{"field":"failure-count"},{"field":"problem-kind"}]},{"name":"campaign-problem-run-evidence","subject":"Attach the current campaign runtime problem summary to each retained failed Run for that partition.","objective":"Inspect the failure count and problem kind alongside a failed run without inferring its root cause.","acceptance":"Each returned row joins a retained failed run to a runtime problem on campaign, workflow, and runtime repository; the inner join drops unmatched runs, so compare with campaign-problem-runs before interpreting absence as no problem.","description":"Failed campaign runs annotated with the failure-count and problem-kind of their active runtime problem, one row per retained failed Run.","from":"campaign-problem-runs","joins":[{"source":"campaign-problem-runtime-partitions","type":"inner","on":[{"left":"campaign","right":"campaign"},{"left":"workflow","right":"workflow"},{"left":"runtime-repository","right":"runtime-repository"}],"fields":[{"field":"failure-count","as":"failure-count"},{"field":"problem-kind","as":"problem-kind"}]}],"order-by":[{"field":"started-at","direction":"desc"},{"field":"run","direction":"desc"}]},{"name":"campaign-problem-latest-target-runs","subject":"Identify the most recent retained failed Run for each campaign workflow target repository.","objective":"Select the latest retained failed run identity for each campaign workflow and target partition.","acceptance":"For every returned campaign, workflow, runtime repository, and target repository, latest-target-run agrees with the maximum retained failed run identity in that partition; a missing partition is not a healthy target.","description":"One row per campaign workflow and target repository with its most recent retained failed Run identity.","from":"campaign-problem-run-evidence","aggregate":{"by":["campaign","workflow","runtime-repository","target-repository"],"values":[{"field":"run","as":"latest-target-run","reducer":"max"}]}},{"name":"campaign-problem-error-groups","subject":"Cluster retained failed Run evidence by workflow, runtime repository, target repository, and error signature so repeated identical failures for one target collapse into one diagnosable group.","objective":"Rank repeated target-specific error signatures for investigation without merging unrelated failures.","acceptance":"Occurrence-count and latest-run match retained failed runs grouped by campaign, workflow, repositories, problem kind, and signature; unknown signatures may group together. Counts do not prove a root cause.","description":"One row per distinct target repository and error signature within a campaign runtime problem partition, with an occurrence count and the most recent matching Run identity for follow-up.","from":"campaign-problem-run-evidence","aggregate":{"by":["campaign","campaign-name","workflow","workflow-name","workflow-role","runtime-repository","target-repository","rollout-mode","failure-count","problem-kind","error-signature","error-signature-label"],"values":[{"field":"run","as":"occurrence-count","reducer":"count"},{"field":"run","as":"latest-run","reducer":"max"}]}},{"name":"campaign-current-problem-error-groups","subject":"Keep only the newest error signature for each campaign workflow target repository.","objective":"Focus investigation on the signature associated with the latest retained failed run per target.","acceptance":"Each returned group joins campaign-problem-latest-target-runs on campaign, workflow, runtime repository, and latest run ID; target repository is not a join key, so verify target identity against underlying runs before claiming one current signature per target.","description":"Current target-specific error groups whose representative Run is the target repository's most recent retained failed Run.","from":"campaign-problem-error-groups","joins":[{"source":"campaign-problem-latest-target-runs","type":"inner","on":[{"left":"campaign","right":"campaign"},{"left":"workflow","right":"workflow"},{"left":"runtime-repository","right":"runtime-repository"},{"left":"latest-run","right":"latest-target-run"}],"fields":[{"field":"latest-target-run","as":"current-target-run"}]}]},{"name":"campaign-problem-items","subject":"Attach the most recent representative Run evidence to each distinct campaign runtime problem error signature.","objective":"Open the representative failed run and target for each current campaign problem group.","acceptance":"Check joined run-link, run ID, campaign, workflow, and runtime repository; verify target against run evidence (not a join key). Unobserved orchestrators need inventory review. Missing evidence remains unknown; rollout mode does not authorize policy changes.","description":"Current campaign runtime problems represented by the newest error signature for each target repository, with its effective rollout mode, an occurrence count, the most recent matching failed Run, and a repair prompt.","from":"campaign-current-problem-error-groups","joins":[{"source":"campaign-problem-run-evidence","type":"inner","on":[{"left":"campaign","right":"campaign"},{"left":"workflow","right":"workflow"},{"left":"runtime-repository","right":"runtime-repository"},{"left":"latest-run","right":"run"}],"fields":[{"field":"started-at","as":"started-at"},{"field":"run","as":"run"},{"field":"status","as":"status"},{"field":"status-detail","as":"status-detail"},{"field":"failure-job","as":"failure-job"},{"field":"failure-message","as":"failure-message"},{"field":"failure-step","as":"failure-step"},{"field":"failure-log","as":"failure-log"},{"field":"gh-aw-version","as":"gh-aw-version"},{"field":"engine","as":"engine"},{"field":"engine-version","as":"engine-version"},{"field":"requested-model","as":"requested-model"},{"field":"resolved-model","as":"resolved-model"},{"field":"run-link","as":"run-link"},{"field":"repository-link","as":"repository-link"},{"field":"workflow-link","as":"workflow-link"},{"field":"workflow-source-link","as":"workflow-source-link"}]}],"union":["campaign-unobserved-orchestrators"],"compute":[{"as":"problem-title","function":"coalesce","args":[{"field":"failure-message"},{"field":"status-detail"},{"field":"error-signature-label"},{"field":"workflow-name"}]},{"as":"_runtime-repository-encoded","function":"url-encode","args":[{"field":"runtime-repository"}]},{"as":"_runtime-repository-href","function":"concat","args":[{"value":"#page-repository-detail?repository="},{"field":"_runtime-repository-encoded"}]},{"as":"runtime-repository-link","function":"dashboard-link","args":[{"field":"repository-link"},{"field":"_runtime-repository-href"},{"field":"runtime-repository"},{"field":"runtime-repository"}]},{"as":"_target-repository-encoded","function":"url-encode","args":[{"field":"target-repository"}]},{"as":"_target-repository-href","function":"concat","args":[{"value":"#page-repository-detail?repository="},{"field":"_target-repository-encoded"}]},{"as":"target-repository-link","function":"dashboard-link","args":[{"field":"target-repository"},{"field":"_target-repository-href"},{"field":"target-repository"}]}],"order-by":[{"field":"workflow-name","direction":"asc"},{"field":"runtime-repository","direction":"asc"},{"field":"occurrence-count","direction":"desc"},{"field":"started-at","direction":"desc"}]},{"name":"campaign-problem-tab-counts","subject":"Count the current runtime problem items available for each campaign Problems tab.","objective":"Determine whether the campaign has current retained failure groups requiring review.","acceptance":"For every returned campaign, items equals the number of campaign-problem-items rows in the same horizon; a missing count does not establish zero failures or healthy execution.","description":"One campaign row with the number of current runtime problem groups.","from":"campaign-problem-items","aggregate":{"by":["campaign"],"values":[{"field":"campaign","as":"items","reducer":"count"}]}},{"name":"campaign-baseline-successful-runs","subject":"Project successful concluded attempts from the selected-horizon campaign baseline.","objective":"Show the successful share of concluded runs without implying verified impact.","acceptance":"Counts reconcile to campaign-performance-baseline-totals; missing campaigns do not imply zero runs.","from":"campaign-performance-baseline-totals","compute":[{"as":"outcome","function":"concat","args":[{"value":"Successful attempts"},{"value":""}]}],"select":[{"field":"campaign"},{"field":"outcome"},{"field":"successful-runs","as":"runs"}]},{"name":"campaign-baseline-other-runs","subject":"Project non-successful concluded attempts from the selected-horizon campaign baseline.","objective":"Show the remaining concluded runs for reliability review.","acceptance":"Runs equal concluded-runs minus successful-runs; the category includes every other concluded status, not just failures.","from":"campaign-performance-baseline-totals","compute":[{"as":"outcome","function":"concat","args":[{"value":"Other concluded attempts"},{"value":""}]},{"as":"other-runs","function":"difference","args":[{"field":"concluded-runs"},{"field":"successful-runs"}]}],"select":[{"field":"campaign"},{"field":"outcome"},{"field":"other-runs","as":"runs"}]},{"name":"campaign-baseline-outcome-distribution","subject":"Compare successful and other concluded attempts in the selected horizon.","objective":"Spot campaign run reliability that needs inspection.","acceptance":"Successful and other counts sum to concluded attempts; neither runtime result nor output production establishes operational value.","from":"campaign-baseline-successful-runs","union":["campaign-baseline-other-runs"]},{"name":"campaign-audit-summary-plot-inventory","subject":"Describe the rendered audit-summary chart using the shared campaign Insights plot contract.","objective":"Find campaigns with retained high- or medium-severity audit summaries worth reviewing.","acceptance":"Each campaign's bucket count equals its retained audit-event-summary-buckets rows; the count describes displayed groups, not distinct incidents or confirmed harm, and missing buckets are not proof of safety.","description":"One plot-inventory row per campaign when its high- and medium-severity audit summary chart has data.","from":"audit-event-summary-buckets","aggregate":{"by":["campaign"],"values":[{"field":"event-summary","as":"buckets","reducer":"count"}]}},{"name":"campaign-insight-plot-inventory","subject":"Inventory every plot rendered on each campaign Insights page through one reusable plot contract.","objective":"Choose an available campaign Insights plot to inspect its underlying evidence.","acceptance":"Each plot entry is supplied by the audit summary plot inventory for the same campaign; experimental operational-value evidence is excluded, no plot count is treated as outcome quality, and unavailable evidence is not synthesized into a plot.","description":"One campaign row per rendered Insights plot, independent of the plot's data source or renderer.","from":"campaign-audit-summary-plot-inventory"},{"name":"campaign-insight-tab-counts","subject":"Count the plots declared by the shared campaign Insights plot inventory.","objective":"Determine whether a campaign has evidence-backed Insights plots to inspect.","acceptance":"For every returned campaign, items equals its rows in campaign-insight-plot-inventory for the same horizon; absent rows do not establish absent value, and plot counts do not measure impact.","description":"One campaign row with the number of rendered Insights plots, independent of plot type.","from":"campaign-insight-plot-inventory","aggregate":{"by":["campaign"],"values":[{"field":"campaign","as":"items","reducer":"count"}]}},{"name":"workflow-ordered-runs","subject":"Order retained run attempts within each workflow by their observed start time.","objective":"Identify each workflow's latest execution without importing event coverage or outcome totals.","acceptance":"The first chronological attempt in each workflow partition has no preceding run delta; break timestamp ties by run ID and attempt, and use creation time for queued runs.","from":"runs","compute":[{"as":"latest-run-at","function":"coalesce","args":[{"field":"started-at"},{"field":"created-at"}]}],"window":[{"operation":"change","field":"run","as":"preceding-run-delta","mode":"absolute","groupby":["organization","repository","workflow"],"order-by":[{"field":"latest-run-at","direction":"desc"},{"field":"run","direction":"desc"},{"field":"run-attempt","direction":"desc"}]}],"select":[{"field":"organization"},{"field":"repository"},{"field":"workflow"},{"field":"run"},{"field":"run-attempt"},{"field":"latest-run-at"},{"field":"run-status"},{"field":"run-conclusion"},{"field":"preceding-run-delta"},{"field":"run-link"}]},{"name":"workflow-latest-runs","subject":"Project the latest retained run attempt for each workflow.","objective":"Expose each workflow's latest observed execution state without implying aggregate outcomes.","acceptance":"Select only the first chronologically ordered attempt per workflow; preserve queued and in-progress states instead of treating unknown conclusions as failures.","from":"workflow-ordered-runs","filter":{"predicates":[{"field":"preceding-run-delta","equals":"unknown"}]},"compute":[{"as":"observed-conclusion","function":"coalesce","args":[{"field":"run-conclusion"},{"value":"unknown"}]},{"as":"completed","function":"equals-any","args":[{"field":"run-status"},{"value":"completed"}]},{"as":"latest-run-status","function":"if","args":[{"field":"completed"},{"field":"observed-conclusion"},{"field":"run-status"}]}],"select":[{"field":"organization"},{"field":"repository"},{"field":"workflow"},{"field":"run"},{"field":"run-attempt"},{"field":"latest-run-at"},{"field":"latest-run-status"},{"field":"run-link"}]},{"name":"workflow-list-preview","subject":"Show workflow declarations while latest-run evidence is still loading.","objective":"Make workflow identities and drill links available before retained runs are evaluated.","acceptance":"Preserve every declared workflow and its drill link; leave latest-run fields absent until the complete projection arrives.","from":"workflows","compute":[{"as":"repository-coordinate","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"}]},{"as":"workflow-label","function":"concat","args":[{"field":"repository-coordinate"},{"value":":"},{"field":"workflow"}]},{"as":"workflow-display-name","function":"coalesce","args":[{"field":"workflow-name"},{"field":"workflow"}]},{"as":"declared-role","function":"coalesce","args":[{"field":"workflow-role"},{"value":"standalone"}]},{"as":"declared-mode","function":"coalesce","args":[{"field":"rollout-mode"},{"value":"unknown"}]},{"as":"declared-registration","function":"coalesce","args":[{"field":"workflow-active"},{"value":"unknown"}]},{"as":"encoded-workflow","function":"url-encode","args":[{"field":"workflow-label"}]},{"as":"workflow-dashboard-href","function":"concat","args":[{"value":"#page-workflow-runtime?workflow="},{"field":"encoded-workflow"}]},{"as":"workflow-dashboard-link","function":"dashboard-link","args":[{"field":"workflow-link"},{"field":"workflow-dashboard-href"},{"field":"workflow-display-name"},{"field":"workflow-label"}]}],"select":[{"field":"organization"},{"field":"repository-coordinate","as":"repository"},{"field":"workflow"},{"field":"workflow-display-name","as":"workflow-name"},{"field":"workflow-label"},{"field":"campaign-name"},{"field":"declared-role","as":"workflow-role"},{"field":"declared-mode","as":"rollout-mode"},{"field":"declared-registration","as":"workflow-active"},{"field":"repository-link"},{"field":"workflow-dashboard-link","as":"workflow-link"}],"order-by":[{"field":"repository","direction":"asc"},{"field":"workflow","direction":"asc"}]},{"name":"workflow-list","subject":"List declared workflows in latest observed run order.","objective":"Open a dedicated workflow page from a lightweight inventory with its latest execution status.","acceptance":"Preserve textual run identities and keep unobserved workflows last with an explicit missing-run state; use only workflow declarations and retained runs, not event coverage or aggregate success/failure counters.","from":"workflows","joins":[{"source":"workflow-latest-runs","type":"left","on":[{"left":"organization","right":"organization"},{"left":"repository","right":"repository"},{"left":"workflow","right":"workflow"}],"fields":[{"field":"run","as":"latest-run"},{"field":"latest-run-at","as":"latest-run-at"},{"field":"latest-run-status","as":"observed-run-status"},{"field":"run-link","as":"run-link"}]}],"compute":[{"as":"repository-coordinate","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"}]},{"as":"workflow-label","function":"concat","args":[{"field":"repository-coordinate"},{"value":":"},{"field":"workflow"}]},{"as":"workflow-display-name","function":"coalesce","args":[{"field":"workflow-name"},{"field":"workflow"}]},{"as":"declared-role","function":"coalesce","args":[{"field":"workflow-role"},{"value":"standalone"}]},{"as":"declared-mode","function":"coalesce","args":[{"field":"rollout-mode"},{"value":"unknown"}]},{"as":"declared-registration","function":"coalesce","args":[{"field":"workflow-active"},{"value":"unknown"}]},{"as":"observed-run-id","function":"coalesce","args":[{"field":"latest-run"},{"value":"0"}]},{"as":"has-observed-run","function":"greater-than","args":[{"field":"observed-run-id"},{"value":0}]},{"as":"latest-run-status","function":"coalesce","args":[{"field":"observed-run-status"},{"value":"No observed run"}]},{"as":"encoded-workflow","function":"url-encode","args":[{"field":"workflow-label"}]},{"as":"workflow-dashboard-href","function":"concat","args":[{"value":"#page-workflow-runtime?workflow="},{"field":"encoded-workflow"}]},{"as":"workflow-dashboard-link","function":"dashboard-link","args":[{"field":"workflow-link"},{"field":"workflow-dashboard-href"},{"field":"workflow-display-name"},{"field":"workflow-label"}]}],"select":[{"field":"organization"},{"field":"repository-coordinate","as":"repository"},{"field":"workflow"},{"field":"workflow-display-name","as":"workflow-name"},{"field":"workflow-label"},{"field":"campaign-name"},{"field":"declared-role","as":"workflow-role"},{"field":"declared-mode","as":"rollout-mode"},{"field":"declared-registration","as":"workflow-active"},{"field":"latest-run"},{"field":"latest-run-at"},{"field":"latest-run-status"},{"field":"has-observed-run"},{"field":"repository-link"},{"field":"workflow-dashboard-link","as":"workflow-link"},{"field":"run-link"}],"order-by":[{"field":"has-observed-run","direction":"desc"},{"field":"latest-run-at","direction":"desc"},{"field":"repository","direction":"asc"},{"field":"workflow","direction":"asc"}]},{"name":"runs-daily-health-buckets","subject":"Select whole UTC start-day buckets against the requested time bounds.","objective":"Expose UTC bucket boundaries for declarative daily time selection.","acceptance":"Compute bounds from observed execution-start days only; missing request bounds remain unset and no sub-day totals or missing days are fabricated.","from":"daily-run-counts","compute":[{"as":"day-midnight","function":"concat","args":[{"field":"day"},{"value":"T00:00:00Z"}]},{"as":"day-ms","function":"timestamp","args":[{"field":"day-midnight"}]},{"as":"start-ms","function":"timestamp","args":[{"context":"time-start"}]},{"as":"end-ms","function":"timestamp","args":[{"context":"time-end"}]},{"as":"before-start","function":"greater-than","args":[{"field":"start-ms"},{"field":"day-ms"}]},{"as":"before-end","function":"greater-than","args":[{"field":"end-ms"},{"field":"day-ms"}]}]},{"name":"runs-daily-health-totals","subject":"Sum observed daily run health across the selected scope.","objective":"Keep daily activity counts independent of detail retention.","acceptance":"Sum only daily counts, never retained Runs. UTC start-day buckets are selected by midnight; sub-day totals are unsupported. Missing or undated evidence remains unavailable or partial.","from":"runs-daily-health-buckets","filter":{"predicates":[{"field":"before-start","in":[false,null]},{"field":"before-end","in":[true,null]}]},"aggregate":{"by":["day"],"values":[{"field":"successful","as":"successful","reducer":"sum"},{"field":"failed","as":"failed","reducer":"sum"},{"field":"approval","as":"approval","reducer":"sum"},{"field":"pending","as":"pending","reducer":"sum"},{"field":"other","as":"other","reducer":"sum"}]}},{"name":"runs-daily-successful","subject":"Observed daily successful run counts.","objective":"Expose the successful class for the daily runtime-health chart.","acceptance":"Project successful counts from scoped daily totals without re-reading detail; runtime success does not imply accepted outcomes.","from":"runs-daily-health-totals","compute":[{"as":"runtime-health","function":"literal","args":[{"value":"Successful"}]}],"select":[{"field":"day"},{"field":"runtime-health"},{"field":"successful","as":"runs"}]},{"name":"runs-daily-failed","subject":"Observed daily failed run counts.","objective":"Expose the failed class for the daily runtime-health chart.","acceptance":"Project failed counts from scoped daily totals, preserving zero counts and aggregate coverage without deriving incidents.","from":"runs-daily-health-totals","compute":[{"as":"runtime-health","function":"literal","args":[{"value":"Failed"}]}],"select":[{"field":"day"},{"field":"runtime-health"},{"field":"failed","as":"runs"}]},{"name":"runs-daily-approval","subject":"Observed daily approval-required run counts.","objective":"Expose approval-required observations in the daily runtime-health chart.","acceptance":"Project approval counts from scoped daily totals without treating approval-required observations as successes or failures.","from":"runs-daily-health-totals","compute":[{"as":"runtime-health","function":"literal","args":[{"value":"Approval required"}]}],"select":[{"field":"day"},{"field":"runtime-health"},{"field":"approval","as":"runs"}]},{"name":"runs-daily-pending","subject":"Observed daily pending run counts.","objective":"Expose last-observed pending state in the daily runtime-health chart.","acceptance":"Project pending counts from scoped daily totals; counts describe last-observed evidence, not a live execution census.","from":"runs-daily-health-totals","compute":[{"as":"runtime-health","function":"literal","args":[{"value":"Pending"}]}],"select":[{"field":"day"},{"field":"runtime-health"},{"field":"pending","as":"runs"}]},{"name":"runs-daily-other","subject":"Observed daily unclassified terminal or missing-status run counts.","objective":"Expose the remaining runtime-health class without implying success.","acceptance":"Project other counts from scoped daily totals; preserve zeros and coverage without interpreting skipped, cancelled, or unknown evidence as success.","from":"runs-daily-health-totals","compute":[{"as":"runtime-health","function":"literal","args":[{"value":"Other"}]}],"select":[{"field":"day"},{"field":"runtime-health"},{"field":"other","as":"runs"}]},{"name":"runs-daily-conclusions","subject":"Daily observed runtime health classes for the Runs chart.","objective":"Investigate daily activity independently of retained run detail.","acceptance":"Classes sum to observed dated Runs, not attempts or verified outcomes. Pending is last-observed state; Other is not success. Select whole UTC start-day buckets by midnight, not sub-day totals. Preserve partial or unavailable coverage.","from":"runs-daily-successful","union":["runs-daily-failed","runs-daily-approval","runs-daily-pending","runs-daily-other"],"order-by":[{"field":"day","direction":"asc"},{"field":"runtime-health","direction":"asc"}]},{"name":"entity-events","subject":"Project all run-owned records for reusable cards and run drill-down.","objective":"Expose run-owned event identity, status, provenance, timestamp, and available navigation links for inspection.","acceptance":"Projected event fields and fallback URL trace to the source record; a missing link or event is not proof of no output, and event status alone does not verify downstream impact.","from":"event-base","compute":[{"as":"event-url","function":"coalesce","args":[{"field":"safe-output-url"},{"field":"correlation-id"},{"field":"implementation-pull-request-url"}]}],"select":[{"field":"organization"},{"field":"repository"},{"field":"workflow"},{"field":"run"},{"field":"run-attempt"},{"field":"event"},{"field":"event-source"},{"field":"event-type"},{"field":"event-summary"},{"field":"event-status"},{"field":"github-entity-type"},{"field":"safe-output-type"},{"field":"event-url"},{"field":"event-timestamp","as":"observed-at"},{"field":"run-link"}],"order-by":[{"field":"observed-at","direction":"desc"},{"field":"event","direction":"asc"}]},{"name":"runs-table","subject":"Show observed workflow runs in a table with execution, repository, workflow, engine, model, and navigation details.","objective":"Locate observed runs whose recorded status or conclusion needs closer inspection.","acceptance":"Show recorded run identity, status, conclusion, scope, execution metadata, and source links in newest-first order; absent runs require a freshness and coverage check, and a successful run is not proof of accepted outcomes.","description":"Observed workflow runs ordered from newest to oldest.","from":"runs","compute":[{"as":"repository-coordinate","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"}]}],"select":[{"field":"run"},{"field":"run-status"},{"field":"run-conclusion"},{"field":"repository-coordinate"},{"field":"workflow"},{"field":"rollout-mode"},{"field":"engine"},{"field":"engine-version"},{"field":"gh-aw-version"},{"field":"requested-model"},{"field":"resolved-model"},{"field":"started-at"},{"field":"repository-link"},{"field":"workflow-link"},{"field":"run-link"}],"order-by":[{"field":"started-at","direction":"desc"}]},{"name":"workflow-aic-per-run","subject":"List declared workflows with recorded positive AI Credit costs and their average cost per run.","objective":"Identify workflows with observed run AIC averages worth investigating alongside run evidence.","acceptance":"Include only declared workflows with at least one run attempt reporting positive AIC; exclude zero and missing telemetry from the average and ranking, without interpreting missing telemetry as free execution.","description":"Workflow AI Credit averages limited to run attempts with recorded positive AIC.","from":"workflows","joins":[{"source":"workflow-aic-run-totals","type":"left","on":[{"left":"organization","right":"organization"},{"left":"repository","right":"repository"},{"left":"workflow","right":"workflow"}],"fields":[{"field":"runs","as":"observed-runs"},{"field":"aic-runs","as":"observed-aic-runs"},{"field":"aic","as":"observed-aic"}]}],"compute":[{"as":"repository-slug","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"}]},{"as":"workflow-display-name","function":"coalesce","args":[{"field":"workflow-name"},{"field":"workflow"}]},{"as":"workflow-identity","function":"concat","args":[{"field":"repository-slug"},{"value":":"},{"field":"workflow"}]},{"as":"encoded-workflow","function":"url-encode","args":[{"field":"workflow-identity"}]},{"as":"workflow-dashboard-href","function":"concat","args":[{"value":"#page-workflow-runtime?workflow="},{"field":"encoded-workflow"}]},{"as":"workflow-dashboard-label","function":"concat","args":[{"value":"View "},{"field":"workflow-display-name"},{"value":" workflow dashboard"}]},{"as":"workflow-dashboard-link","function":"dashboard-link","args":[{"field":"workflow-link"},{"field":"workflow-dashboard-href"},{"field":"workflow-dashboard-label"},{"field":"workflow-identity"}]},{"as":"aic-per-run","function":"quotient","args":[{"field":"observed-aic"},{"field":"observed-aic-runs"}]}],"filter":{"predicates":[{"field":"observed-aic-runs","gte":1}]},"select":[{"field":"workflow-identity","as":"workflow-label"},{"field":"workflow-dashboard-link","as":"workflow-link"},{"field":"aic-per-run"}],"order-by":[{"field":"aic-per-run","direction":"desc"}],"limit":10},{"name":"dashboard-ingestion-health","subject":"Expose the current collection state for the global ingestion indicator.","objective":"Distinguish reported ingestion failure or recovery from the age of retained workflow evidence.","acceptance":"Use the authorized server collection-health classification, not cumulative failures or browser refresh time. Missing or unauthorized health remains unknown and static dashboards do not request this source.","from":"collection-health","select":[{"field":"configured"},{"field":"health"}],"limit":1},{"name":"dashboard-data-freshness","subject":"Find the newest workflow activity timestamp in retained canonical data.","objective":"Warn globally when the ingested workflow evidence has not advanced for 24 hours.","acceptance":"Use upstream updated-at, falling back to created-at, never browser import or refresh time. Missing or invalid timestamps remain unknown; inactivity alone does not prove an ingestion failure.","from":"runs","compute":[{"as":"data-at","function":"coalesce","args":[{"field":"updated-at"},{"field":"created-at"}]},{"as":"data-at-ms","function":"timestamp","args":[{"field":"data-at"}]}],"aggregate":{"values":[{"field":"data-at-ms","as":"latest-data-at","reducer":"max"}]}},{"name":"indexing-shards","subject":"List retained Activity shard import receipts.","objective":"Inspect which shards were ingested, when, and how many records they committed.","acceptance":"Show shard scope, phase, import status, import timestamp, counts and payload identity from retained receipts. Import time is not upstream freshness and missing receipts do not prove complete coverage.","from":"transactions","filter":{"predicates":[{"field":"kind","in":["ingest-normalized-jsonl","ingest-jsonl","ingest-jsonl-failed","runs","records"]}]},"select":[{"field":"id"},{"field":"payloadScope","as":"shard"},{"field":"kind"},{"field":"activity-status","as":"status"},{"field":"createdAt","as":"ingested-at"},{"field":"committedRecords","as":"committed-records"},{"field":"rawRuns","as":"workflow-runs"},{"field":"payloadHash","as":"payload-hash"}],"order-by":[{"field":"ingested-at","direction":"desc"}]},{"name":"ingestion-queued","subject":"Label the shared collection task queue depth for the administrator queue chart.","objective":"Identify total ready and scheduled collection work, including backfill tasks.","acceptance":"Show the observed shared queue depth only when collection is configured; missing or unauthorized health data is not zero pending work.","from":"collection-health","filter":{"predicates":[{"field":"configured","equals":true}]},"compute":[{"as":"queue","function":"coalesce","args":[{"value":"Ready and scheduled"},{"value":"Ready and scheduled"}]}],"select":[{"field":"queue"},{"field":"queue-depth","as":"tasks"}]},{"name":"ingestion-inflight","subject":"Label current in-flight collection tasks for the administrator queue chart.","objective":"Distinguish leased collection tasks from work awaiting collection.","acceptance":"Show the observed pending task count only when collection is configured; do not infer a count from an unavailable source.","from":"collection-health","filter":{"predicates":[{"field":"configured","equals":true}]},"compute":[{"as":"queue","function":"coalesce","args":[{"value":"In flight"},{"value":"In flight"}]}],"select":[{"field":"queue"},{"field":"pending-tasks","as":"tasks"}]},{"name":"ingestion-backfill","subject":"Label cumulative backfill run admissions for the administrator ingestion chart.","objective":"Compare historically admitted run tasks with current outstanding work without treating admissions as a live backlog.","acceptance":"Show the cumulative run task admissions only when collection is configured; this value does not decrease as tasks complete and missing health data does not imply completed backfill.","from":"collection-health","filter":{"predicates":[{"field":"configured","equals":true}]},"compute":[{"as":"queue","function":"coalesce","args":[{"value":"Backfill admitted (total)"},{"value":"Backfill admitted (total)"}]}],"select":[{"field":"queue"},{"field":"backfill-queued-run-tasks","as":"tasks"}]},{"name":"ingestion-queue-sizes","subject":"Compare current shared queue pressure, in-flight tasks, and cumulative historical backfill admissions from the administrator-only server snapshot.","objective":"Spot a growing backlog without treating past backfill admissions as outstanding work.","acceptance":"Current queue sizes and cumulative admissions come only from an authorized collection-health snapshot; unavailable state is not zero.","from":"ingestion-queued","union":["ingestion-inflight","ingestion-backfill"],"select":[{"field":"queue"},{"field":"tasks"}]},{"name":"ingestion-webhook-status","subject":"Inspect live webhook delivery counters for the current server process.","objective":"Distinguish signature validation, acknowledgements, rejections and failures without polling GitHub.","acceptance":"Show only authorized process-local counters, including in-flight requests, duplicate acknowledgements and signed pings. Counters reset on restart, are not replica totals, and do not establish GitHub-side webhook registration or completed collection. Refresh the active subscription even without canonical data changes.","from":"webhook-status","compute":[{"as":"configuration","function":"if","args":[{"field":"configured"},{"value":"Configured"},{"value":"Not configured"}]}],"limit":1},{"name":"ingestion-health","subject":"Show the current Redis-backed webhook and collection health snapshot.","objective":"Determine whether the reported collection, webhook, queue, and backfill state warrants inspecting ingestion diagnostics.","acceptance":"Report the observed health, queue, failure, success, and projection timestamps together; verify freshness and configuration before calling collection healthy, and treat missing state as unknown rather than zero.","from":"collection-health","select":[{"field":"configured"},{"field":"health"},{"field":"queue-depth"},{"field":"pending-tasks"},{"field":"dead-letters"},{"field":"oldest-pending-age"},{"field":"backfill"},{"field":"backfill-failures"},{"field":"backfill-queued-run-tasks"},{"field":"webhook-load"},{"field":"collection-load"},{"field":"failure-load"},{"field":"last-projected"},{"field":"last-webhook-at"},{"field":"last-failure-at"},{"field":"last-failure-code"},{"field":"last-success-at"},{"field":"webhook-received"},{"field":"webhook-duplicate"},{"field":"webhook-admission-failed"},{"field":"task-queued"},{"field":"task-coalesced"},{"field":"collection-succeeded"},{"field":"collection-failed"},{"field":"collection-retried"},{"field":"collection-dead-lettered"}]},{"name":"github-api-usage","subject":"Show retained GitHub API quota usage per bucket and in aggregate over the last 24 hours.","objective":"Determine whether any GitHub App installation or the CAO fleet as a whole is approaching its GitHub API rate limit.","acceptance":"Report peak usage percentages with their limits, used, and reserved counts; treat a slot without observations as unknown rather than idle, and never infer credentials from bucket identity.","from":"github-quota-usage","select":[{"field":"observed-at"},{"field":"scope"},{"field":"bucket"},{"field":"app"},{"field":"installation"},{"field":"resource"},{"field":"buckets"},{"field":"limit"},{"field":"used"},{"field":"reserved"},{"field":"usage-percent"}]},{"name":"marketplace-directory","subject":"Browse packages from configured marketplace registries.","objective":"Present a stable alphabetical directory that can be loaded in bounded pages.","acceptance":"Preserve resolver-produced provenance and package metadata. Order by package name and immutable source so continuation pages neither skip nor duplicate entries; discovery grants no installation authority.","from":"marketplace-packages","order-by":[{"field":"package-name","direction":"asc"},{"field":"package-source","direction":"asc"}]},{"name":"marketplace-package-detail","subject":"Expose normalized marketplace package records for source-coordinate lookup by the detail view.","objective":"Locate the resolver-produced package record for a source coordinate supplied by the consuming view.","acceptance":"Use the returned package-source, registry, ref, and resolved-commit fields when inspecting a matching record; the query itself does not filter by coordinate, and an absent match is not proof of package nonexistence or approval.","from":"marketplace-packages"},{"name":"friction-by-workflow","subject":"Rank workflows by observed gh-aw audit friction AI Credit totals for investigation.","objective":"Identify which repository and workflow combinations have the largest measured friction totals in retained observations.","acceptance":"Compare friction-aic and distinct runs with the underlying measurement states and attribution evidence; do not equate a ranking with avoidable cost or a validated saving.","description":"Total gh-aw audit friction cost grouped by repository and workflow.","from":"friction","compute":[{"as":"positive-aic","function":"greater-than","args":[{"field":"aic"},{"value":0}]},{"as":"repository-coordinate","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"}]},{"as":"workflow-coordinate","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"},{"value":":"},{"field":"workflow"}]}],"aggregate":{"by":["workflow-coordinate","repository-coordinate","workflow"],"values":[{"field":"aic","as":"friction-aic","reducer":"sum","filter":{"predicates":[{"field":"positive-aic","equals":true}]}},{"field":"run","as":"runs","reducer":"distinct-count"}]},"order-by":[{"field":"friction-aic","direction":"desc"},{"field":"workflow-coordinate","direction":"asc"}]},{"name":"friction-observations","subject":"List retained gh-aw audit friction measurements with their run context and attribution totals.","objective":"Trace each reported friction measurement to a run and distinguish counted, suppressed, and unattributed occurrences.","acceptance":"Preserve native AIC, total-run AIC, measurement state, timestamps, links, and occurrence counts; missing or unattributed evidence remains uncertain, not a verified opportunity for savings.","description":"Newest friction measurements first, preserving the native audit values and uncertainty state.","from":"friction","compute":[{"as":"repository-coordinate","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"}]},{"as":"friction-percent","function":"format-percent","args":[{"field":"friction-ratio"}]}],"select":[{"field":"event-timestamp","as":"observed-at"},{"field":"repository-coordinate"},{"field":"workflow"},{"field":"run"},{"field":"run-link"},{"field":"measurement-state"},{"field":"aic"},{"field":"total-run-aic"},{"field":"friction-percent"},{"field":"counted-occurrences"},{"field":"suppressed-occurrences"},{"field":"unattributed-occurrences"}],"order-by":[{"field":"observed-at","direction":"desc"},{"field":"run","direction":"desc"}]},{"name":"indexing-shard-dates","subject":"Read the activity date encoded in each retained transaction's shard filename.","objective":"Separate source shard dates from ingestion timestamps.","acceptance":"Keep every transaction and leave absent, invalid, or structural shard dates unknown; never substitute import time.","from":"transactions","compute":[{"as":"shard-day","function":"activity-shard-day","args":[{"field":"payloadScope"}]},{"as":"missing-shard-day","function":"equals-any","args":[{"field":"shard-day"},{"value":null}]}]},{"name":"indexing-shard-entry-counts","subject":"Count retained ingestion entries for each valid shard activity date.","objective":"Expose coincident ingestion density as circle area without changing individual run counts.","acceptance":"Count dated transaction identities across all kinds, including zero and unavailable run counts. This is retained ingestion evidence, not distinct runs, bytes, or upstream coverage.","from":"indexing-shard-dates","filter":{"predicates":[{"field":"missing-shard-day","equals":false}]},"aggregate":{"by":["shard-day"],"values":[{"field":"id","as":"shard-entry-count","reducer":"count"}]}},{"name":"indexing-ingestion-runs","subject":"Show retained ingestion transactions at the activity date encoded in their shard filename.","objective":"Compare reported run counts by source shard activity date, independently of import time, and expose coincident ingestion density.","acceptance":"Preserve all dated transactions without grouping, limits or page filters. Size by retained entries on the shard day, not distinct runs or coverage. Never substitute import time. Missing run counts remain labeled zero-position placeholders, not measured zeroes.","from":"indexing-shard-dates","joins":[{"source":"indexing-shard-entry-counts","type":"left","on":[{"left":"shard-day","right":"shard-day"}],"fields":[{"field":"shard-entry-count","as":"shard-entry-count"}]}],"filter":{"predicates":[{"field":"missing-shard-day","equals":false}]},"compute":[{"as":"workflow-runs","function":"coalesce","args":[{"field":"rawRuns"},{"value":0}]},{"as":"missing-run-count","function":"equals-any","args":[{"field":"rawRuns"},{"value":null}]},{"as":"run-count-status","function":"if","args":[{"field":"missing-run-count"},{"value":"Run count unavailable (shown at 0)"},{"value":"Reported run count"}]}],"select":[{"field":"id"},{"field":"kind"},{"field":"createdAt"},{"field":"shard-day"},{"field":"rawRuns"},{"field":"workflow-runs"},{"field":"shard-entry-count"},{"field":"run-count-status"}],"order-by":[{"field":"shard-day","direction":"asc"},{"field":"id","direction":"asc"}]},{"name":"indexing-daily-run-counts","subject":"Inspect admitted daily logical Run counts independently of retained detail and shard receipts.","objective":"Make the daily run-count projection visible as an ingestion diagnostic.","acceptance":"Sum daily buckets by observed UTC execution-start day across repositories and workflows, without page filters, detail fallback, fabricated days or zero populations. Preserve aggregate coverage and partial or unavailable evidence; counts do not prove upstream completeness.","from":"daily-run-counts","aggregate":{"by":["day"],"values":[{"field":"total","as":"runs","reducer":"sum"}]},"select":[{"field":"day","as":"date"},{"field":"runs"}],"order-by":[{"field":"date","direction":"asc"}]},{"name":"indexing-campaigns-table-count","subject":"Count retained campaigns rows in the dashboard database.","objective":"Provide the retained campaigns row count for the table-count diagnostic.","acceptance":"Label the result campaigns and count campaign rows in the current database; absence or zero does not establish completeness or expected campaign coverage.","from":"campaigns","compute":[{"as":"table","function":"literal","args":[{"value":"campaigns"}]}],"aggregate":{"by":["table"],"values":[{"field":"campaign","as":"records","reducer":"count"}]}},{"name":"indexing-repositories-table-count","subject":"Count retained repositories rows in the dashboard database.","objective":"Provide the retained repositories row count for the table-count diagnostic.","acceptance":"Label the result repositories and count repository rows in the current database; absence or zero does not establish completeness or expected repository coverage.","from":"repositories","compute":[{"as":"table","function":"literal","args":[{"value":"repositories"}]}],"aggregate":{"by":["table"],"values":[{"field":"repository","as":"records","reducer":"count"}]}},{"name":"indexing-workflows-table-count","subject":"Count retained workflows rows in the dashboard database.","objective":"Provide the retained workflows row count for the table-count diagnostic.","acceptance":"Label the result workflows and count workflow rows in the current database; absence or zero does not establish completeness or expected workflow coverage.","from":"workflows","compute":[{"as":"table","function":"literal","args":[{"value":"workflows"}]}],"aggregate":{"by":["table"],"values":[{"field":"workflow","as":"records","reducer":"count"}]}},{"name":"indexing-runs-table-count","subject":"Count retained workflow runs rows in the dashboard database.","objective":"Provide the retained workflow runs row count for the table-count diagnostic.","acceptance":"Label the result workflow runs and count run rows in the current database; absence or zero does not establish completeness or expected execution volume.","from":"runs","compute":[{"as":"table","function":"literal","args":[{"value":"runs"}]}],"aggregate":{"by":["table"],"values":[{"field":"run","as":"records","reducer":"count"}]}},{"name":"indexing-domains-table-count","subject":"Count retained network domains rows in the dashboard database.","objective":"Provide the retained network domains row count for the table-count diagnostic.","acceptance":"Label the result network domains and count domain event rows in the current database; absence or zero does not prove no network activity.","from":"domains","compute":[{"as":"table","function":"literal","args":[{"value":"domains"}]}],"aggregate":{"by":["table"],"values":[{"field":"event","as":"records","reducer":"count"}]}},{"name":"indexing-tools-table-count","subject":"Count retained tool events rows in the dashboard database.","objective":"Provide the retained tool events row count for the table-count diagnostic.","acceptance":"Label the result tool events and count tool event rows in the current database; absence or zero does not prove no tool use.","from":"tools","compute":[{"as":"table","function":"literal","args":[{"value":"tools"}]}],"aggregate":{"by":["table"],"values":[{"field":"table","as":"records","reducer":"count"}]}},{"name":"indexing-audits-table-count","subject":"Count retained audit events rows in the dashboard database.","objective":"Provide the retained audit events row count for the table-count diagnostic.","acceptance":"Label the result audit events and count audit event rows in the current database; absence or zero does not prove no audit findings.","from":"audits","compute":[{"as":"table","function":"literal","args":[{"value":"audits"}]}],"aggregate":{"by":["table"],"values":[{"field":"event","as":"records","reducer":"count"}]}},{"name":"indexing-issues-table-count","subject":"Count retained issue events rows in the dashboard database.","objective":"Provide the retained issue events row count for the table-count diagnostic.","acceptance":"Label the result issue events and count issue event rows in the current database; absence or zero does not prove no issues exist.","from":"issues","compute":[{"as":"table","function":"literal","args":[{"value":"issues"}]}],"aggregate":{"by":["table"],"values":[{"field":"event","as":"records","reducer":"count"}]}},{"name":"indexing-operational-values-table-count","subject":"Count retained operational values rows in the dashboard database.","objective":"Provide the retained operational values row count for the table-count diagnostic.","acceptance":"Label the result operational values and count operational-value rows in the current database; absence or zero does not imply zero value or an evaluated outcome.","from":"operational-values","compute":[{"as":"table","function":"literal","args":[{"value":"operationalValues"}]}],"aggregate":{"by":["table"],"values":[{"field":"operational-value","as":"records","reducer":"count"}]}},{"name":"indexing-transactions-table-count","subject":"Count retained ingestion transactions rows in the dashboard database.","objective":"Provide the retained ingestion transactions row count for the table-count diagnostic.","acceptance":"Label the result ingestion transactions and count transaction IDs in the current database; absence or zero does not establish whether upstream ingestion ran.","from":"transactions","compute":[{"as":"table","function":"literal","args":[{"value":"transactions"}]}],"aggregate":{"by":["table"],"values":[{"field":"id","as":"records","reducer":"count"}]}},{"name":"indexing-database-table-counts","subject":"Count retained canonical dashboard database rows by table.","objective":"Compare the retained table row counts to identify tables needing further ingestion or coverage investigation.","acceptance":"Union the named table-count projections and report their table labels and counts; check source availability, retention, and separate transaction evidence before interpreting an empty or small table as an ingestion defect.","from":"indexing-campaigns-table-count","union":["indexing-repositories-table-count","indexing-workflows-table-count","indexing-runs-table-count","indexing-domains-table-count","indexing-tools-table-count","indexing-audits-table-count","indexing-issues-table-count","indexing-operational-values-table-count","indexing-transactions-table-count"],"order-by":[{"field":"records","direction":"desc"},{"field":"table","direction":"asc"}]},{"name":"indexing-transactions","subject":"Prepare retained ingestion transactions for card presentation.","objective":"Expose transaction identity, kind, timestamp, committed-record count, and payload hash for ingestion traceability.","acceptance":"Projected fields match retained transactions without implying successful upstream coverage from a committed count or hash alone; missing transactions require a freshness and availability check.","from":"transactions","select":[{"field":"id"},{"field":"kind"},{"field":"createdAt","as":"created-at"},{"field":"committedRecords","as":"committed-records"},{"field":"payloadHash","as":"payload-hash"}]},{"name":"engines-models-sample-distribution","subject":"Describe agent and model combinations in the seven-day statistical run sample.","objective":"Find sampled combinations to investigate without scanning the full retained run history.","acceptance":"Count unweighted selected Runs after frame selection. Keep statistical-frame-id in grouped rows and frame metadata on empty results. Zero-allocation strata are not population zeros. Preserve unknown identifiers; failure reserves can alter composition. Never mix sample counts with exact usage or infer population shares.","description":"Unweighted composition of the seven-day statistical sample; not a population estimate. Failure outcomes may be oversampled.","from":"statistical-runs","compute":[{"as":"summary","function":"concat","args":[{"field":"agent-id"},{"value":" / "},{"field":"model-id"}]}],"aggregate":{"by":["summary","statistical-frame-id"],"values":[{"field":"run","as":"sampled-runs","reducer":"count"}]},"order-by":[{"field":"sampled-runs","direction":"desc"},{"field":"summary","direction":"asc"}]},{"name":"engines-models-usage","subject":"Summarize run-level AIC and token usage by agent and model identifiers without treating unavailable telemetry as zero.","objective":"Locate agent and model combinations whose observed per-run AIC or token usage merits checking against individual runs.","acceptance":"Report run counts and native minimum, mean, and maximum values only for reported metrics; inspect underlying runs for per-metric telemetry coverage and context before comparing combinations, and infer neither efficiency nor outcome value from usage alone.","description":"Observed workflow runs grouped by agent ID and model ID. AIC statistics use only positive-AIC runs; token statistics use runs that reported each token metric.","from":"runs","compute":[{"as":"summary","function":"concat","args":[{"field":"agent-id"},{"value":" / "},{"field":"model-id"}]},{"as":"positive-aic","function":"greater-than","args":[{"field":"aic-total"},{"value":0}]}],"aggregate":{"by":["summary"],"values":[{"field":"run","as":"runs","reducer":"count"},{"field":"aic-total","as":"minimum-aic-per-run","reducer":"min","filter":{"predicates":[{"field":"positive-aic","equals":true}]}},{"field":"aic-total","as":"average-aic-per-run","reducer":"mean","filter":{"predicates":[{"field":"positive-aic","equals":true}]}},{"field":"aic-total","as":"maximum-aic-per-run","reducer":"max","filter":{"predicates":[{"field":"positive-aic","equals":true}]}},{"field":"input-tokens","as":"minimum-input-tokens-per-run","reducer":"min"},{"field":"input-tokens","as":"average-input-tokens-per-run","reducer":"mean"},{"field":"input-tokens","as":"maximum-input-tokens-per-run","reducer":"max"},{"field":"output-tokens","as":"minimum-output-tokens-per-run","reducer":"min"},{"field":"output-tokens","as":"average-output-tokens-per-run","reducer":"mean"},{"field":"output-tokens","as":"maximum-output-tokens-per-run","reducer":"max"},{"field":"cache-read-tokens","as":"minimum-cache-read-tokens-per-run","reducer":"min"},{"field":"cache-read-tokens","as":"average-cache-read-tokens-per-run","reducer":"mean"},{"field":"cache-read-tokens","as":"maximum-cache-read-tokens-per-run","reducer":"max"},{"field":"cache-write-tokens","as":"minimum-cache-write-tokens-per-run","reducer":"min"},{"field":"cache-write-tokens","as":"average-cache-write-tokens-per-run","reducer":"mean"},{"field":"cache-write-tokens","as":"maximum-cache-write-tokens-per-run","reducer":"max"},{"field":"reasoning-tokens","as":"minimum-reasoning-tokens-per-run","reducer":"min"},{"field":"reasoning-tokens","as":"average-reasoning-tokens-per-run","reducer":"mean"},{"field":"reasoning-tokens","as":"maximum-reasoning-tokens-per-run","reducer":"max"}]},"select":[{"field":"summary"},{"field":"runs"},{"field":"average-aic-per-run"},{"field":"minimum-aic-per-run"},{"field":"maximum-aic-per-run"},{"field":"minimum-input-tokens-per-run"},{"field":"average-input-tokens-per-run"},{"field":"maximum-input-tokens-per-run"},{"field":"minimum-output-tokens-per-run"},{"field":"average-output-tokens-per-run"},{"field":"maximum-output-tokens-per-run"},{"field":"minimum-cache-read-tokens-per-run"},{"field":"average-cache-read-tokens-per-run"},{"field":"maximum-cache-read-tokens-per-run"},{"field":"minimum-cache-write-tokens-per-run"},{"field":"average-cache-write-tokens-per-run"},{"field":"maximum-cache-write-tokens-per-run"},{"field":"minimum-reasoning-tokens-per-run"},{"field":"average-reasoning-tokens-per-run"},{"field":"maximum-reasoning-tokens-per-run"}],"order-by":[{"field":"runs","direction":"desc"},{"field":"summary","direction":"asc"}]},{"name":"skill-invocations","subject":"Select observed skill invocations for skill usage analytics.","objective":"Expose skill event identity, scope, invocation counts, and failed counts for downstream usage analysis.","acceptance":"Keep each observed event and its repository/workflow attribution with native counts; missing records or failed counts alone do not establish whether a skill was useful or available.","from":"skills","select":[{"field":"event","as":"id"},{"field":"name","as":"skill"},{"field":"organization"},{"field":"repository"},{"field":"workflow"},{"field":"invocation-count"},{"field":"failed-count"}]},{"name":"skill-invocations-by-skill","subject":"Rank skills by their observed invocation count.","objective":"Identify skills with the highest observed invocation totals for follow-up inspection.","acceptance":"Sum observed invocation counts by skill and retain the rank as a usage description; do not equate popularity with effectiveness or infer unobserved invocations.","from":"skill-invocations","aggregate":{"by":["skill"],"values":[{"field":"invocation-count","as":"invocations","reducer":"sum"}]},"order-by":[{"field":"invocations","direction":"desc"},{"field":"skill","direction":"asc"}]},{"name":"skill-invocations-by-workflow-totals","subject":"Rank workflows by their observed skill invocation count.","objective":"Produce repository-scoped workflow invocation totals for downstream skill-usage comparison.","acceptance":"Sum observed invocation counts by organization, repository, and workflow; totals describe recorded usage only, not success or expected adoption.","from":"skill-invocations","aggregate":{"by":["organization","repository","workflow"],"values":[{"field":"invocation-count","as":"invocations","reducer":"sum"}]}},{"name":"skill-invocations-by-workflow","subject":"Present workflow skill invocation totals with drill-through navigation to the workflow dashboard.","objective":"Expose observed workflow skill invocation totals with a link to inspect each workflow.","acceptance":"Each projected workflow coordinate, link, and invocation total traces to the grouped source; using a link to investigate does not establish that usage caused an outcome.","from":"skill-invocations-by-workflow-totals","compute":[{"as":"workflow-coordinate","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"},{"value":":"},{"field":"workflow"}]},{"as":"encoded-workflow","function":"url-encode","args":[{"field":"workflow-coordinate"}]},{"as":"workflow-dashboard-href","function":"concat","args":[{"value":"#page-workflow-runtime?workflow="},{"field":"encoded-workflow"}]},{"as":"workflow-dashboard-label","function":"concat","args":[{"value":"View "},{"field":"workflow-coordinate"},{"value":" workflow dashboard"}]},{"as":"workflow-link","function":"dashboard-link","args":[{"value":""},{"field":"workflow-dashboard-href"},{"field":"workflow-dashboard-label"},{"field":"workflow-coordinate"}]}],"select":[{"field":"workflow-coordinate"},{"field":"workflow-link"},{"field":"invocations"}],"order-by":[{"field":"invocations","direction":"desc"},{"field":"workflow-coordinate","direction":"asc"}]},{"name":"skill-workflow-totals","subject":"Count observed invocations for each skill and workflow.","objective":"Produce skill-by-workflow invocation totals for the downstream inventory.","acceptance":"Sum observed invocation counts by skill, organization, repository, and workflow; missing combinations are not evidence that a skill could not run.","from":"skill-invocations","aggregate":{"by":["skill","organization","repository","workflow"],"values":[{"field":"invocation-count","as":"invocations","reducer":"sum"}]}},{"name":"skill-workflow-inventory","subject":"List observed skills by workflow with drill-through navigation to the workflow dashboard.","objective":"Identify observed skill/workflow combinations and provide a workflow link for inspecting their runs.","acceptance":"Show the repository, workflow, skill, link, and observed invocation total from the grouped evidence; an absent row does not prove non-use, and a high count does not prove effectiveness.","from":"skill-workflow-totals","compute":[{"as":"repository-coordinate","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"}]},{"as":"workflow-coordinate","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"},{"value":":"},{"field":"workflow"}]},{"as":"encoded-workflow","function":"url-encode","args":[{"field":"workflow-coordinate"}]},{"as":"workflow-dashboard-href","function":"concat","args":[{"value":"#page-workflow-runtime?workflow="},{"field":"encoded-workflow"}]},{"as":"workflow-dashboard-label","function":"concat","args":[{"value":"View "},{"field":"workflow-coordinate"},{"value":" workflow dashboard"}]},{"as":"workflow-link","function":"dashboard-link","args":[{"value":""},{"field":"workflow-dashboard-href"},{"field":"workflow-dashboard-label"},{"field":"workflow-coordinate"}]}],"select":[{"field":"skill"},{"field":"repository-coordinate"},{"field":"workflow"},{"field":"workflow-link"},{"field":"invocations"}],"order-by":[{"field":"invocations","direction":"desc"},{"field":"skill","direction":"asc"},{"field":"workflow","direction":"asc"}]},{"name":"experiment-assignment-coverage","subject":"Count observed run assignments for each experiment and workflow without inferring a completion target.","objective":"Expose assignment counts by experiment and workflow for investigating observed experiment coverage.","acceptance":"Count retained assignment rows in each experiment/workflow group, not distinct runs; do not invent a target, infer missing assignments from absent groups, or treat assignments as eval or grader outcomes.","from":"experiment-assignments","compute":[{"as":"workflow-coordinate","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"},{"value":":"},{"field":"workflow"}]}],"aggregate":{"by":["workflow-coordinate","experiment"],"values":[{"field":"run","as":"assignments","reducer":"count"}]}},{"name":"eval-status-ledger","subject":"Inspect every explicitly classified eval answer, including UNKNOWN.","objective":"Expose retained eval observations with their workflow, run evidence and observation time.","acceptance":"Keep recorded YES, NO and UNKNOWN answers distinct; unknown or absent evidence must not imply success or failure, and historical answers are not current verdicts or validated operational outcomes.","from":"eval-observations","compute":[{"as":"_recorded-run-href","function":"link-href","args":[{"field":"evidence-link"}]},{"as":"_eval-run-href","function":"coalesce","args":[{"field":"_recorded-run-href"},{"field":"evidence-link"}]},{"as":"run-link","function":"link","args":[{"field":"_eval-run-href"},{"field":"run"}]}],"filter":{"predicates":[{"field":"eval-result","in":["YES","NO","UNKNOWN"]}]}},{"name":"eval-answer-counts","subject":"Count recorded YES, NO and UNKNOWN answers for each workflow-scoped eval.","objective":"Provide complete answer denominators before expanding each eval into three bars.","acceptance":"Keep canonical eval identities separate and count only explicitly classified observations. Select at most 33 complete eval groups, never truncate an answer group.","from":"eval-status-ledger","aggregate":{"by":["organization","repository","workflow","eval"],"values":[{"field":"eval-result","as":"answers","reducer":"count"},{"field":"eval-result","as":"yes","reducer":"count","filter":{"predicates":[{"field":"eval-result","equals":"YES"}]}},{"field":"eval-result","as":"no","reducer":"count","filter":{"predicates":[{"field":"eval-result","equals":"NO"}]}},{"field":"eval-result","as":"unknown","reducer":"count","filter":{"predicates":[{"field":"eval-result","equals":"UNKNOWN"}]}}]},"order-by":[{"field":"eval","direction":"asc"},{"field":"organization","direction":"asc"},{"field":"repository","direction":"asc"},{"field":"workflow","direction":"asc"}],"limit":33},{"name":"eval-yes-shares","subject":"Compute the YES share of each eval's recorded answers.","objective":"Expose recorded YES proportions for comparing answer categories without inferring verified operational outcomes.","acceptance":"Emit one YES row per retained canonical eval group, including zero YES counts; answer-share is yes / answers across recorded YES, NO and UNKNOWN observations. Do not count absent observations.","from":"eval-answer-counts","compute":[{"as":"eval-result","function":"literal","args":[{"value":"YES"}]},{"as":"answer-order","function":"literal","args":[{"value":0}]},{"as":"answer-share","function":"quotient","args":[{"field":"yes"},{"field":"answers"}]}]},{"name":"eval-no-shares","subject":"Compute the NO share of each eval's recorded answers.","objective":"Expose recorded NO proportions for comparing answer categories without treating historical answers as current verdicts.","acceptance":"Emit one NO row per retained canonical eval group, including zero NO counts; answer-share is no / answers across recorded YES, NO and UNKNOWN observations. Do not count absent observations.","from":"eval-answer-counts","compute":[{"as":"eval-result","function":"literal","args":[{"value":"NO"}]},{"as":"answer-order","function":"literal","args":[{"value":1}]},{"as":"answer-share","function":"quotient","args":[{"field":"no"},{"field":"answers"}]}]},{"name":"eval-unknown-shares","subject":"Compute the explicit UNKNOWN share of each eval's recorded answers.","objective":"Expose explicitly recorded UNKNOWN proportions without conflating absent observations with classified uncertainty.","acceptance":"Emit one UNKNOWN row per retained canonical eval group, including zero UNKNOWN counts; answer-share is unknown / answers across recorded YES, NO and UNKNOWN observations. Missing observations are not UNKNOWN answers.","from":"eval-answer-counts","compute":[{"as":"eval-result","function":"literal","args":[{"value":"UNKNOWN"}]},{"as":"answer-order","function":"literal","args":[{"value":2}]},{"as":"answer-share","function":"quotient","args":[{"field":"unknown"},{"field":"answers"}]}]},{"name":"eval-answer-distribution","subject":"Compare YES, NO and UNKNOWN percentages within each eval.","objective":"Show three horizontal bars per eval that together account for all recorded answers.","acceptance":"Emit all three answer categories, including zero shares; percentages sum to 100 per canonical eval. Missing observations are not UNKNOWN answers. Preserve workflow and repository attribution.","from":"eval-yes-shares","union":["eval-no-shares","eval-unknown-shares"],"compute":[{"as":"answer-percent","function":"product","args":[{"field":"answer-share"},{"value":100}]},{"as":"eval-label","function":"concat","args":[{"field":"eval"},{"value":" | "},{"field":"organization"},{"value":"/"},{"field":"repository"},{"value":":"},{"field":"workflow"}]}],"order-by":[{"field":"eval-label","direction":"asc"},{"field":"answer-order","direction":"asc"}]},{"name":"grader-observed-maxima","subject":"Find each workflow-scoped grader's maximum retained value in the selected data.","objective":"Provide an observed normalization denominator without mixing grader identities or claiming a theoretical maximum.","acceptance":"Group by canonical grader identity, not display name; ignore missing values and preserve zero or negative maxima without substituting a denominator.","from":"grader-observations","aggregate":{"by":["grader-id"],"values":[{"field":"value","as":"max-grader-value","reducer":"max"}]}},{"name":"grader-normalized-observations","subject":"Normalize each grader observation by that grader's observed maximum.","objective":"Compare relative grader values over time while preserving native measurements and run provenance.","acceptance":"Compute value / max-grader-value without clamping or inverting lower-is-better measures; zero or missing denominators produce null, never a fabricated zero or infinity.","from":"grader-observations","joins":[{"source":"grader-observed-maxima","type":"left","on":[{"left":"grader-id","right":"grader-id"}],"fields":[{"field":"max-grader-value","as":"max-grader-value"}]}],"compute":[{"as":"normalized-value","function":"quotient","args":[{"field":"value"},{"field":"max-grader-value"}]},{"as":"_observation-time","function":"timestamp","args":[{"field":"observed-at"}]},{"as":"_unplottable-value","function":"equals-any","args":[{"field":"normalized-value"},{"value":null}]},{"as":"_unplottable-time","function":"equals-any","args":[{"field":"_observation-time"},{"value":null}]},{"as":"grader-series","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"},{"value":" / "},{"field":"workflow"},{"value":" / "},{"field":"grader"}]}]},{"name":"grader-value-scatter","subject":"Plot timed grader observations with a defined value-to-observed-maximum ratio.","objective":"Show relative grader measurements at their recorded observation times.","acceptance":"Keep each eligible observation and its run link; omit missing ratios or observation times from the plot while retaining those records in the native-value ledger. Ratios are not eval answers or evidence of improvement.","from":"grader-normalized-observations","filter":{"predicates":[{"field":"_unplottable-value","equals":false},{"field":"_unplottable-time","equals":false}]},"order-by":[{"field":"observed-at","direction":"asc"}]},{"name":"grader-status-ledger","subject":"Report grader measurements, units and explicit statuses without confusing them with binary eval answers.","objective":"Preserve numeric grader evidence and distinguish explicit per-observation pass and fail verdicts from unknown statuses.","acceptance":"Retain native grader values, units and statuses. Map only pass/passed to YES and fail/failed to NO in the auxiliary verdict field, leaving all other statuses unknown; never infer an eval answer, current success, causation or policy authority from a grader score.","from":"grader-observations","compute":[{"as":"is-pass","function":"equals-any","args":[{"field":"status"},{"value":"pass"},{"value":"passed"}]},{"as":"is-fail","function":"equals-any","args":[{"field":"status"},{"value":"fail"},{"value":"failed"}]},{"as":"non-pass-verdict","function":"if","args":[{"field":"is-fail"},{"value":"NO"},{"value":"unknown"}]},{"as":"verdict","function":"if","args":[{"field":"is-pass"},{"value":"YES"},{"field":"non-pass-verdict"}]}]},{"name":"routing-session-observations","subject":"Read metadata-only unified-session routing evidence.","objective":"Keep routing analytics independent of native logs and inferred run totals.","acceptance":"Only recognized session events contribute; event clocks remain absent when unrecorded.","from":"audits","filter":{"predicates":[{"field":"event-type","in":["session.format","workflow.info","workflow.job_result","agent.execution","firewall.model_routing","firewall.token_usage","usage.report","firewall.steering","firewall.upstream_error","model.config","model.baseline_estimate","model.resolution","model_routing.outcome","model_endpoint.mismatch","session.collection","session.collection_warning","subagent.request","subagent.started","subagent.configured","subagent.completed","subagent.failed","subagent.model_unavailable"]}]},"compute":[{"as":"record-clock","function":"timestamp","args":[{"field":"event-timestamp"}]},{"as":"event-clock","function":"coalesce","args":[{"field":"routing-session-clock"},{"field":"record-clock"}]},{"as":"routing-run-key","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"},{"value":":"},{"field":"run"}]},{"as":"agent-phase","function":"equals-any","args":[{"field":"phase"},{"value":"agent"}]},{"as":"proxy-selection","function":"equals-any","args":[{"field":"routing-stage"},{"value":"selection"}]},{"as":"proxy-failure","function":"equals-any","args":[{"field":"routing-stage"},{"value":"failure"}]},{"as":"has-agent-name","function":"greater-than","args":[{"field":"routing-agent-name"},{"value":""}]}]},{"name":"routing-session-attempts","from":"routing-session-observations","subject":"Identify available session files and their earliest recorded clocks.","objective":"Keep rerun attempts from multiplying routing denominators.","acceptance":"Attempt order is only a tie-breaker after the recorded session clock.","aggregate":{"by":["routing-run-key","run-attempt"],"values":[{"field":"event-clock","as":"session-clock","reducer":"min"}]}},{"name":"routing-session-order","from":"routing-session-attempts","subject":"Order duplicate run sessions by run time and attempt.","objective":"Keep the latest file for each repository/run identity.","acceptance":"Only one attempt contributes to routing facts.","window":[{"operation":"row-number","field":"run-attempt","as":"session-position","groupby":["routing-run-key"],"order-by":[{"field":"session-clock","direction":"desc"},{"field":"run-attempt","direction":"desc"}]}]},{"name":"routing-latest-sessions","from":"routing-session-order","subject":"Retain one authoritative session attempt per run.","objective":"Avoid mixing picks or accounting from reruns.","acceptance":"Duplicate attempts remain available in session coverage.","filter":{"predicates":[{"field":"session-position","equals":1}]}},{"name":"routing-session-events","from":"routing-session-observations","subject":"Read routing metadata from the latest session file per run.","objective":"Deduplicate rerun attempts before any metric.","acceptance":"Earlier attempts never add cost or change the selected pick.","joins":[{"source":"routing-latest-sessions","type":"inner","on":[{"left":"routing-run-key","right":"routing-run-key"},{"left":"run-attempt","right":"run-attempt"}],"fields":[{"field":"session-clock","as":"session-clock"}]}]},{"name":"routing-run-facts","subject":"Collect per-session source facts without interpreting absence as success.","objective":"Resolve routing states and coverage from runner and proxy evidence.","acceptance":"Agent-phase proxy selection wins over failure and harness status; untimed observations keep unknown time.","from":"routing-session-events","aggregate":{"by":["routing-run-key","organization","repository","workflow","run"],"values":[{"field":"event-clock","as":"run-clock","reducer":"min"},{"field":"run-link","as":"run-link","reducer":"unique"},{"field":"engine","as":"engine","reducer":"unique"},{"field":"event","as":"workflow-info-count","reducer":"count","filter":{"predicates":[{"field":"event-type","equals":"workflow.info"},{"field":"required","equals":true}]}},{"field":"event-status","as":"session-format","reducer":"unique","filter":{"predicates":[{"field":"event-type","equals":"session.format"}]}},{"field":"event","as":"selection-count","reducer":"count","filter":{"predicates":[{"field":"event-type","equals":"firewall.model_routing"},{"field":"routing-stage","equals":"selection"},{"field":"phase","equals":"agent"}]}},{"field":"event","as":"failure-count","reducer":"count","filter":{"predicates":[{"field":"event-type","equals":"firewall.model_routing"},{"field":"routing-stage","equals":"failure"},{"field":"phase","equals":"agent"}]}},{"field":"event","as":"local-effort-failures","reducer":"count","filter":{"predicates":[{"field":"event-type","equals":"firewall.model_routing"},{"field":"routing-stage","equals":"failure"},{"field":"code","equals":"unsupported_reasoning_effort"}]}},{"field":"event","as":"proxy-record-count","reducer":"count","filter":{"predicates":[{"field":"event-type","equals":"firewall.model_routing"},{"field":"phase","equals":"agent"}]}},{"field":"event","as":"agent-accounting-count","reducer":"count","filter":{"predicates":[{"field":"event-type","equals":"firewall.token_usage"},{"field":"phase","equals":"agent"}]}},{"field":"event","as":"subagent-count","reducer":"count","filter":{"predicates":[{"field":"event-type","in":["subagent.started","subagent.request","subagent.configured","subagent.completed","subagent.failed","subagent.model_unavailable"]}]}},{"field":"routing-status","as":"harness-status","reducer":"unique","filter":{"predicates":[{"field":"event-type","equals":"workflow.info"}]}},{"field":"routing-enabled","as":"configured-enabled","reducer":"unique","filter":{"predicates":[{"field":"event-type","equals":"model.config"}]}},{"field":"routing-selected-model","as":"harness-model","reducer":"unique","filter":{"predicates":[{"field":"event-type","equals":"workflow.info"}]}},{"field":"telemetry-model","as":"workflow-model","reducer":"unique","filter":{"predicates":[{"field":"event-type","equals":"workflow.info"}]}},{"field":"routing-selected-effort","as":"harness-effort","reducer":"unique","filter":{"predicates":[{"field":"event-type","equals":"workflow.info"}]}},{"field":"routing-mode","as":"harness-mode","reducer":"unique","filter":{"predicates":[{"field":"event-type","equals":"workflow.info"}]}},{"field":"routing-awf-version","as":"session-awf-version","reducer":"unique","filter":{"predicates":[{"field":"event-type","equals":"workflow.info"}]}},{"field":"routing-goal","as":"configured-goal","reducer":"unique","filter":{"predicates":[{"field":"event-type","equals":"model.config"}]}},{"field":"routing-configured-mode","as":"configured-routing-mode","reducer":"unique","filter":{"predicates":[{"field":"event-type","equals":"model.config"}]}},{"field":"routing-max-credits","as":"configured-max-credits","reducer":"unique","filter":{"predicates":[{"field":"event-type","equals":"model.config"}]}},{"field":"event-status","as":"agent-result","reducer":"unique","filter":{"predicates":[{"field":"event-type","equals":"workflow.job_result"},{"field":"name","equals":"agent"},{"field":"event-status","in":["success","failure","cancelled","skipped"]}]}},{"field":"event","as":"warnings","reducer":"count","filter":{"predicates":[{"field":"event-type","equals":"session.collection_warning"}]}}]}},{"name":"routing-ordered-selections","subject":"Order proxy selections within each session.","objective":"Use the last selection by normalized clock and file order.","acceptance":"Harness and advisory picks never override proxy selections.","from":"routing-session-events","filter":{"predicates":[{"field":"event-type","equals":"firewall.model_routing"},{"field":"routing-stage","equals":"selection"},{"field":"phase","equals":"agent"}]},"window":[{"operation":"row-number","field":"source-sequence","as":"selection-position","groupby":["routing-run-key"],"order-by":[{"field":"event-timestamp","direction":"desc"},{"field":"source-sequence","direction":"desc"}]}]},{"name":"routing-selections","subject":"Retain one authoritative proxy pick per run.","objective":"Avoid multiplying requests or run counts after re-selection.","acceptance":"One row per identified run uses the final proxy selection.","from":"routing-ordered-selections","filter":{"predicates":[{"field":"selection-position","equals":1}]}},{"name":"routing-resolved-runs","subject":"Resolve routing state, pick and label cells from unified sessions.","objective":"Distinguish selected, failed, harness-only, configured, inferred and unknown evidence.","acceptance":"Proxy evidence wins; configuration conflicts are visible; missing picks and time remain unknown.","from":"routing-run-facts","joins":[{"source":"routing-selections","type":"left","on":[{"left":"routing-run-key","right":"routing-run-key"}],"fields":[{"field":"routing-selected-model","as":"proxy-model"},{"field":"routing-selected-effort","as":"proxy-effort"},{"field":"routing-goal","as":"proxy-goal"},{"field":"routing-mode","as":"proxy-mode"},{"field":"routing-configured-mode","as":"proxy-configured-mode"},{"field":"routing-task-type","as":"routing-task-type"},{"field":"routing-scope","as":"routing-scope"},{"field":"routing-complexity","as":"routing-complexity"},{"field":"routing-latency-ms","as":"routing-latency-ms"},{"field":"routing-degraded","as":"routing-degraded"},{"field":"routing-classifier-attempts","as":"routing-classifier-attempts"},{"field":"routing-classifier-model","as":"routing-classifier-model"},{"field":"routing-classifier-effort","as":"routing-classifier-effort"},{"field":"routing-schema","as":"routing-schema"},{"field":"routing-awf-version","as":"proxy-awf-version"},{"field":"routing-router-version","as":"routing-router-version"}]}],"compute":[{"as":"observed-at","function":"iso-timestamp","args":[{"field":"run-clock"}]},{"as":"routing-awf-version","function":"coalesce","args":[{"field":"session-awf-version"},{"field":"proxy-awf-version"}]},{"as":"routing-mode","function":"coalesce","args":[{"field":"proxy-mode"},{"field":"harness-mode"}]},{"as":"routing-goal","function":"coalesce","args":[{"field":"proxy-goal"},{"field":"configured-goal"}]},{"as":"routing-configured-mode","function":"coalesce","args":[{"field":"proxy-configured-mode"},{"field":"configured-routing-mode"}]},{"as":"has-selection","function":"greater-than","args":[{"field":"selection-count"},{"value":0}]},{"as":"has-failure","function":"greater-than","args":[{"field":"failure-count"},{"value":0}]},{"as":"has-harness","function":"equals-any","args":[{"field":"harness-status"},{"value":null}]},{"as":"has-usage","function":"greater-than","args":[{"field":"agent-accounting-count"},{"value":0}]},{"as":"no-proxy","function":"equals-any","args":[{"field":"proxy-record-count"},{"value":0}]},{"as":"usage-state","function":"if","args":[{"field":"has-usage"},{"value":"unrouted_inferred"},{"value":"unknown"}]},{"as":"inferred-state","function":"if","args":[{"field":"no-proxy"},{"field":"usage-state"},{"value":"unknown"}]},{"as":"enabled","function":"equals-any","args":[{"field":"configured-enabled"},{"value":true}]},{"as":"disabled","function":"equals-any","args":[{"field":"configured-enabled"},{"value":false}]},{"as":"enabled-state","function":"if","args":[{"field":"enabled"},{"value":"configured_unrecorded"},{"field":"inferred-state"}]},{"as":"configured-state","function":"if","args":[{"field":"disabled"},{"value":"unrouted"},{"field":"enabled-state"}]},{"as":"reported-state","function":"if","args":[{"field":"has-harness"},{"field":"configured-state"},{"value":"harness_reported"}]},{"as":"failure-state","function":"if","args":[{"field":"has-failure"},{"value":"selection_failed"},{"field":"reported-state"}]},{"as":"routing-state","function":"if","args":[{"field":"has-selection"},{"value":"selected"},{"field":"failure-state"}]},{"as":"observed-pick-model","function":"if","args":[{"field":"has-selection"},{"field":"proxy-model"},{"field":"harness-model"}]},{"as":"observed-pick-effort","function":"if","args":[{"field":"has-selection"},{"field":"proxy-effort"},{"field":"harness-effort"}]},{"as":"pick-model","function":"coalesce","args":[{"field":"observed-pick-model"},{"value":"unknown"}]},{"as":"pick-effort","function":"coalesce","args":[{"field":"observed-pick-effort"},{"value":"unknown"}]},{"as":"pick","function":"concat","args":[{"field":"pick-model"},{"value":" / "},{"field":"pick-effort"}]},{"as":"has-proxy-decision","function":"if","args":[{"field":"has-selection"},{"value":true},{"field":"has-failure"}]},{"as":"has-decision","function":"if","args":[{"field":"has-harness"},{"field":"has-proxy-decision"},{"value":true}]},{"as":"configuration-conflict","function":"if","args":[{"field":"disabled"},{"field":"has-decision"},{"value":false}]},{"as":"unknown-pick-model","function":"equals-any","args":[{"field":"pick-model"},{"value":"unknown"}]},{"as":"unknown-pick-effort","function":"equals-any","args":[{"field":"pick-effort"},{"value":"unknown"}]},{"as":"unknown-pick","function":"if","args":[{"field":"unknown-pick-model"},{"value":true},{"field":"unknown-pick-effort"}]},{"as":"routing-key-encoded","function":"url-encode","args":[{"field":"routing-run-key"}]},{"as":"routing-href","function":"concat","args":[{"value":"#page-routing-run?routing-run="},{"field":"routing-key-encoded"}]},{"as":"routing-dashboard-link","function":"dashboard-link","args":[{"field":"run-link"},{"field":"routing-href"},{"field":"run"}]}],"filter":{"predicates":[{"field":"workflow-info-count","gte":1}]}},{"name":"routing-filter-candidates","from":"routing-aggregates","subject":"Apply one run-level scope before every routing metric and event join.","objective":"Filter complete sessions, never fragments of their evidence.","acceptance":"Unknown run time is excluded from a bounded range; blank filters retain all known values.","parameters":[{"name":"routing-filter-workflow","type":"string"},{"name":"routing-filter-repository","type":"string"},{"name":"routing-filter-engine","type":"string"},{"name":"routing-filter-state","type":"string"},{"name":"routing-filter-goal","type":"string"},{"name":"routing-filter-mode","type":"string"},{"name":"routing-filter-awf","type":"string"},{"name":"routing-filter-start","type":"string"},{"name":"routing-filter-end","type":"string"}],"compute":[{"as":"full-repository","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"}]},{"as":"all-workflows","function":"equals-any","args":[{"parameter":"routing-filter-workflow"},{"value":""}]},{"as":"same-workflow","function":"equals-any","args":[{"field":"workflow"},{"parameter":"routing-filter-workflow"}]},{"as":"include-workflow","function":"if","args":[{"field":"all-workflows"},{"value":true},{"field":"same-workflow"}]},{"as":"all-repositories","function":"equals-any","args":[{"parameter":"routing-filter-repository"},{"value":""}]},{"as":"same-repository","function":"equals-any","args":[{"field":"full-repository"},{"parameter":"routing-filter-repository"}]},{"as":"include-repository","function":"if","args":[{"field":"all-repositories"},{"value":true},{"field":"same-repository"}]},{"as":"all-engines","function":"equals-any","args":[{"parameter":"routing-filter-engine"},{"value":""}]},{"as":"same-engine","function":"equals-any","args":[{"field":"engine"},{"parameter":"routing-filter-engine"}]},{"as":"include-engine","function":"if","args":[{"field":"all-engines"},{"value":true},{"field":"same-engine"}]},{"as":"all-states","function":"equals-any","args":[{"parameter":"routing-filter-state"},{"value":""}]},{"as":"same-state","function":"equals-any","args":[{"field":"routing-state"},{"parameter":"routing-filter-state"}]},{"as":"include-state","function":"if","args":[{"field":"all-states"},{"value":true},{"field":"same-state"}]},{"as":"all-goals","function":"equals-any","args":[{"parameter":"routing-filter-goal"},{"value":""}]},{"as":"same-goal","function":"equals-any","args":[{"field":"routing-goal"},{"parameter":"routing-filter-goal"}]},{"as":"include-goal","function":"if","args":[{"field":"all-goals"},{"value":true},{"field":"same-goal"}]},{"as":"all-modes","function":"equals-any","args":[{"parameter":"routing-filter-mode"},{"value":""}]},{"as":"same-mode","function":"equals-any","args":[{"field":"routing-mode"},{"parameter":"routing-filter-mode"}]},{"as":"include-mode","function":"if","args":[{"field":"all-modes"},{"value":true},{"field":"same-mode"}]},{"as":"all-awf","function":"equals-any","args":[{"parameter":"routing-filter-awf"},{"value":""}]},{"as":"same-awf","function":"equals-any","args":[{"field":"routing-awf-version"},{"parameter":"routing-filter-awf"}]},{"as":"include-awf","function":"if","args":[{"field":"all-awf"},{"value":true},{"field":"same-awf"}]},{"as":"all-starts","function":"equals-any","args":[{"parameter":"routing-filter-start"},{"value":""}]},{"as":"start-clock","function":"timestamp","args":[{"parameter":"routing-filter-start"}]},{"as":"start-before","function":"difference","args":[{"field":"start-clock"},{"value":1}]},{"as":"after-start","function":"greater-than","args":[{"field":"run-clock"},{"field":"start-before"}]},{"as":"include-start","function":"if","args":[{"field":"all-starts"},{"value":true},{"field":"after-start"}]},{"as":"all-ends","function":"equals-any","args":[{"parameter":"routing-filter-end"},{"value":""}]},{"as":"end-clock","function":"timestamp","args":[{"parameter":"routing-filter-end"}]},{"as":"before-end","function":"greater-than","args":[{"field":"end-clock"},{"field":"run-clock"}]},{"as":"include-end","function":"if","args":[{"field":"all-ends"},{"value":true},{"field":"before-end"}]}]},{"name":"routing-runs","from":"routing-filter-candidates","subject":"Retain identified runs matching every selected routing filter.","objective":"Use the same population for adoption, accounting and outcomes.","acceptance":"A time bound excludes untimed runs and does not remove individual events from retained sessions.","filter":{"predicates":[{"field":"include-workflow","equals":true},{"field":"include-repository","equals":true},{"field":"include-engine","equals":true},{"field":"include-state","equals":true},{"field":"include-goal","equals":true},{"field":"include-mode","equals":true},{"field":"include-awf","equals":true},{"field":"include-start","equals":true},{"field":"include-end","equals":true}]}},{"name":"routing-events","from":"routing-session-events","subject":"Retain all evidence belonging to scoped identified runs.","objective":"Filter event metrics by the resolved run rather than by individual event clocks.","acceptance":"State, pick and accounting are computed before the scope is applied.","joins":[{"source":"routing-runs","type":"inner","on":[{"left":"routing-run-key","right":"routing-run-key"}],"fields":[{"field":"routing-state","as":"run-routing-state"}]}]},{"name":"routing-phase-sources","subject":"Choose one nonoverlapping accounting source per run and phase.","objective":"Prefer proxy token usage over usage reports.","acceptance":"Snapshot totals and cumulative totalAic never enter additive cost.","from":"routing-events","aggregate":{"by":["routing-run-key","phase"],"values":[{"field":"event","as":"proxy-usage-count","reducer":"count","filter":{"predicates":[{"field":"event-type","equals":"firewall.token_usage"}]}},{"field":"event","as":"report-usage-count","reducer":"count","filter":{"predicates":[{"field":"event-type","equals":"usage.report"}]}},{"field":"event","as":"proxy-source-count","reducer":"count","filter":{"predicates":[{"field":"event-type","equals":"session.collection"},{"field":"name","equals":"token-usage.jsonl"},{"field":"event-status","equals":"collected"}]}},{"field":"event","as":"report-source-count","reducer":"count","filter":{"predicates":[{"field":"event-type","equals":"session.collection"},{"field":"name","in":["agent_usage.json","usage.json","usage.jsonl","usage-report.jsonl"]},{"field":"event-status","equals":"collected"}]}}]}},{"name":"routing-accounting-candidates","subject":"Read nonoverlapping per-response accounting records.","objective":"Expose recorded credits and token classes without repricing unknown usage.","acceptance":"Each phase uses proxy accounting when present and usage.report otherwise; absent AIC is counted.","from":"routing-events","joins":[{"source":"routing-phase-sources","type":"left","on":[{"left":"routing-run-key","right":"routing-run-key"},{"left":"phase","right":"phase"}],"fields":[{"field":"proxy-usage-count","as":"proxy-usage-count"}]}],"compute":[{"as":"has-proxy-accounting","function":"greater-than","args":[{"field":"proxy-usage-count"},{"value":0}]},{"as":"accounting-identity","function":"coalesce","args":[{"field":"correlation-id"},{"field":"event"}]},{"as":"accounting-source","function":"if","args":[{"field":"has-proxy-accounting"},{"value":"firewall.token_usage"},{"value":"usage.report"}]},{"as":"selected-accounting","function":"equals-any","args":[{"field":"event-type"},{"field":"accounting-source"}]},{"as":"unknown-aic","function":"equals-any","args":[{"field":"aic"},{"value":null}]},{"as":"unknown-aic-count","function":"if","args":[{"field":"unknown-aic"},{"value":1},{"value":0}]}],"window":[{"operation":"row-number","field":"source-sequence","as":"accounting-position","groupby":["routing-run-key","phase","event-type","accounting-identity"],"order-by":[{"field":"event-timestamp","direction":"desc"},{"field":"source-sequence","direction":"desc"}]}]},{"name":"routing-accounting","subject":"Select the authoritative accounting source for each phase.","objective":"Exclude overlapping usage reports and snapshots.","acceptance":"Every accounting row contributes at most once.","from":"routing-accounting-candidates","filter":{"predicates":[{"field":"selected-accounting","equals":true},{"field":"accounting-position","equals":1},{"field":"phase","in":["agent","detection","evals"]}]}},{"name":"routing-request-candidates","subject":"Keep per-request routing decisions separate from accounting.","objective":"Join routed outcomes by run, phase and request ID.","acceptance":"Rejected requests establish local zero cost; other unmatched requests retain unknown cost.","from":"routing-events","filter":{"predicates":[{"field":"event-type","equals":"firewall.model_routing"},{"field":"routing-stage","equals":"request"}]},"compute":[{"as":"request-identity","function":"coalesce","args":[{"field":"correlation-id"},{"field":"event"}]}],"window":[{"operation":"row-number","field":"source-sequence","as":"request-position","groupby":["routing-run-key","phase","request-identity"],"order-by":[{"field":"event-timestamp","direction":"desc"},{"field":"source-sequence","direction":"desc"}]}]},{"name":"routing-request-records","from":"routing-request-candidates","subject":"Retain the latest record for each request identity.","objective":"Avoid duplicate request joins and overlapping totals.","acceptance":"Requests without IDs remain independent, not falsely correlated.","filter":{"predicates":[{"field":"request-position","equals":1}]}},{"name":"routing-subagent-candidates","subject":"Read engine-reported sub-agent request ownership.","objective":"Use exact request-ID ownership before falling back to unsplit traffic.","acceptance":"Only request identities can assign exact ownership; advisory outcomes never assign credits.","from":"routing-events","filter":{"predicates":[{"field":"event-type","equals":"subagent.request"}]},"compute":[{"as":"subagent-identity","function":"coalesce","args":[{"field":"correlation-id"},{"field":"event"}]}],"window":[{"operation":"row-number","field":"source-sequence","as":"subagent-position","groupby":["routing-run-key","phase","subagent-identity"],"order-by":[{"field":"event-timestamp","direction":"desc"},{"field":"source-sequence","direction":"desc"}]}]},{"name":"routing-subagent-requests","from":"routing-subagent-candidates","subject":"Retain one sub-agent observation per request identity.","objective":"Keep exact ownership joins unique.","acceptance":"Missing identities do not match unrelated requests.","filter":{"predicates":[{"field":"subagent-position","equals":1}]}},{"name":"routing-exact-accounting","subject":"Attribute each accounting record to exactly one traffic bucket.","objective":"Keep detection, evals, classifier, exact sub-agent, main, unsplit and unattributed credits distinct.","acceptance":"Detection and evals use phase, missing purpose is never agent by default, and snapshot credits are excluded.","from":"routing-accounting","joins":[{"source":"routing-request-records","type":"left","on":[{"left":"routing-run-key","right":"routing-run-key"},{"left":"phase","right":"phase"},{"left":"correlation-id","right":"correlation-id"}],"fields":[{"field":"event","as":"request-event"},{"field":"routing-routed","as":"request-routed"},{"field":"routing-deviations","as":"request-deviations"},{"field":"routing-outcome","as":"request-outcome"},{"field":"routing-requested-model","as":"request-model"},{"field":"routing-requested-effort","as":"request-effort"}]},{"source":"routing-subagent-requests","type":"left","on":[{"left":"routing-run-key","right":"routing-run-key"},{"left":"phase","right":"phase"},{"left":"correlation-id","right":"correlation-id"}],"fields":[{"field":"routing-agent-name","as":"exact-agent-name"}]},{"source":"routing-run-facts","type":"left","on":[{"left":"routing-run-key","right":"routing-run-key"}],"fields":[{"field":"subagent-count","as":"subagent-count"}]}],"compute":[{"as":"exact-owner","function":"coalesce","args":[{"field":"routing-agent-name"},{"field":"exact-agent-name"}]},{"as":"no-exact-owner","function":"equals-any","args":[{"field":"exact-owner"},{"value":null}]}]},{"name":"routing-correlation-usage-candidates","from":"routing-exact-accounting","subject":"Find accounting records without exact sub-agent ownership.","objective":"Correlate only fully recorded token quartets in file order.","acceptance":"Missing token classes never match by model alone.","filter":{"predicates":[{"field":"phase","equals":"agent"},{"field":"no-exact-owner","equals":true}]},"compute":[{"as":"token-quartet","function":"sum","args":[{"field":"input-tokens"},{"field":"output-tokens"},{"field":"cache-read-tokens"},{"field":"cache-write-tokens"}]},{"as":"is-classifier","function":"equals-any","args":[{"field":"routing-purpose"},{"value":"routing_classification"}]}]},{"name":"routing-correlation-usage","from":"routing-correlation-usage-candidates","subject":"Order unmatched accounting within model and token quartet.","objective":"Match each engine-reported request at most once.","acceptance":"Classifier, incomplete and already-exact requests are excluded.","filter":{"predicates":[{"field":"token-quartet","gte":0},{"field":"is-classifier","equals":false}]},"window":[{"operation":"row-number","field":"source-sequence","as":"correlation-position","groupby":["routing-run-key","telemetry-model","input-tokens","output-tokens","cache-read-tokens","cache-write-tokens"],"order-by":[{"field":"source-sequence","direction":"asc"}]}]},{"name":"routing-correlation-subagent-candidates","from":"routing-subagent-requests","subject":"Exclude engine requests already matched by proxy request ID.","objective":"Prevent exact and correlated ownership from claiming the same request.","acceptance":"Only engine requests with a complete quartet and a definition name can correlate.","joins":[{"source":"routing-accounting","type":"left","on":[{"left":"routing-run-key","right":"routing-run-key"},{"left":"phase","right":"phase"},{"left":"correlation-id","right":"correlation-id"}],"fields":[{"field":"event","as":"exact-accounting-event"}]}],"compute":[{"as":"token-quartet","function":"sum","args":[{"field":"input-tokens"},{"field":"output-tokens"},{"field":"cache-read-tokens"},{"field":"cache-write-tokens"}]}]},{"name":"routing-correlation-subagents","from":"routing-correlation-subagent-candidates","subject":"Order unmatched engine requests within each model/token quartet.","objective":"Produce deterministic one-to-one correlated ownership.","acceptance":"Correlation is labelled separately from exact evidence.","filter":{"predicates":[{"field":"exact-accounting-event","equals":null},{"field":"token-quartet","gte":0},{"field":"phase","equals":"agent"}]},"window":[{"operation":"row-number","field":"source-sequence","as":"correlation-position","groupby":["routing-run-key","telemetry-model","input-tokens","output-tokens","cache-read-tokens","cache-write-tokens"],"order-by":[{"field":"source-sequence","direction":"asc"}]}]},{"name":"routing-correlated-accounting","from":"routing-correlation-usage","subject":"Join proxy usage with unmatched engine requests by model, quartet and occurrence.","objective":"Use the spec's correlated sub-agent attribution without duplicating credits.","acceptance":"Each engine request and accounting record participates at most once.","joins":[{"source":"routing-correlation-subagents","type":"left","on":[{"left":"routing-run-key","right":"routing-run-key"},{"left":"telemetry-model","right":"telemetry-model"},{"left":"input-tokens","right":"input-tokens"},{"left":"output-tokens","right":"output-tokens"},{"left":"cache-read-tokens","right":"cache-read-tokens"},{"left":"cache-write-tokens","right":"cache-write-tokens"},{"left":"correlation-position","right":"correlation-position"}],"fields":[{"field":"routing-agent-name","as":"correlated-owner"}]}],"select":[{"field":"routing-run-key"},{"field":"event"},{"field":"correlated-owner"}]},{"name":"routing-attributed-accounting","from":"routing-exact-accounting","subject":"Assign every accounting record to exactly one exclusive bucket.","objective":"Keep exact and correlated sub-agent ownership distinct.","acceptance":"Phase wins over purpose; missing ownership remains unsplit or unattributed.","joins":[{"source":"routing-correlated-accounting","type":"left","on":[{"left":"routing-run-key","right":"routing-run-key"},{"left":"event","right":"event"}],"fields":[{"field":"correlated-owner","as":"correlated-owner"}]}],"compute":[{"as":"agent-name","function":"coalesce","args":[{"field":"exact-owner"},{"field":"correlated-owner"}]},{"as":"unknown-agent","function":"equals-any","args":[{"field":"agent-name"},{"value":null}]},{"as":"unknown-request","function":"equals-any","args":[{"field":"request-event"},{"value":null}]},{"as":"has-subagents","function":"greater-than","args":[{"field":"subagent-count"},{"value":0}]},{"as":"is-subagent-purpose","function":"equals-any","args":[{"field":"routing-purpose"},{"value":"subagent"}]},{"as":"is-agent-purpose","function":"equals-any","args":[{"field":"routing-purpose"},{"value":"agent"}]},{"as":"matched-bucket","function":"if","args":[{"field":"has-subagents"},{"value":"agent_unsplit"},{"value":"main_agent"}]},{"as":"request-bucket","function":"if","args":[{"field":"unknown-request"},{"value":"unattributed"},{"field":"matched-bucket"}]},{"as":"subagent-bucket","function":"if","args":[{"field":"is-subagent-purpose"},{"value":"agent_unsplit"},{"field":"request-bucket"}]},{"as":"purpose-bucket","function":"if","args":[{"field":"is-agent-purpose"},{"value":"main_agent"},{"field":"subagent-bucket"}]},{"as":"subagent-attribution","function":"if","args":[{"field":"no-exact-owner"},{"value":"subagent_correlated"},{"value":"subagent_exact"}]},{"as":"ownership-bucket","function":"if","args":[{"field":"unknown-agent"},{"field":"purpose-bucket"},{"field":"subagent-attribution"}]},{"as":"classifier","function":"equals-any","args":[{"field":"routing-purpose"},{"value":"routing_classification"}]},{"as":"classifier-bucket","function":"if","args":[{"field":"classifier"},{"value":"classifier"},{"field":"ownership-bucket"}]},{"as":"evals","function":"equals-any","args":[{"field":"phase"},{"value":"evals"}]},{"as":"phase-bucket","function":"if","args":[{"field":"evals"},{"value":"evals"},{"field":"classifier-bucket"}]},{"as":"detection","function":"equals-any","args":[{"field":"phase"},{"value":"detection"}]},{"as":"bucket","function":"if","args":[{"field":"detection"},{"value":"detection"},{"field":"phase-bucket"}]}]},{"name":"routing-joined-requests","subject":"Inspect per-request deviations and outcomes against proxy picks.","objective":"Keep requests without accounting visible and never invent a deviation cause.","acceptance":"Unmatched requests have unknown cost; each request retains its own requested and selected model.","from":"routing-request-records","joins":[{"source":"routing-accounting","type":"left","on":[{"left":"routing-run-key","right":"routing-run-key"},{"left":"phase","right":"phase"},{"left":"correlation-id","right":"correlation-id"}],"fields":[{"field":"aic","as":"accounted-aic"},{"field":"event","as":"accounting-event"}]}],"compute":[{"as":"missing-accounting","function":"equals-any","args":[{"field":"accounting-event"},{"value":null}]},{"as":"failed-request","function":"equals-any","args":[{"field":"routing-outcome"},{"value":"failed"}]},{"as":"failed-unaccounted","function":"if","args":[{"field":"missing-accounting"},{"field":"failed-request"},{"value":false}]}],"order-by":[{"field":"event-timestamp","direction":"desc"}]},{"name":"routing-unaccounted-failures","from":"routing-joined-requests","subject":"Count failed requests lacking accounting per run.","objective":"Recognize only unambiguous AWF-local effort failures.","acceptance":"A run-level effort failure cannot assign zero to multiple failed requests.","aggregate":{"by":["routing-run-key"],"values":[{"field":"event","as":"failed-unaccounted-count","reducer":"count","filter":{"predicates":[{"field":"failed-unaccounted","equals":true}]}}]}},{"name":"routing-deviations","from":"routing-joined-requests","subject":"Resolve explicit local zero costs and preserve all other unknown request costs.","objective":"Avoid partial-cost comparisons based on missing accounting.","acceptance":"Only guard rejection or an unambiguous local effort failure establishes zero AIC.","joins":[{"source":"routing-unaccounted-failures","type":"left","on":[{"left":"routing-run-key","right":"routing-run-key"}],"fields":[{"field":"failed-unaccounted-count","as":"failed-unaccounted-count"}]},{"source":"routing-run-facts","type":"left","on":[{"left":"routing-run-key","right":"routing-run-key"}],"fields":[{"field":"local-effort-failures","as":"local-effort-failures"}]}],"compute":[{"as":"only-unaccounted-failure","function":"equals-any","args":[{"field":"failed-unaccounted-count"},{"value":1}]},{"as":"has-local-failure","function":"greater-than","args":[{"field":"local-effort-failures"},{"value":0}]},{"as":"unambiguous-local-failure","function":"if","args":[{"field":"only-unaccounted-failure"},{"field":"has-local-failure"},{"value":false}]},{"as":"local-code","function":"equals-any","args":[{"field":"code"},{"value":"unsupported_reasoning_effort"}]},{"as":"local-evidence","function":"if","args":[{"field":"local-code"},{"value":true},{"field":"unambiguous-local-failure"}]},{"as":"local-failure","function":"if","args":[{"field":"failed-request"},{"field":"local-evidence"},{"value":false}]},{"as":"guard-rejection","function":"equals-any","args":[{"field":"routing-outcome"},{"value":"rejected"}]},{"as":"zero-local-cost","function":"if","args":[{"field":"guard-rejection"},{"value":true},{"field":"local-failure"}]},{"as":"local-cost","function":"if","args":[{"field":"zero-local-cost"},{"value":0},{"value":null}]},{"as":"request-aic","function":"coalesce","args":[{"field":"accounted-aic"},{"field":"local-cost"}]},{"as":"unknown-request-cost","function":"equals-any","args":[{"field":"request-aic"},{"value":null}]},{"as":"unknown-request-count","function":"if","args":[{"field":"unknown-request-cost"},{"value":1},{"value":0}]}]},{"name":"routing-phase-usage","from":"routing-accounting","subject":"Sum nonoverlapping accounting per run and phase.","objective":"Establish complete costs only with known response values.","acceptance":"Unknown response costs remain counted.","aggregate":{"by":["routing-run-key","phase"],"values":[{"field":"aic","as":"recorded-aic","reducer":"sum"},{"field":"aic","as":"known-responses","reducer":"count"},{"field":"unknown-aic-count","as":"unknown-responses","reducer":"sum"}]}},{"name":"routing-request-coverage","from":"routing-deviations","subject":"Count requests whose cost remains unknown.","objective":"Exclude incomplete runs from distribution comparisons.","acceptance":"Unmatched nonlocal requests cannot be treated as free.","aggregate":{"by":["routing-run-key","phase"],"values":[{"field":"unknown-request-count","as":"unknown-requests","reducer":"sum"}]}},{"name":"routing-phase-costs","from":"routing-phase-sources","subject":"Evaluate accounting completeness using collected source receipts and request joins.","objective":"Exclude partial costs from medians and comparisons.","acceptance":"A complete phase has its selected accounting source, no missing AIC and no unaccounted nonlocal requests.","joins":[{"source":"routing-phase-usage","type":"left","on":[{"left":"routing-run-key","right":"routing-run-key"},{"left":"phase","right":"phase"}],"fields":[{"field":"recorded-aic","as":"recorded-aic"},{"field":"unknown-responses","as":"unknown-responses"},{"field":"known-responses","as":"known-responses"}]},{"source":"routing-request-coverage","type":"left","on":[{"left":"routing-run-key","right":"routing-run-key"},{"left":"phase","right":"phase"}],"fields":[{"field":"unknown-requests","as":"unknown-requests"}]}],"compute":[{"as":"has-proxy","function":"greater-than","args":[{"field":"proxy-usage-count"},{"value":0}]},{"as":"has-report","function":"greater-than","args":[{"field":"report-usage-count"},{"value":0}]},{"as":"any-source-count","function":"sum","args":[{"field":"proxy-source-count"},{"field":"report-source-count"}]},{"as":"report-or-empty-source","function":"if","args":[{"field":"has-report"},{"field":"report-source-count"},{"field":"any-source-count"}]},{"as":"accounting-source-count","function":"if","args":[{"field":"has-proxy"},{"field":"proxy-source-count"},{"field":"report-or-empty-source"}]},{"as":"source-present","function":"greater-than","args":[{"field":"accounting-source-count"},{"value":0}]},{"as":"missing-responses","function":"coalesce","args":[{"field":"unknown-responses"},{"value":0}]},{"as":"missing-requests","function":"coalesce","args":[{"field":"unknown-requests"},{"value":0}]},{"as":"missing-count","function":"sum","args":[{"field":"missing-responses"},{"field":"missing-requests"}]},{"as":"all-values-known","function":"equals-any","args":[{"field":"missing-count"},{"value":0}]},{"as":"complete","function":"if","args":[{"field":"source-present"},{"field":"all-values-known"},{"value":false}]},{"as":"known-sum","function":"coalesce","args":[{"field":"recorded-aic"},{"value":0}]},{"as":"complete-aic","function":"if","args":[{"field":"complete"},{"field":"known-sum"},{"value":null}]}]},{"name":"routing-agent-costs","from":"routing-phase-costs","subject":"Select complete or explicitly partial agent-phase costs.","objective":"Keep detection and evals out of agent-phase comparisons.","acceptance":"Classifier remains part of agent-phase cost.","filter":{"predicates":[{"field":"phase","equals":"agent"}]}},{"name":"routing-detection-costs","from":"routing-phase-costs","subject":"Retain detection-phase cost completeness separately.","objective":"Do not count detection as classifier or agent traffic.","acceptance":"Missing detection evidence remains unknown, not zero.","filter":{"predicates":[{"field":"phase","equals":"detection"}]}},{"name":"routing-cost-runs","from":"routing-resolved-runs","subject":"Attach accounting completeness to identified routing runs.","objective":"Provide comparable costs only for complete runs.","acceptance":"An absent cost stays unknown and never inherits aggregate run AIC.","joins":[{"source":"routing-runs","type":"inner","on":[{"left":"routing-run-key","right":"routing-run-key"}],"fields":[{"field":"main-aic","as":"main-aic"},{"field":"baseline-model","as":"baseline-model"},{"field":"baseline-aic","as":"baseline-aic"},{"field":"baseline-complete","as":"baseline-complete"}]},{"source":"routing-agent-costs","type":"left","on":[{"left":"routing-run-key","right":"routing-run-key"}],"fields":[{"field":"complete-aic","as":"complete-aic"},{"field":"complete","as":"cost-complete"},{"field":"missing-count","as":"missing-cost-records"}]},{"source":"routing-detection-costs","type":"left","on":[{"left":"routing-run-key","right":"routing-run-key"}],"fields":[{"field":"complete-aic","as":"detection-aic"},{"field":"complete","as":"detection-complete"}]}],"compute":[{"as":"run-cost-complete","function":"if","args":[{"field":"cost-complete"},{"field":"detection-complete"},{"value":false}]},{"as":"run-aic","function":"sum","args":[{"field":"complete-aic"},{"field":"detection-aic"}]},{"as":"budget-use","function":"quotient","args":[{"field":"run-aic"},{"field":"configured-max-credits"}]}]},{"name":"routing-run-summary","from":"routing-runs","subject":"Keep the selected Run's compact routing and baseline evidence visible.","objective":"Preserve the comparison when shorter-lived Audit detail expires.","acceptance":"Retained aggregate costs and baseline evidence survive Audit expiry; absent phase details stay unknown.","joins":[{"source":"routing-cost-runs","type":"left","on":[{"left":"routing-run-key","right":"routing-run-key"}],"fields":[{"field":"cost-complete","as":"cost-complete"},{"field":"missing-cost-records","as":"missing-cost-records"},{"field":"detection-aic","as":"detection-aic"},{"field":"run-aic","as":"run-aic"},{"field":"budget-use","as":"budget-use"}]}]},{"name":"routing-weekly-cost-totals","from":"routing-runs","subject":"Summarize complete agent-phase costs by UTC ISO week and routing state.","objective":"Expose trends without including partial costs.","acceptance":"Untimed runs cannot enter time buckets.","filter":{"predicates":[{"field":"run-clock","gte":0}]},"compute":[{"as":"week","function":"date-bucket","args":[{"field":"observed-at"},{"value":"week"}]}],"aggregate":{"by":["week","routing-state"],"values":[{"field":"run","as":"runs","reducer":"count"},{"field":"complete-aic","as":"complete-runs","reducer":"count"},{"field":"complete-aic","as":"observed-median","reducer":"median"}]}},{"name":"routing-weekly-accounting-cost","from":"routing-weekly-cost-totals","subject":"Gate weekly medians by complete sample size.","objective":"Keep sparse weeks from implying meaningful cost trends.","acceptance":"Weeks below the configurable minimum display insufficient data.","parameters":[{"name":"minimum-sample","type":"number"}],"compute":[{"as":"cost-series","function":"concat","args":[{"value":"Agent-phase accounting: "},{"field":"routing-state"}]},{"as":"sample-floor","function":"difference","args":[{"parameter":"minimum-sample"},{"value":1}]},{"as":"enough-samples","function":"greater-than","args":[{"field":"complete-runs"},{"field":"sample-floor"}]},{"as":"median-aic","function":"if","args":[{"field":"enough-samples"},{"field":"observed-median"},{"value":null}]},{"as":"sample-status","function":"if","args":[{"field":"enough-samples"},{"value":"observational"},{"value":"insufficient data"}]}],"order-by":[{"field":"week","direction":"asc"}]},{"name":"routing-resolutions","from":"routing-session-events","subject":"Read runner-written configured-model resolutions for scoped routing runs.","objective":"Explain what each workflow role's configured model resolved to before the engine launched.","acceptance":"Only model.resolution facts from latest scoped attempts contribute; missing or unsafe values and failed null resolutions remain unknown.","joins":[{"source":"routing-runs","type":"inner","on":[{"left":"routing-run-key","right":"routing-run-key"}],"fields":[{"field":"run-clock","as":"run-clock"},{"field":"observed-at","as":"run-observed-at"},{"field":"full-repository","as":"full-repository"},{"field":"routing-dashboard-link","as":"routing-dashboard-link"},{"field":"routing-state","as":"run-routing-state"}]}],"filter":{"predicates":[{"field":"event-type","equals":"model.resolution"}]},"compute":[{"as":"resolution-engine","function":"coalesce","args":[{"field":"telemetry-engine"},{"value":"unknown"}]},{"as":"resolution-role-label","function":"coalesce","args":[{"field":"resolution-role"},{"value":"unknown"}]},{"as":"configured-model","function":"coalesce","args":[{"field":"resolution-configured-model"},{"value":"unknown"}]},{"as":"resolved-model-label","function":"coalesce","args":[{"field":"resolution-resolved-model"},{"value":"unknown"}]},{"as":"resolution-provider","function":"coalesce","args":[{"field":"provider"},{"value":"unknown"}]},{"as":"resolution-status","function":"coalesce","args":[{"field":"event-status"},{"value":"unknown"}]},{"as":"failed-resolution","function":"equals-any","args":[{"field":"event-status"},{"value":"failed"}]},{"as":"failure-cause","function":"coalesce","args":[{"field":"code"},{"value":"unknown"}]},{"as":"resolution-cause","function":"if","args":[{"field":"failed-resolution"},{"field":"failure-cause"},{"field":"code"}]},{"as":"unknown-resolved-model","function":"equals-any","args":[{"field":"resolution-resolved-model"},{"value":null}]},{"as":"untimed","function":"equals-any","args":[{"field":"run-clock"},{"value":null}]},{"as":"configured-to-resolved","function":"concat","args":[{"field":"configured-model"},{"value":" → "},{"field":"resolved-model-label"}]},{"as":"workflow-key","function":"concat","args":[{"field":"full-repository"},{"value":":"},{"field":"workflow"}]},{"as":"resolution-actor","function":"concat","args":[{"field":"resolution-engine"},{"value":"/"},{"field":"resolution-role-label"},{"value":"/"},{"field":"resolution-provider"}]},{"as":"resolution-series","function":"concat","args":[{"field":"workflow-key"},{"value":" | "},{"field":"resolution-actor"},{"value":" | "},{"field":"configured-model"}]}]},{"name":"routing-health-totals","from":"routing-runs","subject":"Count routed runs and their selection, failure, adherence, outcome and cost evidence per repository and workflow.","objective":"Answer whether routing is on and working from one row per routed workflow.","acceptance":"Only selected, selection_failed, harness_reported and configured_unrecorded runs contribute; runs without evidence stay out of each denominator.","filter":{"predicates":[{"field":"routing-state","in":["selected","selection_failed","harness_reported","configured_unrecorded"]}]},"compute":[{"as":"has-routing-failure","function":"greater-than","args":[{"field":"failure-count"},{"value":0}]},{"as":"failure-or-fallback","function":"if","args":[{"field":"has-routing-failure"},{"value":true},{"field":"routing-degraded"}]},{"as":"adherence-known","function":"greater-than","args":[{"field":"flagged-requests"},{"value":0}]},{"as":"no-deviation","function":"equals-any","args":[{"field":"deviated-requests"},{"value":0}]}],"aggregate":{"by":["full-repository","workflow","baseline-model"],"values":[{"field":"paired-main-aic","as":"paired-main-aic","reducer":"sum"},{"field":"paired-baseline-aic","as":"paired-baseline-aic","reducer":"sum"},{"field":"run","as":"routed-runs","reducer":"count"},{"field":"run","as":"selected-runs","reducer":"count","filter":{"predicates":[{"field":"routing-state","equals":"selected"}]}},{"field":"run","as":"failure-runs","reducer":"count","filter":{"predicates":[{"field":"failure-or-fallback","equals":true}]}},{"field":"run","as":"adherence-known-runs","reducer":"count","filter":{"predicates":[{"field":"adherence-known","equals":true}]}},{"field":"run","as":"followed-runs","reducer":"count","filter":{"predicates":[{"field":"adherence-known","equals":true},{"field":"no-deviation","equals":true}]}},{"field":"agent-result","as":"known-outcomes","reducer":"count"},{"field":"run","as":"successes","reducer":"count","filter":{"predicates":[{"field":"agent-result","equals":"success"}]}},{"field":"complete-aic","as":"complete-runs","reducer":"count"},{"field":"complete-aic","as":"median-aic","reducer":"median"}]}},{"name":"routing-health","subject":"Show routing health shares per repository and workflow.","objective":"Tell whether routing is on and working from selection, failure or fallback, pick adherence, known outcomes and complete cost.","acceptance":"A zero denominator or no complete cost is unknown, never zero; unknown job outcomes are excluded from the success rate.","from":"routing-health-totals","compute":[{"as":"estimated-cost-vs-baseline","function":"quotient","args":[{"field":"paired-main-aic"},{"field":"paired-baseline-aic"}]},{"as":"estimated-cost-percent","function":"format-percent","args":[{"field":"estimated-cost-vs-baseline"}]},{"as":"selected-share","function":"quotient","args":[{"field":"selected-runs"},{"field":"routed-runs"}]},{"as":"failure-share","function":"quotient","args":[{"field":"failure-runs"},{"field":"routed-runs"}]},{"as":"followed-share","function":"quotient","args":[{"field":"followed-runs"},{"field":"adherence-known-runs"}]},{"as":"success-rate","function":"quotient","args":[{"field":"successes"},{"field":"known-outcomes"}]},{"as":"selected-percent","function":"format-percent","args":[{"field":"selected-share"}]},{"as":"failure-percent","function":"format-percent","args":[{"field":"failure-share"}]},{"as":"followed-percent","function":"format-percent","args":[{"field":"followed-share"}]},{"as":"success-percent","function":"format-percent","args":[{"field":"success-rate"}]}],"order-by":[{"field":"routed-runs","direction":"desc"},{"field":"full-repository","direction":"asc"},{"field":"workflow","direction":"asc"}]},{"name":"routing-weekly-models","from":"routing-runs","subject":"Count proxy-selected runs by UTC ISO week and picked model.","objective":"Show what the router chooses over time.","acceptance":"Only selected runs with a known pick model and a recorded run clock contribute; an unrecorded effort does not exclude a run.","filter":{"predicates":[{"field":"routing-state","equals":"selected"},{"field":"unknown-pick-model","equals":false},{"field":"run-clock","gte":0}]},"compute":[{"as":"week","function":"date-bucket","args":[{"field":"observed-at"},{"value":"week"}]}],"aggregate":{"by":["week","pick-model"],"values":[{"field":"run","as":"runs","reducer":"count"}]},"order-by":[{"field":"week","direction":"asc"},{"field":"pick-model","direction":"asc"}]},{"name":"routing-weekly-paired-totals","from":"routing-runs","subject":"Weekly paired complete main-request costs by baseline model.","objective":"Compare routing cost trends with each named baseline using identical main-request populations.","acceptance":"Only timed runs with complete positive baseline estimates and matching known main-request costs contribute to both medians.","filter":{"predicates":[{"field":"paired","equals":true},{"field":"run-clock","gte":0}]},"compute":[{"as":"week","function":"date-bucket","args":[{"field":"observed-at"},{"value":"week"}]}],"aggregate":{"by":["week","baseline-model"],"values":[{"field":"run","as":"complete-runs","reducer":"count"},{"field":"paired-main-aic","as":"observed-main-median","reducer":"median"},{"field":"paired-baseline-aic","as":"baseline-estimate-median","reducer":"median"}]}},{"name":"routing-weekly-paired-cost","from":"routing-weekly-paired-totals","subject":"Paired main-request samples that meet the chosen evidence floor.","objective":"Avoid changing routing policy based on insufficient paired evidence.","acceptance":"Observed and estimated series share the same complete-run count and configurable minimum sample.","parameters":[{"name":"minimum-sample","type":"number"}],"compute":[{"as":"sample-floor","function":"difference","args":[{"parameter":"minimum-sample"},{"value":1}]},{"as":"enough-samples","function":"greater-than","args":[{"field":"complete-runs"},{"field":"sample-floor"}]}]},{"name":"routing-weekly-main-observed","from":"routing-weekly-paired-cost","subject":"Observed main-request AIC for the same eligible runs as each baseline.","objective":"Identify weeks when routed main-request costs exceed the matching baseline estimate.","acceptance":"Observed medians exclude classifier and sub-agent costs and remain unknown below the paired sample floor.","compute":[{"as":"cost-series","function":"concat","args":[{"value":"Main requests observed (baseline: "},{"field":"baseline-model"},{"value":")"}]},{"as":"median-aic","function":"if","args":[{"field":"enough-samples"},{"field":"observed-main-median"},{"value":null}]}]},{"name":"routing-weekly-baseline-estimate","from":"routing-weekly-paired-cost","subject":"Explicitly estimated baseline AIC for paired main-agent requests.","objective":"Show the named counterfactual against which owners can assess routing goal or mode.","acceptance":"The series is labelled estimated, separates baseline models and uses exactly the observed series' eligible runs.","compute":[{"as":"cost-series","function":"concat","args":[{"value":"Baseline estimate (estimated, main requests): "},{"field":"baseline-model"}]},{"as":"median-aic","function":"if","args":[{"field":"enough-samples"},{"field":"baseline-estimate-median"},{"value":null}]}]},{"name":"routing-weekly-cost","from":"routing-weekly-accounting-cost","union":["routing-weekly-main-observed","routing-weekly-baseline-estimate"],"subject":"Compare the same main-agent requests to an explicitly estimated baseline.","objective":"Change routing goal or mode when paired observed cost exceeds the named baseline.","acceptance":"Keep agent-phase accounting separate, baseline models distinct and sparse weeks as gaps.","order-by":[{"field":"week","direction":"asc"},{"field":"cost-series","direction":"asc"}]},{"name":"routing-failure-problems","from":"routing-runs","subject":"Runs whose routing failure codes require investigation.","objective":"Investigate routing configuration or execution failures before changing rollout.","acceptance":"Emit one row per run with recorded routing failure identifiers, excluding upstream errors handled by their own kind.","filter":{"predicates":[{"field":"routing-failure-codes","gte":""}]},"compute":[{"as":"problem-kind","function":"literal","args":[{"value":"routing failure"}]},{"as":"problem-cause","function":"coalesce","args":[{"field":"routing-failure-codes"},{"value":null}]}],"select":[{"field":"routing-run-key"},{"field":"problem-kind"},{"field":"problem-cause"}]},{"name":"routing-deviation-problems","from":"routing-runs","subject":"Runs whose requests deviated from the routing pick.","objective":"Investigate why requests did not follow the selected model or effort.","acceptance":"Emit one row per run with distinct recorded deviation causes, without inferring causes from model names.","filter":{"predicates":[{"field":"routing-deviation-codes","gte":""}]},"compute":[{"as":"problem-kind","function":"literal","args":[{"value":"deviation"}]},{"as":"problem-cause","function":"coalesce","args":[{"field":"routing-deviation-codes"},{"value":null}]}],"select":[{"field":"routing-run-key"},{"field":"problem-kind"},{"field":"problem-cause"}]},{"name":"routing-resolution-problems","from":"routing-runs","subject":"Runs whose configured models could not be resolved.","objective":"Correct model aliases or restore catalogue availability for failed resolutions.","acceptance":"Emit one row per run with recorded resolution failure causes, not absence of resolution evidence.","filter":{"predicates":[{"field":"routing-resolution-codes","gte":""}]},"compute":[{"as":"problem-kind","function":"literal","args":[{"value":"resolution failure"}]},{"as":"problem-cause","function":"coalesce","args":[{"field":"routing-resolution-codes"},{"value":null}]}],"select":[{"field":"routing-run-key"},{"field":"problem-kind"},{"field":"problem-cause"}]},{"name":"routing-upstream-problems","from":"routing-runs","subject":"Provider-rejected requests with distinct upstream error codes.","objective":"Correct model or effort settings rejected by the provider.","acceptance":"Emit one upstream-error row per run with distinct safe codes or unknown, never a duplicate generic routing failure.","filter":{"predicates":[{"field":"routing-upstream-codes","gte":""}]},"compute":[{"as":"problem-kind","function":"literal","args":[{"value":"upstream error"}]},{"as":"problem-cause","function":"coalesce","args":[{"field":"routing-upstream-codes"},{"value":null}]}],"select":[{"field":"routing-run-key"},{"field":"problem-kind"},{"field":"problem-cause"}]},{"name":"routing-candidate-problems","from":"routing-runs","subject":"Runs whose full eligible pool contains choices the router cannot rank.","objective":"Review allowed models when the router cannot rank the complete eligible pool.","acceptance":"Emit one row only when both pool counters are known and overlap is below eligibility, displaying the observed ratio.","filter":{"predicates":[{"field":"candidate-coverage","gte":""}]},"compute":[{"as":"problem-kind","function":"literal","args":[{"value":"candidates not rankable"}]},{"as":"problem-cause","function":"coalesce","args":[{"field":"candidate-coverage"},{"value":null}]}],"select":[{"field":"routing-run-key"},{"field":"problem-kind"},{"field":"problem-cause"}]},{"name":"routing-problems","from":"routing-failure-problems","union":["routing-deviation-problems","routing-resolution-problems","routing-upstream-problems","routing-candidate-problems"],"subject":"List routing failures, deviations and resolution failures with one row per run and kind.","objective":"Show what needs attention and link each problem to its run page.","acceptance":"Time is the run's recorded observation time and stays unknown without a run clock; untimed rows sort after timed rows.","joins":[{"source":"routing-runs","type":"inner","on":[{"left":"routing-run-key","right":"routing-run-key"}],"fields":[{"field":"run","as":"run"},{"field":"full-repository","as":"full-repository"},{"field":"workflow","as":"workflow"},{"field":"run-clock","as":"run-clock"},{"field":"observed-at","as":"observed-at"},{"field":"routing-dashboard-link","as":"routing-dashboard-link"}]}],"compute":[{"as":"untimed","function":"equals-any","args":[{"field":"run-clock"},{"value":null}]}],"order-by":[{"field":"untimed","direction":"asc"},{"field":"run-clock","direction":"desc"},{"field":"run","direction":"desc"},{"field":"problem-kind","direction":"asc"}]},{"name":"simulator-database-inputs","subject":"Model daily run volume and 30-day retained detail from user-supplied scenario inputs.","objective":"Compare hypothetical workload choices without treating results as observed activity.","acceptance":"Each simulated day uses the selected inputs; skipped runs retain summaries and detailed records have a 30-day lifetime.","description":"Each simulated day includes all accumulated run summaries; tools and issues belong only to non-skipped runs and expire after 30 days.","from":"simulation-days","parameters":[{"name":"repositories","type":"number"},{"name":"runs-per-day","type":"number"},{"name":"tools-per-run","type":"number"},{"name":"issues-per-run","type":"number"},{"name":"skip-rate","type":"number"}],"compute":[{"as":"runs-daily","function":"product","args":[{"parameter":"repositories"},{"parameter":"runs-per-day"}]},{"as":"skip-fraction","function":"quotient","args":[{"parameter":"skip-rate"},{"value":100}]},{"as":"active-fraction","function":"difference","args":[{"value":1},{"field":"skip-fraction"}]},{"as":"summary-runs","function":"product","args":[{"field":"day"},{"field":"runs-daily"}]},{"as":"past-ttl","function":"greater-than","args":[{"field":"day"},{"value":30}]},{"as":"detail-days","function":"if","args":[{"field":"past-ttl"},{"value":30},{"field":"day"}]},{"as":"detail-runs","function":"product","args":[{"field":"detail-days"},{"field":"runs-daily"},{"field":"active-fraction"}]},{"as":"tools-per-run","function":"literal","args":[{"parameter":"tools-per-run"}]},{"as":"issues-per-run","function":"literal","args":[{"parameter":"issues-per-run"}]}]},{"name":"simulator-run-size","subject":"Estimate retained run-summary table size at 512 bytes per run.","objective":"Show modeled accumulation of run summaries.","acceptance":"Summary size includes every simulated run at 512 bytes and is not presented as measured storage.","from":"simulator-database-inputs","compute":[{"as":"table","function":"literal","args":[{"value":"Run summaries"}]},{"as":"bytes","function":"product","args":[{"field":"summary-runs"},{"value":512}]}],"select":[{"field":"day"},{"field":"table"},{"field":"bytes"}]},{"name":"simulator-tool-size","subject":"Estimate retained tool table size at 256 bytes per tool on non-skipped runs.","objective":"Show modeled tool-record growth under the selected workload.","acceptance":"Tool size uses only non-skipped simulated runs and 256 bytes per tool over the retained period.","from":"simulator-database-inputs","compute":[{"as":"table","function":"literal","args":[{"value":"Tools (30-day TTL)"}]},{"as":"bytes","function":"product","args":[{"field":"detail-runs"},{"field":"tools-per-run"},{"value":256}]}],"select":[{"field":"day"},{"field":"table"},{"field":"bytes"}]},{"name":"simulator-issue-size","subject":"Estimate retained issue table size at 512 bytes per issue on non-skipped runs.","objective":"Show modeled issue-record growth under the selected workload.","acceptance":"Issue size uses only non-skipped simulated runs and 512 bytes per issue over the retained period.","from":"simulator-database-inputs","compute":[{"as":"table","function":"literal","args":[{"value":"Issues (30-day TTL)"}]},{"as":"bytes","function":"product","args":[{"field":"detail-runs"},{"field":"issues-per-run"},{"value":512}]}],"select":[{"field":"day"},{"field":"table"},{"field":"bytes"}]},{"name":"simulator-database-size","subject":"Show modeled run-summary, tool, and issue table bytes after 30 days.","objective":"Compare hypothetical database table sizes at the end of the retention horizon.","acceptance":"The model presents separate summary, tool, and issue estimates after 30 simulated days, never observed storage.","description":"Run summaries accumulate; detailed records have a 30-day TTL.","from":"simulator-run-size","union":["simulator-tool-size","simulator-issue-size"],"filter":{"predicates":[{"field":"day","equals":30}]},"select":[{"field":"table"},{"field":"bytes"}]},{"name":"simulator-database-total","subject":"Sum the modeled table sizes after 30 days.","objective":"Show the final estimated size of the modeled database tables.","acceptance":"The final value is the sum of the three modeled table sizes after 30 days.","from":"simulator-database-size","compute":[{"as":"total-label","function":"literal","args":[{"value":"Total"}]}],"aggregate":{"by":["total-label"],"values":[{"field":"bytes","as":"bytes","reducer":"sum"}]},"select":[{"field":"total-label","as":"table"},{"field":"bytes"}]},{"name":"simulator-database-summary","subject":"List modeled table sizes and their final total after 30 days.","objective":"Present the 30-day estimate in a compact table.","acceptance":"Three modeled table sizes and their summed final value are shown without a growth chart.","from":"simulator-database-size","union":["simulator-database-total"]},{"name":"simulator-pr-inputs","subject":"Model company PR volume, AW fan-out and AI Credits from editable assumptions.","objective":"Compare hypothetical company sizes without launching workflows or claiming measured capacity.","acceptance":"Developers multiply PRs per developer per day, AW runs per PR and AIC per run; repositories divide averages only. Duration scales totals independently of the synthetic day source.","from":"simulation-days","parameters":[{"name":"company-repositories","type":"number"},{"name":"developers","type":"number"},{"name":"prs-per-developer-per-day","type":"number"},{"name":"aw-runs-per-pr","type":"number"},{"name":"days","type":"number"},{"name":"aic-per-run","type":"number"}],"filter":{"predicates":[{"field":"day","equals":1}]},"compute":[{"as":"daily-prs","function":"product","args":[{"parameter":"developers"},{"parameter":"prs-per-developer-per-day"}]},{"as":"daily-runs","function":"product","args":[{"field":"daily-prs"},{"parameter":"aw-runs-per-pr"}]},{"as":"daily-aic","function":"product","args":[{"field":"daily-runs"},{"parameter":"aic-per-run"}]},{"as":"total-prs","function":"product","args":[{"field":"daily-prs"},{"parameter":"days"}]},{"as":"total-runs","function":"product","args":[{"field":"daily-runs"},{"parameter":"days"}]},{"as":"total-aic","function":"product","args":[{"field":"daily-aic"},{"parameter":"days"}]},{"as":"prs-per-repo","function":"quotient","args":[{"field":"daily-prs"},{"parameter":"company-repositories"}]},{"as":"runs-per-repo","function":"quotient","args":[{"field":"daily-runs"},{"parameter":"company-repositories"}]},{"as":"runs-per-second","function":"quotient","args":[{"field":"daily-runs"},{"value":86400}]}]},{"name":"simulator-pr-counts","subject":"Show modeled daily and horizon pull request counts.","objective":"Separate developer activity from repository scope.","acceptance":"PR totals depend on developers and duration, not repository count.","from":"simulator-pr-inputs","compute":[{"as":"measure","function":"literal","args":[{"value":"Pull requests"}]}],"select":[{"field":"measure"},{"field":"daily-prs","as":"daily"},{"field":"total-prs","as":"total"}]},{"name":"simulator-pr-runs","subject":"Show modeled AW runs generated by pull requests.","objective":"Expose the selected AW fan-out.","acceptance":"Daily and horizon runs use the configured AW runs per PR.","from":"simulator-pr-inputs","compute":[{"as":"measure","function":"literal","args":[{"value":"AW runs"}]}],"select":[{"field":"measure"},{"field":"daily-runs","as":"daily"},{"field":"total-runs","as":"total"}]},{"name":"simulator-pr-aic","subject":"Show modeled AI Credits, not actual spending or currency.","objective":"Make the editable AIC-per-run assumption explicit.","acceptance":"AIC totals multiply modeled runs by AIC per AW run; no dollar conversion or budget enforcement is inferred.","from":"simulator-pr-inputs","compute":[{"as":"measure","function":"literal","args":[{"value":"AI Credits (AIC)"}]}],"select":[{"field":"measure"},{"field":"daily-aic","as":"daily"},{"field":"total-aic","as":"total"}]},{"name":"simulator-pr-summary","subject":"Compare daily and horizon PR, AW-run and AI Credit estimates.","objective":"Support side-effect-free company workload planning.","acceptance":"Exactly three modeled measures are shown and recompute from all six form inputs.","from":"simulator-pr-counts","union":["simulator-pr-runs","simulator-pr-aic"]},{"name":"overview-run-summary","subject":"Summarize successful, failed, and active runs with rollout-mode counts.","objective":"Expose observed success, failure, and active run counts, including active live and review modes, for the selected horizon.","acceptance":"Each count follows its declared conclusion, status, and rollout-mode filters; run success is not treated as a verified outcome, and incomplete or stale evidence is identified.","from":"overview-runs","aggregate":{"values":[{"field":"run-conclusion","as":"successful-runs","reducer":"count","filter":{"predicates":[{"field":"run-conclusion","equals":"success"}]}},{"field":"run-conclusion","as":"failed-runs","reducer":"count","filter":{"predicates":[{"field":"run-conclusion","in":["failure","startup-failure","stale","timed-out"]}]}},{"field":"run-status","as":"active-runs","reducer":"count","filter":{"predicates":[{"field":"run-status","in":["queued","in-progress","in_progress"]}]}},{"field":"run-status","as":"active-live","reducer":"count","filter":{"predicates":[{"field":"run-status","in":["queued","in-progress","in_progress"]},{"field":"rollout-mode","equals":"live"}]}},{"field":"run-status","as":"active-review","reducer":"count","filter":{"predicates":[{"field":"run-status","in":["queued","in-progress","in_progress"]},{"field":"rollout-mode","equals":"review"}]}}]}},{"name":"overview-delivery-summary","subject":"Count distinct target repositories with successful worker dispatch runs in the selected horizon.","objective":"Measure observed reach among registered repositories with successful dispatched worker runs.","acceptance":"Distinct delivered-repositories is limited to registered targets and successful workflow_dispatch worker runs in the selected horizon; it does not establish accepted delivery or authorized coverage.","from":"overview-runs","joins":[{"source":"repositories","type":"inner","on":[{"left":"target-repository","right":"repository-coordinate"}],"fields":[{"field":"repository-coordinate","as":"registered-target-repository"}]}],"filter":{"predicates":[{"field":"event","equals":"workflow_dispatch"},{"field":"run-conclusion","equals":"success"},{"field":"workflow-role","equals":"worker"}]},"aggregate":{"values":[{"field":"target-repository","as":"delivered-repositories","reducer":"distinct-count"}]}},{"name":"overview-value-summary","subject":"Count all observed grader results.","objective":"Identify whether any grader observations are available to the Overview status presentation.","acceptance":"The value-gains field counts observed grader records only; inspect each result's native measure, unit, direction, maturity, and uncertainty before claiming an outcome or improvement.","from":"grader-observations","aggregate":{"values":[{"field":"grader","as":"value-gains","reducer":"count"}]}},{"name":"overview-issue-summary","subject":"Count retained issue and pull request safe-output records for Overview.","objective":"Restore the issue and pull request counter with a link to its evidence inventory.","acceptance":"The count includes retained canonical issue and pull request records, not inferred outcomes; unavailable evidence remains unavailable.","from":"issues","aggregate":{"values":[{"field":"id","as":"value","reducer":"count"}]},"limit":1},{"name":"overview-issue-station","subject":"Present the retained issue and pull request count for Overview.","objective":"Provide a presentation-ready count and accessible evidence description.","acceptance":"The value matches overview-issue-summary and describes retained safe outputs, not accepted outcomes.","from":"overview-issue-summary","compute":[{"as":"detail","function":"concat","args":[{"value":"Retained safe"},{"value":" outputs"}]},{"as":"description","function":"concat","args":[{"field":"value"},{"value":" retained issues and pull requests"}]}],"limit":1},{"name":"overview-value-station","subject":"Present the observed grader-result count separately from repository Value.","objective":"Label grader observations honestly without implying verified outcome gains.","acceptance":"The count matches overview-value-summary, including zero; grader presence is not proof of improvement and unavailable evidence is not zero.","from":"overview-value-summary","compute":[{"as":"detail","function":"concat","args":[{"value":"Observed grader"},{"value":" results"}]},{"as":"description","function":"concat","args":[{"field":"value-gains"},{"value":" observed grader results, not verified improvements"}]}],"select":[{"field":"value-gains","as":"value"},{"field":"detail"},{"field":"description"}],"limit":1},{"name":"overview-run-status-input","subject":"Prepare the compact run summary for declarative factory status classification.","objective":"Carry successful-runs, failed-runs, and active-runs into the status join without changing their meaning.","acceptance":"The projected counts retain the selected horizon and match overview-run-summary; the join key is only a presentation key, not additional evidence.","from":"overview-run-summary","compute":[{"as":"status-join-key","function":"concat","args":[{"value":"factory"},{"value":"-status"}]}],"select":[{"field":"status-join-key"},{"field":"successful-runs"},{"field":"failed-runs"},{"field":"active-runs"}]},{"name":"overview-value-status-input","subject":"Prepare the compact value summary for declarative factory status classification.","objective":"Carry the grader-observation count into the optional status join.","acceptance":"The projected value-gains count matches overview-value-summary; a zero count does not establish complete grader coverage, and a nonzero count is not proof of gain.","from":"overview-value-summary","compute":[{"as":"status-join-key","function":"concat","args":[{"value":"factory"},{"value":"-status"}]}],"select":[{"field":"status-join-key"},{"field":"value-gains"}]},{"name":"overview-factory-status","subject":"Classify the factory heading from compact run and optional grader observations.","objective":"Provide a bounded Overview heading based on observed run counts and optional grader-record presence.","acceptance":"The heading matches the declared run-count and optional grader-presence branches; grader presence is not verified value, and the heading does not authorize any policy change.","from":"overview-run-status-input","joins":[{"source":"overview-value-status-input","type":"left","on":[{"left":"status-join-key","right":"status-join-key"}],"fields":[{"field":"value-gains","as":"value-gains"}]}],"compute":[{"as":"has-successful-runs","function":"greater-than","args":[{"field":"successful-runs"},{"value":0}]},{"as":"has-failed-runs","function":"greater-than","args":[{"field":"failed-runs"},{"value":0}]},{"as":"failures-exceed-successes","function":"greater-than","args":[{"field":"failed-runs"},{"field":"successful-runs"}]},{"as":"has-active-runs","function":"greater-than","args":[{"field":"active-runs"},{"value":0}]},{"as":"has-value-gains","function":"greater-than","args":[{"field":"value-gains"},{"value":0}]},{"as":"successful-heading","function":"if","args":[{"field":"has-successful-runs"},{"value":"Your factory is humming."},{"value":"Your factory is idle."}]},{"as":"attention-heading","function":"if","args":[{"field":"has-failed-runs"},{"value":"Your factory needs attention."},{"field":"successful-heading"}]},{"as":"strain-heading","function":"if","args":[{"field":"failures-exceed-successes"},{"value":"Your factory is under strain."},{"field":"attention-heading"}]},{"as":"active-heading","function":"if","args":[{"field":"has-active-runs"},{"value":"Your factory is humming."},{"field":"strain-heading"}]},{"as":"factory-heading","function":"if","args":[{"field":"has-value-gains"},{"value":"Your factory has grader observations."},{"field":"active-heading"}]}],"select":[{"field":"factory-heading"}]},{"name":"overview-registered-repository-summary","subject":"Count canonical repository identities registered in the resolved control-plane scope.","objective":"Provide the registered-repository denominator for observed worker reach.","acceptance":"The count reflects canonical repository records in the resolved scope; it is not evidence of live enrollment, successful execution, or full inventory completeness.","from":"repositories","aggregate":{"values":[{"field":"repository","as":"registered-repositories","reducer":"count"}]}},{"name":"overview-delivery-coverage-input","subject":"Prepare successful delivery totals for the repository coverage summary.","objective":"Carry the distinct delivered-repositories count into the coverage join.","acceptance":"The projected count equals overview-delivery-summary for the selected horizon; the join key adds no repository observations.","from":"overview-delivery-summary","compute":[{"as":"coverage-key","function":"concat","args":[{"value":"repository-coverage"},{"value":""}]}],"select":[{"field":"delivered-repositories"},{"field":"coverage-key"}]},{"name":"overview-registered-repository-coverage-input","subject":"Prepare registered repository totals for the repository coverage summary.","objective":"Carry the registered-repositories count into the coverage denominator join.","acceptance":"The projected count equals overview-registered-repository-summary for the resolved scope; missing inventory is not treated as zero eligible targets.","from":"overview-registered-repository-summary","compute":[{"as":"coverage-key","function":"concat","args":[{"value":"repository-coverage"},{"value":""}]}],"select":[{"field":"registered-repositories"},{"field":"coverage-key"}]},{"name":"overview-rhythm","subject":"Compare all workflow runs by weekday, layering this week over last week.","objective":"Show the observed weekday pattern across both calendar weeks, regardless of status or conclusion.","acceptance":"Verify weekday order, counts including unsuccessful and in-flight runs, and reached-day flags. Missing rhythm is unavailable, not zero activity; do not attribute changes to workflow improvements.","from":"overview-runs","time":{"range":"15d"},"compute":[{"as":"rhythm-point","function":"calendar-week-point","args":[{"field":"started-at"},{"context":"time-end"},{"value":true}]}],"aggregate":{"values":[{"field":"rhythm-point","as":"rhythm","reducer":"calendar-week-rhythm"}]}},{"name":"overview-repository-coverage-summary","subject":"Aggregate reached and total repositories across the resolved organization scope.","objective":"Pair observed reached-repositories and registered-repositories-total for a comparable coverage denominator.","acceptance":"Both totals come from their named input queries and share the resolved scope; verify the left-joined inventory source independently before interpreting a zero total, since a missing join can aggregate to zero.","from":"overview-delivery-coverage-input","joins":[{"source":"overview-registered-repository-coverage-input","type":"left","on":[{"left":"coverage-key","right":"coverage-key"}],"fields":[{"field":"registered-repositories","as":"registered-repositories-total"}]}],"aggregate":{"values":[{"field":"delivered-repositories","as":"reached-repositories","reducer":"sum"},{"field":"registered-repositories-total","as":"registered-repositories-total","reducer":"sum"}]}},{"name":"overview-repository-coverage","subject":"Measure registered repository reach from successful worker execution.","objective":"Present observed successful-worker repository reach as a ratio alongside numerator and denominator.","acceptance":"repository-coverage is reached-repositories divided by registered-repositories-total when available; preserve the counts and undefined denominator, and do not call reach successful outcomes.","from":"overview-repository-coverage-summary","compute":[{"as":"repository-coverage","function":"quotient","args":[{"field":"reached-repositories"},{"field":"registered-repositories-total"}]}],"select":[{"field":"repository-coverage"},{"field":"reached-repositories"},{"field":"registered-repositories-total"}]},{"name":"overview-workflow-health-groups","subject":"Assess current runtime failures for every workflow across CAO and targeted repositories.","objective":"Compute the latest consecutive completed-run failure streak for each repository-scoped workflow without requiring campaign membership.","acceptance":"Group by organization, repository, and workflow; in-flight retries do not clear failures, and later non-failing completed runs reset the streak within the selected horizon.","from":"overview-runs","filter":{"predicates":[{"field":"run-status","equals":"completed"}]},"compute":[{"as":"is-runtime-failure","function":"equals-any","args":[{"field":"run-conclusion"},{"value":"failure"},{"value":"startup-failure"},{"value":"stale"},{"value":"timed-out"}]},{"as":"runtime-failure-streak-point","function":"failure-streak-point","args":[{"field":"started-at"},{"field":"run"},{"field":"is-runtime-failure"}]}],"aggregate":{"by":["organization","repository","workflow"],"values":[{"field":"runtime-failure-streak-point","as":"failure-count","reducer":"latest-failure-streak"}]}},{"name":"overview-workflow-health-summary","subject":"Count all registered workflows and those without current observed runtime failures.","objective":"Provide Factory health numerator and denominator across CAO and targeted repositories, including standalone and campaign workflows.","acceptance":"Each repository-scoped workflow counts once regardless of campaign or role; no retained failure is not proof of successful execution, missing inventory remains unavailable, and missing run evidence marks the result incomplete.","from":"workflows","joins":[{"source":"overview-workflow-health-groups","type":"left","on":[{"left":"organization","right":"organization"},{"left":"repository","right":"repository"},{"left":"workflow","right":"workflow"}],"fields":[{"field":"failure-count","as":"observed-failures"}]}],"compute":[{"as":"normalized-failures","function":"coalesce","args":[{"field":"observed-failures"},{"value":0}]},{"as":"problem-present","function":"greater-than","args":[{"field":"normalized-failures"},{"value":0}]}],"aggregate":{"values":[{"field":"workflow","as":"workflows","reducer":"count"},{"field":"workflow","as":"healthy-workflows","reducer":"count","filter":{"predicates":[{"field":"problem-present","equals":false}]}}]}},{"name":"overview-workflow-health-presentation-input","subject":"Prepare all-workflow health counts for Overview presentation.","objective":"Carry Factory health counts into the header and station presentation.","acceptance":"Both counts match overview-workflow-health-summary and preserve missing evidence metadata.","from":"overview-workflow-health-summary","compute":[{"as":"overview-presentation-key","function":"concat","args":[{"value":"overview"},{"value":"-presentation"}]}],"select":[{"field":"overview-presentation-key"},{"field":"workflows"},{"field":"healthy-workflows"}]},{"name":"overview-factory-health-presentation","subject":"Produce presentation-ready Factory health values for the Overview header and floor.","objective":"Display the ratio of workflows without current observed runtime failures to all registered workflows with both underlying counts.","acceptance":"The percentage and detail agree with healthy-workflows and workflows; a missing or zero denominator remains unavailable, and the ratio is not proof of impact.","from":"overview-workflow-health-presentation-input","compute":[{"as":"factory-health","function":"quotient","args":[{"field":"healthy-workflows"},{"field":"workflows"}]},{"as":"factory-health-display","function":"format-percent","args":[{"field":"factory-health"}]},{"as":"healthy-workflows-display","function":"format-count","args":[{"field":"healthy-workflows"}]},{"as":"workflows-display","function":"format-count","args":[{"field":"workflows"}]},{"as":"factory-health-detail","function":"concat","args":[{"field":"healthy-workflows-display"},{"value":"/"},{"field":"workflows-display"},{"value":" healthy workflows"}]},{"as":"factory-health-description","function":"concat","args":[{"field":"factory-health-display"},{"value":" factory health"}]}],"select":[{"field":"overview-presentation-key"},{"field":"factory-health"},{"field":"factory-health-display"},{"field":"factory-health-detail"},{"field":"factory-health-description"}]},{"name":"overview-header-status-presentation-input","subject":"Prepare the factory status heading for the declarative Overview header.","objective":"Carry the factory heading into the Overview header join unchanged.","acceptance":"The heading matches overview-factory-status; the presentation key does not imply additional evidence or a policy recommendation.","from":"overview-factory-status","compute":[{"as":"overview-presentation-key","function":"concat","args":[{"value":"overview"},{"value":"-presentation"}]}],"select":[{"field":"overview-presentation-key"},{"field":"factory-heading"}]},{"name":"overview-header-presentation","subject":"Resolve the Overview heading from declarative status and factory-health evidence.","objective":"Display the configured heading corresponding to observed run status and factory health.","acceptance":"The selected heading follows the declared presentation branches; numeric branch boundaries are UI classification only, not operational targets or rollout thresholds.","from":"overview-header-status-presentation-input","joins":[{"source":"overview-factory-health-presentation","type":"left","on":[{"left":"overview-presentation-key","right":"overview-presentation-key"}],"fields":[{"field":"factory-health","as":"factory-health"}]}],"compute":[{"as":"factory-health-positive","function":"greater-than","args":[{"field":"factory-health"},{"value":0}]},{"as":"factory-health-below-threshold","function":"greater-than","args":[{"value":0.66},{"field":"factory-health"}]},{"as":"positive-factory-health-heading","function":"if","args":[{"field":"factory-health-below-threshold"},{"value":"Your factory needs attention."},{"field":"factory-heading"}]},{"as":"heading","function":"if","args":[{"field":"factory-health-positive"},{"field":"positive-factory-health-heading"},{"field":"factory-heading"}]}],"select":[{"field":"heading"}]},{"name":"overview-run-motion-presentation-input","subject":"Prepare active run state for Overview station presentation.","objective":"Expose whether at least one queued or in-progress run was observed for station display.","acceptance":"active reflects overview-run-summary's active-runs count; no observed active run does not prove the fleet is idle when the snapshot is incomplete.","from":"overview-run-summary","compute":[{"as":"overview-presentation-key","function":"concat","args":[{"value":"overview"},{"value":"-presentation"}]},{"as":"active","function":"greater-than","args":[{"field":"active-runs"},{"value":0}]}],"select":[{"field":"overview-presentation-key"},{"field":"active"}]},{"name":"overview-factory-station","subject":"Provide the presentation-ready Factory health station for Overview.","objective":"Show the all-workflow runtime health ratio, supporting counts, and observed run motion together.","acceptance":"Station value, display, detail, description, and active flag match their input queries; neither absence of failures nor run motion is verified workflow effectiveness.","from":"overview-factory-health-presentation","joins":[{"source":"overview-run-motion-presentation-input","type":"left","on":[{"left":"overview-presentation-key","right":"overview-presentation-key"}],"fields":[{"field":"active","as":"active"}]}],"select":[{"field":"factory-health","as":"value"},{"field":"factory-health-display","as":"display-value"},{"field":"factory-health-detail","as":"detail"},{"field":"factory-health-description","as":"description"},{"field":"active"}]},{"name":"overview-repository-station-presentation-input","subject":"Prepare repository coverage for the presentation-ready Overview station.","objective":"Format repository reach with its reached and registered counts for the station.","acceptance":"The percentage and detail preserve overview-repository-coverage's numerator and denominator; unavailable coverage remains unavailable, not zero or complete reach.","from":"overview-repository-coverage","compute":[{"as":"overview-presentation-key","function":"concat","args":[{"value":"overview"},{"value":"-presentation"}]},{"as":"display-value","function":"format-percent","args":[{"field":"repository-coverage"}]},{"as":"reached-repositories-display","function":"format-count","args":[{"field":"reached-repositories"}]},{"as":"registered-repositories-display","function":"format-count","args":[{"field":"registered-repositories-total"}]},{"as":"detail","function":"concat","args":[{"field":"reached-repositories-display"},{"value":"/"},{"field":"registered-repositories-display"},{"value":" repositories reached"}]},{"as":"description","function":"concat","args":[{"field":"display-value"},{"value":" average repository coverage"}]}],"select":[{"field":"overview-presentation-key"},{"field":"repository-coverage","as":"value"},{"field":"display-value"},{"field":"detail"},{"field":"description"}]},{"name":"overview-repository-station","subject":"Provide the presentation-ready repository coverage station for Overview.","objective":"Show observed registered-repository worker reach and run motion in one station.","acceptance":"Value and formatted evidence match the coverage presentation input, and active matches run motion; neither changes policy or establishes accepted outcomes.","from":"overview-repository-station-presentation-input","joins":[{"source":"overview-run-motion-presentation-input","type":"left","on":[{"left":"overview-presentation-key","right":"overview-presentation-key"}],"fields":[{"field":"active","as":"active"}]}],"select":[{"field":"value"},{"field":"display-value"},{"field":"detail"},{"field":"description"},{"field":"active"}]},{"name":"cost-by-repository","subject":"Present observed AI Credit cost grouped by repository.","objective":"Locate repositories with higher observed AI Credit totals for evidence-led investigation.","acceptance":"Each repository coordinate and native aic total agrees with repository-aic-totals; confirm the selected horizon and underlying runs before attributing cost or proposing a change.","from":"repository-aic-totals","compute":[{"as":"repository-coordinate","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"}]},{"as":"encoded-repository","function":"url-encode","args":[{"field":"repository-coordinate"}]},{"as":"repository-dashboard-href","function":"concat","args":[{"value":"#page-repository-detail?repository="},{"field":"encoded-repository"}]},{"as":"repository-dashboard-label","function":"concat","args":[{"value":"View "},{"field":"repository-coordinate"},{"value":" repository dashboard"}]},{"as":"repository-dashboard-link","function":"dashboard-link","args":[{"value":""},{"field":"repository-dashboard-href"},{"field":"repository-dashboard-label"},{"field":"repository-coordinate"}]}],"select":[{"field":"repository-coordinate"},{"field":"repository-dashboard-link"},{"field":"aic"}],"order-by":[{"field":"aic","direction":"desc"}]},{"name":"cost-by-workflow","subject":"Present observed AI Credit cost grouped by repository-owned workflow.","objective":"Locate repository workflows with higher observed AI Credit totals and open their workflow evidence.","acceptance":"Workflow identity, link, and native aic total match workflow-aic-totals in descending order; cost alone does not establish waste, quality, or value.","from":"workflow-aic-totals","compute":[{"as":"repository-coordinate","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"}]},{"as":"workflow-coordinate","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"},{"value":":"},{"field":"workflow"}]},{"as":"encoded-workflow","function":"url-encode","args":[{"field":"workflow-coordinate"}]},{"as":"workflow-dashboard-href","function":"concat","args":[{"value":"#page-workflow-runtime?workflow="},{"field":"encoded-workflow"}]},{"as":"workflow-dashboard-label","function":"concat","args":[{"value":"View "},{"field":"workflow-coordinate"},{"value":" workflow dashboard"}]},{"as":"workflow-dashboard-link","function":"dashboard-link","args":[{"value":""},{"field":"workflow-dashboard-href"},{"field":"workflow-dashboard-label"},{"field":"workflow-coordinate"}]}],"select":[{"field":"repository-coordinate"},{"field":"workflow"},{"field":"workflow-coordinate"},{"field":"workflow-dashboard-link"},{"field":"aic"}],"order-by":[{"field":"aic","direction":"desc"}]},{"name":"cost-per-workflow-run","subject":"Present the average observed AI Credit cost of a single run for each repository-owned workflow.","objective":"Compare observed AI Credit per run across repository workflows with each observed-runs denominator.","acceptance":"Include only workflows with positive-AIC run attempts, and use only those attempts in cost averages; observed-runs still counts all retained attempts.","description":"Observed AI Credit totals divided by positive-AIC run attempts for each declared workflow.","from":"workflow-aic-run-totals","filter":{"predicates":[{"field":"aic-runs","gte":1}]},"compute":[{"as":"aic-per-run","function":"quotient","args":[{"field":"aic"},{"field":"aic-runs"}]},{"as":"repository-coordinate","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"}]},{"as":"workflow-coordinate","function":"concat","args":[{"field":"organization"},{"value":"/"},{"field":"repository"},{"value":":"},{"field":"workflow"}]},{"as":"encoded-workflow","function":"url-encode","args":[{"field":"workflow-coordinate"}]},{"as":"workflow-dashboard-href","function":"concat","args":[{"value":"#page-workflow-runtime?workflow="},{"field":"encoded-workflow"}]},{"as":"workflow-dashboard-label","function":"concat","args":[{"value":"View "},{"field":"workflow-coordinate"},{"value":" workflow dashboard"}]},{"as":"workflow-dashboard-link","function":"dashboard-link","args":[{"value":""},{"field":"workflow-dashboard-href"},{"field":"workflow-dashboard-label"},{"field":"workflow-coordinate"}]}],"select":[{"field":"repository-coordinate"},{"field":"workflow"},{"field":"workflow-coordinate"},{"field":"workflow-dashboard-link"},{"field":"runs","as":"observed-runs"},{"field":"aic-per-run"}],"order-by":[{"field":"aic-per-run","direction":"desc"}]},{"name":"failure-run-base","subject":"Select retained runs with failure, startup-failure, stale, or timed-out conclusions for the failed-run ledger and streak inputs.","objective":"Provide one consistent failure-conclusion evidence set to downstream Overview queries.","acceptance":"Each selected run has one of the four declared conclusions within the selected horizon; other conclusions remain outside this set, and missing run coverage is not interpreted as no failures.","from":"runs","filter":{"predicates":[{"field":"run-conclusion","in":["failure","startup-failure","stale","timed-out"]}]}},{"name":"failed-runs","subject":"List failed workflow runs that need operator attention.","objective":"Give operators the most recent observed failed runs to inspect in GitHub.","acceptance":"Unprojected run rows retain available conclusion, started-at, and run evidence fields in descending started-at order; inspect source logs and missing links before attributing a cause or declaring resolution.","from":"failure-run-base","order-by":[{"field":"started-at","direction":"desc"}]},{"name":"overview-failing-runs","subject":"Identify failed runs in the selected snapshot horizon so subsequent streak logic can use the same declarative failure definition.","objective":"Project distinct failure-run counts by organization, repository, workflow, and run for streak joins.","acceptance":"Each grouped run identity has a failing-runs count derived from failure-run-base in the selected horizon; this stage does not assert a consecutive streak or require action.","from":"failure-run-base","aggregate":{"by":["organization","repository","workflow","run"],"values":[{"field":"run","as":"failing-runs","reducer":"distinct-count"}]}},{"name":"overview-failing-workflows","subject":"Identify only workflows that have at least one failed run in the selected snapshot horizon before computing streaks.","objective":"Provide workflow identities with observed failed runs for the streak computation.","acceptance":"Each organization/repository/workflow group has a distinct failing-runs count from overview-failing-runs; the count covers observed failures, not the latest consecutive streak.","from":"overview-failing-runs","aggregate":{"by":["organization","repository","workflow"],"values":[{"field":"run","as":"failing-runs","reducer":"distinct-count"}]}},{"name":"overview-repeated-failure-groups","subject":"Group each workflow's latest consecutive failing run sequence in the selected snapshot horizon, resetting the group after any successful run.","objective":"Project the latest observed consecutive failure-count per workflow for downstream blocked-work matching.","acceptance":"failure-count follows run ordering and the declared latest-failure-streak reducer, with non-failing runs breaking the streak; missing earlier runs or incomplete snapshots limit the observed sequence.","from":"runs","joins":[{"source":"overview-failing-workflows","type":"inner","on":[{"left":"organization","right":"organization"},{"left":"repository","right":"repository"},{"left":"workflow","right":"workflow"}],"fields":[{"field":"failing-runs","as":"failing-runs"}]},{"source":"overview-failing-runs","type":"left","on":[{"left":"organization","right":"organization"},{"left":"repository","right":"repository"},{"left":"workflow","right":"workflow"},{"left":"run","right":"run"}],"fields":[{"field":"failing-runs","as":"run-failing-count"}]}],"compute":[{"as":"failure-streak-point","function":"failure-streak-point","args":[{"field":"started-at"},{"field":"run"},{"field":"run-failing-count"}]}],"aggregate":{"by":["organization","repository","workflow"],"values":[{"field":"failure-streak-point","as":"failure-count","reducer":"latest-failure-streak"}]}},{"name":"overview-repeated-failure-candidates","subject":"Attach selected-horizon failure counts to each workflow's latest canonical work item.","objective":"Pair blocked work items with observed workflow failure streaks and retained run evidence before attention filtering.","acceptance":"Candidates are filtered to blocked items with a matching organization/repository/workflow streak; is-repeated reflects failure-count greater than one, while selected evidence-link and run-link can be absent or refer to the work item rather than the latest failed run.","from":"work-items","joins":[{"source":"overview-repeated-failure-groups","type":"inner","on":[{"left":"organization","right":"organization"},{"left":"repository","right":"repository"},{"left":"workflow","right":"workflow"}],"fields":[{"field":"failure-count","as":"failure-count"}]}],"filter":{"predicates":[{"field":"lifecycle-state","equals":"blocked"}]},"compute":[{"as":"is-repeated","function":"greater-than","args":[{"field":"failure-count"},{"value":1}]},{"as":"attention-signal-id","function":"concat","args":[{"value":"repeated-failure:"},{"field":"organization"},{"value":"/"},{"field":"repository"},{"value":":"},{"field":"workflow"}]},{"as":"kind","function":"coalesce","args":[{"value":"Repeated workflow failures"},{"value":"Repeated workflow failures"}]},{"as":"title","function":"coalesce","args":[{"field":"workflow"},{"value":"Workflow"}]},{"as":"attention-reason","function":"concat","args":[{"field":"failure-count"},{"value":" failed runs in the selected horizon"}]},{"as":"action","function":"coalesce","args":[{"value":"Open latest failed run on GitHub"},{"value":"Open latest failed run on GitHub"}]},{"as":"icon","function":"coalesce","args":[{"value":"x-circle"},{"value":"x-circle"}]},{"as":"tone","function":"coalesce","args":[{"value":"critical"},{"value":"critical"}]},{"as":"priority","function":"number","args":[{"value":0}]}],"select":[{"field":"is-repeated"},{"field":"attention-signal-id"},{"field":"kind"},{"field":"title"},{"field":"scope"},{"field":"attention-reason","as":"reason"},{"field":"observed-at"},{"field":"action"},{"field":"evidence-link"},{"field":"run-link"},{"field":"icon"},{"field":"tone"},{"field":"priority"},{"field":"failure-count"}]},{"name":"overview-repeated-failure-attention","subject":"Keep only unresolved workflows with two or more failures in the selected horizon.","objective":"Surface blocked workflow items with observed repeated failures for bounded run investigation.","acceptance":"Every row inherits a blocked item with is-repeated true and projects evidence-link and run-link when available; verify run order, links, and current state before treating the failure as still unresolved.","from":"overview-repeated-failure-candidates","filter":{"predicates":[{"field":"is-repeated","equals":true}]},"select":[{"field":"attention-signal-id"},{"field":"kind"},{"field":"title"},{"field":"scope"},{"field":"reason"},{"field":"observed-at"},{"field":"action"},{"field":"evidence-link"},{"field":"run-link"},{"field":"icon"},{"field":"tone"},{"field":"priority"},{"field":"failure-count"}]},{"name":"overview-review-attention","subject":"Select only unresolved outputs explicitly awaiting human review with their retained GitHub evidence destination.","objective":"Present review-state work items and their retained GitHub destination to a human reviewer.","acceptance":"Rows are filtered to lifecycle-state review and project the work-item ID as attention-signal-id, plus reason, evidence-link, and run-link where present; reviewer disposition must be checked at source.","from":"work-items","filter":{"predicates":[{"field":"lifecycle-state","equals":"review"}]},"compute":[{"as":"kind","function":"coalesce","args":[{"value":"Human review required"},{"value":"Human review required"}]},{"as":"title","function":"coalesce","args":[{"field":"objective"},{"value":"Produced output"}]},{"as":"action","function":"coalesce","args":[{"value":"Open review item on GitHub"},{"value":"Open review item on GitHub"}]},{"as":"icon","function":"coalesce","args":[{"value":"eye"},{"value":"eye"}]},{"as":"tone","function":"coalesce","args":[{"value":"action"},{"value":"action"}]},{"as":"priority","function":"number","args":[{"value":1}]}],"select":[{"field":"work-item-id","as":"attention-signal-id"},{"field":"kind"},{"field":"title"},{"field":"scope"},{"field":"reason"},{"field":"observed-at"},{"field":"action"},{"field":"evidence-link"},{"field":"run-link"},{"field":"icon"},{"field":"tone"},{"field":"priority"}]},{"name":"overview-needs-attention","subject":"Combine grouped repeated failures and unresolved review outputs without introducing ordinary activity or duplicate work items.","objective":"Prioritize observed blocked repeated-failure work and review-state outputs for investigation.","acceptance":"Rows come only from the repeated-failure or review inputs and retain their source reasons, links, and ordering; confirm fresh source status before acting, and do not equate a missing row with resolved work.","from":"overview-repeated-failure-attention","union":["overview-review-attention"],"order-by":[{"field":"priority","direction":"asc"},{"field":"observed-at","direction":"desc"},{"field":"attention-signal-id","direction":"asc"}]},{"name":"domain-route-record","subject":"Project the selected domain header and one retained run link.","objective":"Identify the selected domain and open a retained run before investigating its traffic evidence.","acceptance":"The route header preserves the selected domain and a run link from its retained observations; missing observations or links remain unavailable, and a header does not establish access policy or traffic completeness.","from":"domains","select":[{"field":"domain"},{"field":"run-link"}]},{"name":"domain-run-records","subject":"Retained run-linked observations for the selected domain.","objective":"Find related runs without returning the unscoped domain collection alongside the paginated view.","acceptance":"Preserve every domain observation field, exact route scope, filtering, ordering, total count, provenance and related-run links; only the bounded view payload crosses the worker boundary.","from":"domains"},{"name":"tool-route-record","subject":"Project the selected MCP tool header and one retained run link.","objective":"Identify the selected MCP tool and open a retained run before investigating its call evidence.","acceptance":"The route header preserves the selected MCP tool label and a run link from its retained calls; absent calls or links remain unavailable and do not imply zero usage or tool effectiveness.","from":"mcp-tool-calls","select":[{"field":"mcp-tool-label"},{"field":"run-link"}]},{"name":"audit-route-record","subject":"Project the selected audit summary header and one retained run link.","objective":"Identify the selected audit summary and open a retained run before investigating its observations.","acceptance":"The route header preserves the selected event summary and a run link from its retained audit observations; absent evidence remains unavailable and neither the header nor its absence establishes incident severity or a clean audit.","from":"audits","select":[{"field":"event-summary"},{"field":"run-link"}]},{"name":"domain-entity-insights","subject":"Summarize one domain entity for its dedicated Insights view.","objective":"Identify domain decisions with request volume worth investigating before considering any egress change.","acceptance":"For the selected domain, request totals match the retained domain observations grouped by decision; missing data or blocked traffic does not establish a need for access, which requires underlying request and policy review.","from":"domains","aggregate":{"by":["domain","decision"],"values":[{"field":"request-count","as":"requests","reducer":"sum"}]},"order-by":[{"field":"requests","direction":"desc"},{"field":"decision","direction":"asc"}]},{"name":"tool-entity-insights","subject":"Summarize one tool entity for its dedicated Insights view.","objective":"Select a tool and status combination whose recorded call volume merits investigation.","acceptance":"For the selected tool, observation counts match retained MCP call observations grouped by server, tool, and status; missing calls are not zero usage and status counts do not establish effectiveness or cause.","from":"mcp-tool-calls","aggregate":{"by":["mcp-tool-label","mcp-server","mcp-tool","mcp-status"],"values":[{"field":"mcp-observation","as":"observations","reducer":"count"}]},"order-by":[{"field":"observations","direction":"desc"},{"field":"mcp-status","direction":"asc"}]},{"name":"audit-entity-insights","subject":"Summarize one audit event entity for its dedicated Insights view.","objective":"Select an audit summary and status requiring closer review of underlying observations.","acceptance":"For the selected summary, counts agree with retained audit observation IDs grouped by event status; repeated observations are not silently treated as distinct incidents, and absence does not prove no findings.","from":"audits","aggregate":{"by":["event-summary","event-status"],"values":[{"field":"id","as":"observations","reducer":"count"}]},"order-by":[{"field":"observations","direction":"desc"},{"field":"event-status","direction":"asc"}]}] diff --git a/dashboard/site/src/components/factory-floor.js b/dashboard/site/src/components/factory-floor.js index eff3eb02a..d8117cc78 100644 --- a/dashboard/site/src/components/factory-floor.js +++ b/dashboard/site/src/components/factory-floor.js @@ -38,7 +38,7 @@ const STATION_DEFINITIONS = { }, 'value-gains': { icon: 'trophy', - label: 'Value gains', + label: 'Grader observations', href: '#page-graders', format: 'count', unavailableDetail: '', diff --git a/dashboard/site/test/e2e/canonical-data.spec.js b/dashboard/site/test/e2e/canonical-data.spec.js index 07b0ebbe0..2d1586eaf 100644 --- a/dashboard/site/test/e2e/canonical-data.spec.js +++ b/dashboard/site/test/e2e/canonical-data.spec.js @@ -553,7 +553,7 @@ for (const width of [1200, 390]) { await expect(page.locator('#page-overview')).toContainText('partial collection'); await expect(page.locator('#page-overview')).not.toContainText('Your factory'); await expect(page.locator('#page-overview')).not.toContainText(/\d+\/\d+ healthy workflows/); - await expect(page.locator('#page-overview')).not.toContainText('Value gains'); + await expect(page.locator('#page-overview')).not.toContainText('Grader observations'); for (const id of ['repositories', 'workflows', 'runs', 'cost']) { if (width < 768) await page.getByRole('button', { name: 'Select view', exact: true }).click(); else if (!await page.locator(`a[href="#page-${id}"]:visible`).first().isVisible()) { diff --git a/dashboard/site/test/e2e/overview.spec.js b/dashboard/site/test/e2e/overview.spec.js index 336772895..2886bf027 100644 --- a/dashboard/site/test/e2e/overview.spec.js +++ b/dashboard/site/test/e2e/overview.spec.js @@ -60,7 +60,7 @@ const sources = { 'overview-value-station': source('overview-value-station', [{ value: 1, detail: 'Observed grader results', description: '1 observed grader results, not verified improvements' }]), - 'overview-factory-status': source('overview-factory-status', [{ 'factory-heading': 'Your factory is delivering value.' }]), + 'overview-factory-status': source('overview-factory-status', [{ 'factory-heading': 'Your factory has grader observations.' }]), 'overview-header-presentation': source('overview-header-presentation', [{ heading: 'Your factory needs attention.' }]), 'overview-factory-station': source('overview-factory-station', [{ value: 0.5, @@ -198,7 +198,7 @@ test('declarative Overview views preserve desktop and mobile behavior', async ({ const stations = factory.locator('.factory-station'); await expect(stations).toHaveCount(4); await expect(stations.locator(':scope > span:nth-child(2)')).toHaveText([ - 'Factory health', 'Repository coverage', 'Issues & PRs', 'Value gains' + 'Factory health', 'Repository coverage', 'Issues & PRs', 'Grader observations' ]); await expect(stations.locator('strong')).toHaveText(['50%', '50%', '5', '1']); await expect(stations.nth(2).getByRole('link', { name: '5', exact: true })).toHaveAttribute('href', '#page-issues'); diff --git a/dashboard/site/test/unit/data-queries.test.js b/dashboard/site/test/unit/data-queries.test.js index d700edffa..d6b7b7dfb 100644 --- a/dashboard/site/test/unit/data-queries.test.js +++ b/dashboard/site/test/unit/data-queries.test.js @@ -303,7 +303,7 @@ describe('declarative dashboard queries', () => { }); it.each([ - ['delivering value', { successes: 0, failures: 0, active: 0, graders: 1 }, 'Your factory is delivering value.'], + ['grader observations', { successes: 0, failures: 0, active: 0, graders: 1 }, 'Your factory has grader observations.'], ['active', { successes: 0, failures: 2, active: 1, graders: 0 }, 'Your factory is humming.'], ['under strain', { successes: 1, failures: 2, active: 0, graders: 0 }, 'Your factory is under strain.'], ['needs attention', { successes: 2, failures: 1, active: 0, graders: 0 }, 'Your factory needs attention.'], @@ -458,7 +458,7 @@ describe('declarative dashboard queries', () => { ); expect(result['overview-header-presentation'].rows).toEqual([{ - heading: 'Your factory is delivering value.' + heading: 'Your factory has grader observations.' }]); expect(result['overview-factory-station'].rows).toEqual([{ value: 1, diff --git a/dashboard/site/test/unit/workflow-value-view-contract.test.js b/dashboard/site/test/unit/workflow-value-view-contract.test.js index 70e56aa61..d699e2ccf 100644 --- a/dashboard/site/test/unit/workflow-value-view-contract.test.js +++ b/dashboard/site/test/unit/workflow-value-view-contract.test.js @@ -14,6 +14,7 @@ import { evidencePacketSelection, readEvidencePackets } from '../../src/data/que import { operationalValueEvidenceId, operationalValueEvidenceRows } from '../../src/data/model/operational-value-evidence.js'; import { workflowValueCollectionId } from '../../src/data/model/workflow-value-collection.js'; import { measurementSelection, readMeasurements } from '../../src/data/queries/measurement-selection.js'; +import { installSqliteIndexedDB } from '../../src/data/storage/sqlite-indexeddb.js'; const dashboard = authoritativeDashboard.dashboard; const repository = resolve('../..'); @@ -172,6 +173,43 @@ function fileLedger(direction = 'decrease') { } describe('native workflow value production contract', () => { + it('keeps worker Value cards, health and evidence routes identical over browser and SQLite storage', async () => { + const packet = await publish(); + const health = readFileSync(join(repository, 'dashboard/site/test/fixtures/workflow-value-collection.jsonl'), 'utf8'); + await ingestCachedGhAwJsonl(indexedDB, health, { now: Date.parse('2026-10-23T14:00:00Z') }); + const snapshot = packet.facts.find((/** @type {Record} */ fact) => fact['fact-kind'] === 'snapshot'); + const pages = [ + ['value', {}], + ['workflow-value', { workflow: contract.route }], + ['value-report', { report: packet.id }], + ['value-snapshot', { snapshot: `${packet.id}|${snapshot['fact-id']}` }] + ]; + const browser = await Promise.all(pages.map(async ([page, parameters]) => + (await execute(String(page), /** @type {Record} */ (parameters))).map(source => source.rows))); + expect(browser[0][0][0]['overview-href']).toContain('#page-value-report?report='); + expect(browser[1][0][0]['collection-state']).toBe('deferred'); + expect(browser[1][0][0]['last-attempt-outcome']).toBe('failed'); + expect(browser[1][0][0]['captured-at']).not.toEqual(browser[1][0][0]['last-attempt-at']); + expect(browser[2][0][0]['movement']).toBe('Better'); + expect(browser[3][1]).toHaveLength(1); + + const browserDatabase = globalThis.indexedDB; + const browserKeyRange = globalThis.IDBKeyRange; + const sqlite = installSqliteIndexedDB(join(directory, 'value.sqlite')); + try { + await ingestCachedGhAwJsonl(sqlite, readFileSync(join(directory, 'report-0-evidence.jsonl'), 'utf8'), + { now: Date.parse(String(packet.observedAt)) }); + await ingestCachedGhAwJsonl(sqlite, health, { now: Date.parse('2026-10-23T14:00:00Z') }); + for (const [index, [page, parameters]] of pages.entries()) { + const sources = await execute(String(page), /** @type {Record} */ (parameters)); + expect(sources.map(source => source.rows), String(page)).toEqual(browser[index]); + } + } finally { + globalThis.indexedDB = browserDatabase; + globalThis.IDBKeyRange = browserKeyRange; + } + }); + it('bounds compound identity allocation before expanding oversized snapshot histories', async () => { const packet = await publish(fileLedger()); const header = packet.facts.find((/** @type {Record} */ fact) => fact['fact-kind'] === 'contract'); diff --git a/docs/dashboard-language-specification.md b/docs/dashboard-language-specification.md index ab07e4135..1e3005cfa 100644 --- a/docs/dashboard-language-specification.md +++ b/docs/dashboard-language-specification.md @@ -1744,11 +1744,12 @@ An element that presents counted summary boxes may declare `config.labels`, a ma `factory-header` and `factory-floor` are independently loading named elements. Their page shell does not wait for a combined page projection: each declared presentation query is bound to the view separately. An unresolved source places only its dependent widget in a loading state; resolving or refreshing one source updates only widgets that consume that source. A page-level subscription must not emit aliases for independently bound sources it did not request. The Overview floor shows campaign health, repository coverage, **Issues & PRs**, -and **Value gains**. The restored issue counter counts retained canonical issue -and pull request safe-output records and links to Issues. The legacy Value gains -counter counts observed grader results and links to Graders; its supporting text -explicitly identifies observations rather than verified improvements. Both -counters receive bounded, presentation-ready Dashboard Language query results. +and **Grader observations**. The issue counter counts retained canonical issue and +pull request safe-output records and links to Issues. The `value-gains` station +identifier remains for compatibility, but its label names observed grader results +and links to Graders; these observations are not verified repository Value. The +shared `factory-floor` element fixes station headings; `config.labels` controls +counter quantity labels, not headings. Both use bounded Dashboard Language results. Missing or unavailable evidence remains unavailable, distinct from an observed zero. Four stations form one row on desktop and two rows on narrow screens. diff --git a/docs/dashboard-overview-components.md b/docs/dashboard-overview-components.md index 6f49fa40e..c1d754c45 100644 --- a/docs/dashboard-overview-components.md +++ b/docs/dashboard-overview-components.md @@ -68,5 +68,5 @@ requiring campaign membership. The station links to Workflows; campaign navigation remains separate. The other stations show repository coverage, retained Issues & PRs, and -observed grader results under Value gains. Observed grader results are not -verified improvements. \ No newline at end of file +Grader observations. Observed grader results are not verified improvements +or repository Value. \ No newline at end of file diff --git a/docs/dashboard-overview-status-header.md b/docs/dashboard-overview-status-header.md index a92154eb5..f35d2d167 100644 --- a/docs/dashboard-overview-status-header.md +++ b/docs/dashboard-overview-status-header.md @@ -8,8 +8,9 @@ The status header gives you the overall shape of the factory right now. ## What it shows - **Work in motion** appears when runs are queued or in progress. -- The heading classifies the available evidence as idle, humming, needing - attention, under strain, or delivering value. +- The heading classifies the available run evidence as idle, humming, needing + attention, or under strain. When grader observations are present, it names + those observations without claiming verified repository Value. Treat the heading as a signal, not a health score. Follow an unexpected state into the relevant run, output, or value view before deciding what happened. diff --git a/docs/dashboard-overview.md b/docs/dashboard-overview.md index 9d7312f18..1f4f3fcdd 100644 --- a/docs/dashboard-overview.md +++ b/docs/dashboard-overview.md @@ -27,7 +27,7 @@ not stages in a conversion funnel. | **Factory health** | The share of all registered workflows across CAO and targeted repositories without current observed runtime failures. | Workflows to investigate failing execution. | | **Repositories (coverage station)** | Registered repositories that received a successful worker delivery against the total registered scope. | Repositories for the complete inventory and delivery evidence. | | **Issues & PRs** | Retained issue and pull request safe outputs. | Issues for the underlying safe outputs. | -| **Value gains** | Observed grader results, not verified improvements. | Graders for the retained observations. | +| **Grader observations** | Observed grader results, not verified improvements or repository Value. | Graders for the retained observations. | The selected dashboard time range applies before Overview calculates these values. The start time is inclusive and the end time is exclusive. Weekly diff --git a/docs/operational-value.md b/docs/operational-value.md index 528c44be1..b1ac94e89 100644 --- a/docs/operational-value.md +++ b/docs/operational-value.md @@ -61,6 +61,36 @@ See [authentication and command details](cao-cli.md#publish-and-refresh-workflow Static dashboards receive the same envelope through Activity publication, not a direct database connection. +### Verify publication in each deployment + +Use the **same exact repository and workflow** when comparing deployments. +First confirm that the frozen definition and original packet were validated; +an evaluation artifact by itself is not a published dashboard result. + +- **Pages:** Confirm that the default-branch Activity run accepted the packet + and that the subsequent CAO Dashboard build deployed its snapshot. If another + workflow owns Pages (as with Documentation Pages), confirm that it mounted + that dashboard artifact too. Open **Value** and the workflow report on the + deployed site, not a local preview. A completed collector run or dashboard + build without a successful deployment does not establish Pages freshness. +- **Hosted PostgreSQL:** Publish through the authenticated Value API above and + confirm that the receipt advanced the canonical revision (`updated: true`) + or was an exact idempotent retry (`updated: false`). Open the same workflow's + Value card and report on the Go-hosted origin. The active view requeries on + committed revisions; the browser must not read the Pages cache if the hosted + query fails. Local Go/SQLite can query a downloaded snapshot but cannot + accept direct Value publication. + +Compare the report identity, native unit and direction, original capture, +evidence cutoff, collection decision and last actual attempt in both views. +The decision may be newer than the accepted evidence; matching UI text alone +does not prove matching snapshot revisions. Missing or partial evidence stays +unavailable, not zero. Hosted recurring native acquisition is an **additional +explicit deployment choice**: the documented Azure collector template leaves +`CAO_COLLECT_NATIVE_VALUES` unset. Do not enable it, broaden Activity scope or +register every workflow merely to populate the dashboard. Select only verified +collectors under reviewed exact-pair policy with their required quota admission. + ## Recurring collection after opt-in The skill designs the measurement once. **Once the frozen function and bounded diff --git a/server/internal/postgresx/value_scope_test.go b/server/internal/postgresx/value_scope_test.go index 0b5edf599..56e7eca2e 100644 --- a/server/internal/postgresx/value_scope_test.go +++ b/server/internal/postgresx/value_scope_test.go @@ -2,6 +2,7 @@ package postgresx import ( "encoding/json" + "os" "slices" "strings" "testing" @@ -10,6 +11,101 @@ import ( "github.com/githubnext/gh-cao/server/internal/query" ) +func valueViewDefinitions(t *testing.T) []query.Definition { + t.Helper() + content, err := os.ReadFile("../../../dashboard/site/dashboard-fragments/workflow-value.json") + if err != nil { + t.Fatal(err) + } + var fragment struct { + Queries []query.Definition `json:"queries"` + } + if err := json.Unmarshal(content, &fragment); err != nil { + t.Fatal(err) + } + return append(canonicalProjectionDefinitions(t), fragment.Queries...) +} + +func TestValueViewsExecuteAgainstHostedEvidence(t *testing.T) { + definitions := valueViewDefinitions(t) + names := []string{"value-workflow-overview", "value-collection-health", "value-report-summary", "value-review-overview"} + reader := &readTransaction{store: &Store{namespace: "value-views"}} + if _, err := query.CompileSQL(definitions, names, reader.entitySQLSource); err != nil { + t.Fatal(err) + } + + store, _ := nativeTestStore(t) + packet := evidencePacket(t) + health := collectionFixture(t) + nativeSeed(t.Context(), t, store, map[string][]model.Row{ + "$repositories": { + {"id": packet["repositoryId"], "owner": "octo", "name": "example"}, + }, + "$workflows": { + {"id": packet["workflowId"], "repositoryId": packet["repositoryId"], + "path": packet["sourcePath"], "name": "Verify bugs", "role": "standalone", "state": "unknown"}, + }, + "$operationalValueEvidence": {packet}, + "$workflowValueCollections": {health}, + }) + sources, metrics, err := store.ExecuteSQLPlan(t.Context(), definitions, names) + if err != nil { + t.Fatal(err) + } + if !slices.Contains(metrics.PushedDown, "sql-plan") || len(metrics.FallbackOperations) != 0 { + t.Fatalf("Value view queries must execute in hosted SQL: %+v", metrics) + } + route := "octo/example:.github/workflows/verify-bugs.md" + for _, name := range names { + if sources[name].Metadata["availability"] == "unavailable" { + t.Fatalf("%s is unavailable: %+v", name, sources[name].Metadata) + } + } + var overview model.Row + for _, row := range sources["value-workflow-overview"].Rows { + if row["workflow-route"] == route { + overview = row + } + } + href, _ := overview["overview-href"].(string) + if !strings.HasPrefix(href, "#page-value-report?report=") || + overview["overview-state"] != "deferred" || overview["trend-movement"] != "Better" { + t.Fatalf("hosted Value card lost the canonical evidence and collection state: %+v", overview) + } + healthRows := sources["value-collection-health"].Rows + if len(healthRows) != 1 || healthRows[0]["workflow-route"] != route || + healthRows[0]["collection-state"] != "deferred" || + healthRows[0]["last-attempt-outcome"] != "failed" { + t.Fatalf("collection decision changed the accepted capture clocks: %+v", healthRows) + } + for projected, original := range map[string]string{ + "captured-at": "observedAt", "evidence-cutoff": "windowEnd", + "checked-at": "observedAt", "last-attempt-at": "lastAttemptAt", + } { + got, gotErr := evidenceTime(healthRows[0][projected]) + source := packet + if projected == "checked-at" || projected == "last-attempt-at" { + source = health + } + want, wantErr := evidenceTime(source[original]) + if gotErr != nil || wantErr != nil || !got.Equal(want) { + t.Fatalf("hosted %s differs from the accepted evidence: %+v", projected, healthRows[0]) + } + } + if healthRows[0]["captured-at"] == healthRows[0]["last-attempt-at"] { + t.Fatalf("hosted capture and failed attempt must stay distinct: %+v", healthRows[0]) + } + report := sources["value-report-summary"].Rows + if len(report) != 1 || report[0]["movement"] != "Better" || + report[0]["report-href"] != overview["overview-href"] { + t.Fatalf("hosted report differs from the Value card: %+v", report) + } + review := sources["value-review-overview"].Rows + if !slices.ContainsFunc(review, func(row model.Row) bool { return row["workflow-route"] == route }) { + t.Fatal("deferred collection with a retained result must still need review") + } +} + func TestNativeMeasurementSourceContract(t *testing.T) { reader := &readTransaction{store: &Store{namespace: "measurement-projections"}} if _, err := query.CompileSQL(canonicalProjectionDefinitions(t), []string{"workflow-value-measurements"}, diff --git a/tests/e2e/dashboard-query-parity.mjs b/tests/e2e/dashboard-query-parity.mjs index 3cc3e90c3..6980cd95d 100644 --- a/tests/e2e/dashboard-query-parity.mjs +++ b/tests/e2e/dashboard-query-parity.mjs @@ -360,7 +360,7 @@ async function executeMcpBackend(factory, dashboardPath, names) { } async function callGoMcp(method, params = {}) { - const response = await fetch(`${serverURL}/mcp`, { + const request = { method: "POST", headers: { authorization: ["Bearer", accessToken].join(" "), @@ -383,10 +383,23 @@ async function callGoMcp(method, params = {}) { }, }, }), - }); - const body = await response.json(); - if (!response.ok) throw new Error(`Go MCP ${method} failed (${response.status}): ${JSON.stringify(body)}`); - return body; + }; + for (let attempt = 0; attempt < 2; attempt++) { + const response = await fetch(`${serverURL}/mcp`, request); + const body = await response.json(); + if (response.status === 429 && attempt === 0) { + const retryAfter = Number(response.headers.get("Retry-After")); + if (Number.isInteger(retryAfter) && retryAfter >= 1 && retryAfter <= 60) { + await new Promise((resolve) => setTimeout(resolve, retryAfter * 1000)); + continue; + } + } + if (!response.ok) { + throw new Error(`Go MCP ${method} failed (${response.status}): ${JSON.stringify(body)}`); + } + return body; + } + throw new Error(`Go MCP ${method} remained rate limited after Retry-After`); } async function callNodeMcp(factory, dashboardDocumentPath, method, params = {}) {