oficina / equipo Public

Make parallel work visible and schedule it efficiently

Specialist rows now include expandable recent-task lists, running and queued counts, and available waiting reasons. I audited both runner paths and left execution limits and budgets unchanged because concurrent launches still need atomic headroom reservations and isolated cancellation. Added focused tests, but dependency downloads were blocked, so they could not run.

Equipo task tkizl6frmnij, Engineering step attempt 1.
Equipo Engineering pushed by equipo-docs-t1 agent, operated by paul@keymail.dev 3f55efe4b64ae13ad78cd783ab932879eb149d58 parent 518203e
8 files changed, +185 −6
  • docs/parallel-work-audit.md +70 −0
  • internal/equipo/copy.go +7 −3
  • internal/equipo/rail.go +9 −2
  • internal/equipo/specialist_work.go +45 −0
  • internal/equipo/specialist_work_test.go +44 −0
  • internal/equipo/static/equipo.css +5 −0
  • internal/equipo/static/nav-stream.js +3 −0
  • internal/equipo/templates/chrome.html +2 −1

CI failed — run details

diff --git a/docs/parallel-work-audit.md b/docs/parallel-work-audit.md
new file mode 100644
index 00000000..cc35be63
--- /dev/null
+++ b/docs/parallel-work-audit.md
@@ -0,0 +1,70 @@
+# Parallel specialist work: runtime audit and remaining work
+
+This change implements visibility only. It does **not** enable parallel
+specialist execution or change limits, budgets, or failover.
+
+## Runtime evidence
+
+* `internal/runner/thin/run.go` constructs a StepEngine for the Linux
+ Engineer and another for the worker-only path. Both call Start and Wait.
+ The coordinator engine starts separately from specialist steps.
+* `StepEngine.loop` calls runOne/askOne synchronously. Its one cancel/cur
+ tuple cannot safely represent concurrent attempts. `nextStep` selects
+ an eligible row without claiming it. Launching multiple loops would
+ allow duplicate execution.
+* `held` globally blocks admission until pending termination is verified.
+ Recovery and probing must retain this fail-closed behavior unless the
+ resources held by an unproven attempt are precisely identifiable.
+* `Conns.scheduleFacts` includes role capability, family, subscription
+ windows and metered spend. `admitTx` revalidates facts transactionally.
+ Subscription admissions record a decision but do not reserve estimated
+ in-flight usage against those windows.
+* The metered ledger has a durable single slot per connection, claimed
+ transactionally and released only with termination proof. This is not a
+ general multi-attempt budget reservation mechanism.
+* The current queue orders by priority rank, deadline and creation time.
+ That alone does not guarantee progress for low-priority work under a
+ continuous supply of urgent tasks.
+* No CPU/memory pressure admission is wired into either StepEngine
+ construction. Machine capacity cannot be inferred from role capability.
+
+These are source observations, not throughput measurements. No live load
+test was run and no throughput improvement is claimed.
+
+## Required before enabling concurrency
+
+Extend the existing transactional admission, rather than dispatching
+around it. Claim one attempt per task, reserve machine capacity and
+subscription headroom, and retain the metered guard and independent review
+family constraints. Track cancellation and completion by attempt, including
+failover revisions, with reservations held until verified termination.
+Audit shared Engineer/session/worktree state and both runtime paths.
+
+Use an explicit configured ceiling, coordinator capacity reserve, bounded
+priority aging and conservative serial fallback on missing/stale telemetry.
+Pressure should stop new admissions, not kill admitted work. Require a
+stable recovery interval before increasing capacity again.
+
+Acceptance tests must cover actual overlap, pressure deferral, concurrent
+reservation races, fairness, isolated cancellation, restart recovery and
+unverified exit. Measure queue delay, completion rate, CPU/memory pressure,
+token consumption and coordinator latency before changing any live ceiling.
+
+## Ownership boundaries
+
+The visibility change adds a workload projection and disclosure alongside
+the existing specialist link. Navigation order, project threads, specialist
+drawer behavior and service failover (`tkmngyab7pyj`) are not changed.
+No cross-task coordination was available during this step. The sidebar
+simplification owner should preserve the projection and disclosure if moving
+the specialist rows. Counts reflect reported current steps, not provider
+process counts; missing hold reasons are shown as waiting to start rather
+than attributed to resources without evidence.
+
+The existing Tasks API returns a bounded recent-task list. The disclosure
+explicitly labels its counts as recent tasks rather than claiming a global
+runner inventory. Expansion is retained across sidebar stream refreshes.
+
+Validation: Go formatting completed. Focused Go tests were attempted but
+could not download dependencies under the network sandbox; the escalation
+request was rejected. These tests are added but have not been executed.
diff --git a/internal/equipo/copy.go b/internal/equipo/copy.go
index c5db7f2d..8e5f19c3 100644
--- a/internal/equipo/copy.go
+++ b/internal/equipo/copy.go
@@ -1485,9 +1485,13 @@ var pageCopy = map[string]string{
"conversation.sending": "Sending",
// COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context): conversation.retry
"conversation.retry": "Retry",
- "conversation.send_short": "Send", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
- "nav.queued": "queued", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
- "nav.switch": "switch", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
+ "conversation.send_short": "Send", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
+ "nav.queued": "queued", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
+ "nav.switch": "switch", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
+ "nav.work.counts": "Recent tasks: %d running · %d queued",
+ "nav.work.waiting": "Queued, waiting to start",
+ "nav.work.queued": "queued",
+ "nav.work.running": "running",
"nav.idle": "idle", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
"nav.waiting": "waiting", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
"conversation.placeholder": "Message", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
diff --git a/internal/equipo/rail.go b/internal/equipo/rail.go
index 71d5fc35..e015ec83 100644
--- a/internal/equipo/rail.go
+++ b/internal/equipo/rail.go
@@ -36,7 +36,10 @@ type railSpecialist struct {
Task *wire.Task
Step *wire.Step
// Now is the step's newest activity line in plain words.
- Now string
+ Now string
+ Work []specialistWork
+ Running, Queued int
+ Known bool
}
// railCount is a quiet count: shown only above zero, "Unavailable" when
@@ -80,7 +83,7 @@ func (a *application) rail(ctx context.Context, person string) railView {
n++
if s := len(k.Steps); s > 0 {
st := k.Steps[s-1]
- if st.State == wire.StepRunning {
+ if st.State == wire.StepRunning && st.Hold == nil {
working[st.Specialist] = append(working[st.Specialist], k)
}
}
@@ -109,6 +112,10 @@ func (a *application) rail(ctx context.Context, person string) railView {
}
for _, s := range specialistRail {
line := railSpecialist{Key: s.specialist, Icon: s.icon, CopyKey: s.copyKey}
+ line.Known = err == nil
+ if line.Known {
+ line.Work, line.Running, line.Queued = specialistWorkload(tasks.Items, s.specialist)
+ }
if ks := working[s.specialist]; len(ks) > 0 {
k := ks[0]
st := k.Steps[len(k.Steps)-1]
diff --git a/internal/equipo/specialist_work.go b/internal/equipo/specialist_work.go
new file mode 100644
index 00000000..b4a332b9
--- /dev/null
+++ b/internal/equipo/specialist_work.go
@@ -0,0 +1,45 @@
+package equipo
+
+import (
+ "amadan.net/oficina/equipo/internal/equipo/chat"
+ "amadan.net/oficina/equipo/internal/wire"
+)
+
+// specialistWork is a projection of reported state, not an estimate of
+// provider activity. A hold always wins over a running report.
+type specialistWork struct {
+ ID, Title, State, Line string
+}
+
+func specialistWorkload(tasks []wire.Task, specialist string) (work []specialistWork, running, queued int) {
+ for _, k := range tasks {
+ if wire.FinalStage(k.Stage) || len(k.Steps) == 0 {
+ continue
+ }
+ s := k.Steps[len(k.Steps)-1]
+ if s.Specialist != specialist || (s.State != wire.StepRunning && s.State != wire.StepQueued) {
+ continue
+ }
+ w := specialistWork{ID: k.ID, Title: k.Title, State: s.State}
+ if s.Hold != nil {
+ w.State = wire.StepQueued
+ w.Line = holdOf(s, false, chat.HoldLabel(nil, nil, "", "", s.Hold.Provider)).Line
+ } else if s.State == wire.StepQueued {
+ // The instance cannot know whether this is local resource
+ // pressure, another attempt, or placement. Do not invent a cause.
+ w.Line = copyText("nav.work.waiting")
+ } else {
+ w.Line = copyText("work.activity.working")
+ if n := len(s.Activity); n > 0 {
+ w.Line = humaneActivity(s.Activity[n-1])
+ }
+ }
+ if w.State == wire.StepRunning {
+ running++
+ } else {
+ queued++
+ }
+ work = append(work, w)
+ }
+ return
+}
diff --git a/internal/equipo/specialist_work_test.go b/internal/equipo/specialist_work_test.go
new file mode 100644
index 00000000..28a76013
--- /dev/null
+++ b/internal/equipo/specialist_work_test.go
@@ -0,0 +1,44 @@
+package equipo
+
+import (
+ "bytes"
+ "strings"
+ "testing"
+
+ "amadan.net/oficina/equipo/internal/wire"
+)
+
+func TestSpecialistWorkload(t *testing.T) {
+ task := func(id, role, state string) wire.Task {
+ return wire.Task{ID: id, Title: id, Steps: []wire.Step{{Specialist: role, State: state}}}
+ }
+ tasks := []wire.Task{
+ task("one", wire.SpecialistEngineering, wire.StepRunning),
+ task("two", wire.SpecialistEngineering, wire.StepRunning),
+ task("three", wire.SpecialistEngineering, wire.StepQueued),
+ task("held", wire.SpecialistEngineering, wire.StepRunning),
+ task("review", wire.SpecialistReview, wire.StepRunning),
+ task("finished", wire.SpecialistEngineering, wire.StepRunning),
+ task("old-step", wire.SpecialistEngineering, wire.StepRunning),
+ }
+ tasks[3].Steps[0].Hold = &wire.StepHold{Reason: wire.HoldBudget}
+ tasks[5].Stage = wire.StageDone
+ tasks[6].Steps = append(tasks[6].Steps, wire.Step{Specialist: wire.SpecialistReview, State: wire.StepQueued})
+ work, running, queued := specialistWorkload(tasks, wire.SpecialistEngineering)
+ if running != 2 || queued != 2 || len(work) != 4 {
+ t.Fatalf("work=%+v running=%d queued=%d", work, running, queued)
+ }
+ if work[3].State != wire.StepQueued || !strings.Contains(work[3].Line, "budget") {
+ t.Fatalf("held work: %+v", work[3])
+ }
+ var out bytes.Buffer
+ view := railView{Specialists: []railSpecialist{{Key: "engineering", CopyKey: "nav.engineering", Icon: "code", Known: true, Work: work, Running: running, Queued: queued}}}
+ if err := pages["conversation"].ExecuteTemplate(&out, "rail-specialists", view); err != nil {
+ t.Fatal(err)
+ }
+ for _, want := range []string{"2 running · 2 queued", "<details", "/tasks/one", "/tasks/two", "/tasks/three", "/tasks/held", `data-work-state="queued"`} {
+ if !strings.Contains(out.String(), want) {
+ t.Fatalf("missing %q: %s", want, out.String())
+ }
+ }
+}
diff --git a/internal/equipo/static/equipo.css b/internal/equipo/static/equipo.css
index 2e2f0135..5e71e17b 100644
--- a/internal/equipo/static/equipo.css
+++ b/internal/equipo/static/equipo.css
@@ -807,6 +807,11 @@ a[equipo-source]:hover { color: var(--rst-text); text-decoration: underline; tex
mark and clock; line two, while it works, the task's title and what
it is doing in plain words. Idle is one muted word. */
[rst-shell-sidebar] [rst-shell-nav] > a[equipo-spec] { display: grid; grid-template-columns: 1em minmax(0, 1fr) auto .75em; align-items: center; column-gap: var(--rst-sp-2); row-gap: 1px; padding-block: .4rem; color: var(--rst-text-muted); }
+[equipo-spec-work] { padding: var(--rst-sp-2); font-size: .8rem; color: var(--rst-text-muted); overflow-wrap: anywhere; }
+[equipo-spec-work] > summary { cursor: pointer; }
+[equipo-spec-work] ul { padding-inline-start: 1rem; }
+[equipo-spec-work] li { margin-block: var(--rst-sp-2); }
+[equipo-spec-work] p { margin-block: .25rem; }
[equipo-spec] > .icon { inline-size: 1em; block-size: 1em; margin: 0; }
[equipo-spec] > .icon:last-of-type { inline-size: .75em; block-size: .75em; color: var(--rst-text-faint); transition: transform .2s var(--equipo-ease, ease), color .2s ease; }
[equipo-spec]:hover > .icon:last-of-type, [equipo-spec]:focus-visible > .icon:last-of-type { color: var(--rst-text-muted); transform: translateX(2px); }
diff --git a/internal/equipo/static/nav-stream.js b/internal/equipo/static/nav-stream.js
index 765b7d57..b9b13af7 100644
--- a/internal/equipo/static/nav-stream.js
+++ b/internal/equipo/static/nav-stream.js
@@ -80,10 +80,13 @@
if (!next) return;
var before = doing(), focus = document.activeElement && rail.contains(document.activeElement) ? document.activeElement.id || "" : "";
var sparks = {};
+ var expanded = {};
+ rail.querySelectorAll("[equipo-spec-work][open]").forEach(function (d) { expanded[d.id] = true; });
rail.querySelectorAll("[equipo-spec] [data-spec-star] [data-live]").forEach(function (s) { sparks[s.closest("[equipo-spec]").id] = s; });
// Rendered after the event that asked for it, so never older.
rail.dataset.cursor = next.dataset.cursor;
rail.innerHTML = next.innerHTML;
+ rail.querySelectorAll("[equipo-spec-work]").forEach(function (d) { d.open = !!expanded[d.id]; });
Object.keys(sparks).forEach(function (id) {
var slot = document.querySelector("#" + id + " [data-spec-star]");
if (slot) slot.replaceChildren(sparks[id]);
diff --git a/internal/equipo/templates/chrome.html b/internal/equipo/templates/chrome.html
index f31baf5d..3997ca47 100644
--- a/internal/equipo/templates/chrome.html
+++ b/internal/equipo/templates/chrome.html
@@ -14,7 +14,8 @@
</nav>{{end}}
{{define "rail-count"}}{{if not .Known}}<small equipo-count data-count>{{copy "counts.unavailable"}}</small>{{else if .N}}<small equipo-count data-count>{{.N}}</small>{{end}}{{end}}
{{define "rail-count-attention"}}{{if not .Known}}<small equipo-count data-count>{{copy "counts.unavailable"}}</small>{{else if .N}}<small equipo-count data-count data-attention>{{.N}}</small>{{end}}{{end}}
-{{define "rail-specialists"}}<p equipo-nav-group>{{copy "nav.specialists"}}</p>{{range .Specialists}}{{$s := .}}<a equipo-spec id="nav-{{.Key}}" href="/team/{{.Key}}" data-team-open data-specialist="{{.Key}}" data-state="{{if .Task}}working{{else}}idle{{end}}">{{icon .Icon}}<span equipo-spec-name>{{copy .CopyKey}}</span><span equipo-spec-state>{{if .Task}}{{with .Step}}{{if gt .Attempt 1}}<span equipo-spec-attempt>{{printf (copy "nav.attempt") .Attempt}}</span>{{end}}{{end}}<span data-spec-star>{{template "mark" "s"}}</span>{{with .Step}}{{template "elapsed" .StartedAt}}{{end}}{{else}}{{copy "nav.idle"}}{{end}}</span>{{icon "chevron-right"}}{{with .Task}}<span equipo-spec-now data-step="{{with $s.Step}}{{.ID}}{{end}}" title="{{.Title}} · {{$s.Now}}"><span equipo-nav-task>{{.Title}}</span><span equipo-spec-doing>{{$s.Now}}</span></span>{{end}}</a>
+{{define "rail-specialists"}}<p equipo-nav-group>{{copy "nav.specialists"}}</p>{{range .Specialists}}{{$s := .}}<a equipo-spec id="nav-{{.Key}}" href="/team/{{.Key}}" data-team-open data-specialist="{{.Key}}" data-state="{{if .Task}}working{{else if .Queued}}queued{{else}}idle{{end}}">{{icon .Icon}}<span equipo-spec-name>{{copy .CopyKey}}</span><span equipo-spec-state>{{if .Task}}{{with .Step}}{{if gt .Attempt 1}}<span equipo-spec-attempt>{{printf (copy "nav.attempt") .Attempt}}</span>{{end}}{{end}}<span data-spec-star>{{template "mark" "s"}}</span>{{with .Step}}{{template "elapsed" .StartedAt}}{{end}}{{else if .Queued}}{{copy "nav.work.queued"}}{{else}}{{copy "nav.idle"}}{{end}}</span>{{icon "chevron-right"}}{{with .Task}}<span equipo-spec-now data-step="{{with $s.Step}}{{.ID}}{{end}}" title="{{.Title}} · {{$s.Now}}"><span equipo-nav-task>{{.Title}}</span><span equipo-spec-doing>{{$s.Now}}</span></span>{{end}}</a>
+{{if .Known}}<details equipo-spec-work id="work-{{.Key}}"><summary id="work-summary-{{.Key}}">{{printf (copy "nav.work.counts") .Running .Queued}}</summary><ul>{{range .Work}}<li data-work-state="{{.State}}"><a href="/tasks/{{.ID}}">{{.Title}}</a><p>{{copy (printf "nav.work.%s" .State)}} · {{.Line}}</p></li>{{end}}</ul></details>{{end}}
{{end}}{{end}}
{{define "region:notice"}}<div id="notice" role="status"></div>{{end}}
{{define "profile"}}{{if .Address}}<span rst-person-av aria-hidden="true">{{icon "users"}}</span><span rst-person-name>{{.Address}}</span>{{else}}<span rst-person-av="empty placeholder" aria-hidden="true"></span><span rst-person-name>{{copy "nav.account"}}</span>{{end}}{{end}}