feat(atlas): Phase C increment 1 — live CI runs on the pipeline
CD / Detect unsubstituted template (push) Successful in 1s
CD / Lint / Test / Vet (push) Successful in 6s
CD / Build & Import (push) Successful in 14s
CD / Deploy via GitOps (push) Successful in 0s

The CI stage now shows the pipeline's latest real execution, read live from the
in-cluster Gitea Actions API (public read, no token, gitea-http.gitea.svc):
"▶ run #N · <state>" coloured by outcome, prepended to the generated job list.
LatestRun + RunNode built test-first; cached in the same 30s liveOverlay; falls
back cleanly when Gitea is unreachable.

assessor-loop ledger / session_log deferred: no live CAD data exists for this repo
yet (brain confirms). Gitea run history is the real available trace.

Verified: build/vet/lint(0)/test green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-20 01:03:03 +02:00
co-authored by Claude Opus 4.8
parent 633ba153f2
commit 02a23a02dd
5 changed files with 186 additions and 2 deletions
+15
View File
@@ -10,6 +10,7 @@ import (
cadatlas "git.d-ma.be/mathias/cad-atlas"
"git.d-ma.be/mathias/cad-atlas/internal/atlas"
"git.d-ma.be/mathias/cad-atlas/internal/cluster"
"git.d-ma.be/mathias/cad-atlas/internal/gitea"
)
// atlasHTML is the Phase-A/B static shell. It fetches /api/atlas.json at load
@@ -44,6 +45,14 @@ func NewHandler() http.Handler {
if ld.ns != "" {
a.NS = "Tailscale mesh · " + ld.ns
}
if ld.run != nil {
node := atlas.RunNode(*ld.run)
for i := range a.Stages {
if a.Stages[i].Generate == "ci-jobs" {
a.Stages[i].Nodes = append([]atlas.Node{node}, a.Stages[i].Nodes...)
}
}
}
w.Header().Set("Content-Type", "application/json; charset=utf-8")
_ = json.NewEncoder(w).Encode(a)
})
@@ -54,6 +63,7 @@ func NewHandler() http.Handler {
type liveOverlayData struct {
hosts []atlas.Host
ns string
run *atlas.Run
}
// live cache: query the cluster at most once per TTL; fall back to the authored
@@ -85,6 +95,11 @@ func liveOverlay() liveOverlayData {
d.ns = s
}
}
if raw, err := gitea.Runs(); err == nil {
if r, err := atlas.LatestRun(raw); err == nil {
d.run = &r
}
}
liveCache = d
return d
}
+2 -2
View File
@@ -114,7 +114,7 @@
<body>
<header>
<h1><b>CAD</b> Atlas · From Signal to Pod</h1>
<span class="sub mono">one human gate · everything up- and downstream is agents · <em>v0.6 · live cluster (nodes + namespaces) · single-source /api/atlas.json</em></span>
<span class="sub mono">one human gate · everything up- and downstream is agents · <em>v0.7 · Phase C: live CI runs (Gitea Actions) on the pipeline</em></span>
<div class="controls">
<button id="replay"><span class="dot"></span> Replay</button>
<button id="slowmo">Slow-mo · <span id="slowState">off</span></button>
@@ -146,7 +146,7 @@
CAD → CI → CD · intent→specify→dispatch · build→test→validate · deploy→ship.
Dashed violet = feedback bus (stage 08 → TELOS: deploy outcome scored vs originating goal).
Data served from <code>/api/atlas.json</code> (authored <code>atlas.json</code> + CI stage from the live <code>cd.yml</code> + substrate from the live cluster nodes).
Phase C plugs in live reads of <code>assessor-loop</code> ledger · <code>session_log</code> · Gitea run API · Flux events.
Phase C: <code>Gitea run API</code> live (latest run on the CI stage). Pending: <code>assessor-loop</code> ledger · <code>session_log</code> · per-job status · Flux events.
</footer>
<script>