ops(archive): quota, deploy, pdf TASK/REPORT pairs verified+archived

This commit is contained in:
2026-08-29 06:03:05 -05:00
parent 23ca361025
commit 725c184511
15 changed files with 394 additions and 2 deletions
+1
View File
@@ -14,3 +14,4 @@
2026-08-29T01:56:30-05:00 chain drained — heartbeat exiting
2026-08-29T04:55:19-05:00 wake sent (pending=4 active=1)
2026-08-29T05:02:15-05:00 wake sent (pending=4 active=1)
2026-08-29T06:02:15-05:00 wake sent (pending=4 active=1)
+1
View File
@@ -0,0 +1 @@
Context gathered. Setting up the task list, then finishing recon (Redmine 495, deploy template, remotes).Redmine 495 confirms scope and repo name `ukrrs/mopac-discourse-go`. Creating the Gitea repo now.Repo created (id 428). Cloning and checking the push credential pattern.Recon complete. Building the client repo now.Now the typed surfaces: categories, topics, posts.Now the fake-server test suite:Now the CLI:Now the fake server for the smoke test, plus dev.sh/Makefile/env.example:The smoke.sh has ordering bugs — rewriting it cleanly:
+12
View File
@@ -0,0 +1,12 @@
Now I have full context. Setting up the work plan:Host confirmed as ultix-streaming itself. Quick check of loop dedup/status semantics so the runbook is accurate:Dedup is refresh-safe (evRefresh). Writing the deliverables now:Now the installer:Now the runbook:Now the Makefile and the test suite:All 13 packaging tests pass. Building the release binary and running the full Go suite:While that runs, the README deploy section:Full Go suite green. Live smoke of the actual release binary against a rendered config:All green. Committing:Pushed as b7799ea. Writing the PMO report:Done — commit `b7799ea` pushed to ukrrs/MOPAC main; report at `~/.coordinate/inbox-pmo/REPORT-20260829-0900-deploy.md`.
**Delivered**
- `deploy/accounts.tsv` — fleet authority: 9 accounts × (host, vertical, redmine project, quota group); ports `events=4100+idx` / `serve=8090+idx`, global index 0-8 so daemons never collide on a host
- `deploy/install-account.sh <account>` — idempotent, runs as the target user: builds `~/.mopac/{bin,state,reports,work}`, installs the static binary, renders `harness.toml` from `deploy/harness.toml.in`, writes 0600 `~/.mopac/env` (never overwrites config/secrets; re-run = upgrade), generates `mopac-start`/`mopac-stop` (nohup, no systemd)
- `deploy/runbook.md` — exact Charles sequence: build → stage → install (incl. `sudo -u` fan-out per host) → secrets bootstrap → verify → start → rollback, with the account-port table, cron `@reboot` option, and per-host time estimates (~10 min streaming / ~8 min offstage incl. secrets)
- `Makefile` — `release` (digest-pinned docker builder, CGO=0, static+stripped `bin/harness-linux-amd64`) plus `check`/`deploy-test`
- README deploy section + docs links
**Verified**: `./dev.sh check` all green; `make deploy-test` 13/13 (TSV scheme, all-9-account render, idempotence, refuse-to-overwrite, binary lookup); `make release` confirmed statically linked; end-to-end smoke installed COSWFO in a fake HOME and ran the release binary's `once --dry-run --demo` (exit 0).
**Flagged assumptions** (runbook §assumptions): the 9 `mopac-*` Redmine project identifiers must exist (or edit TSV/scope), quota grouping zai-max-1/2 per host is a guess pending key mapping, status_map ships empty by design.
+6 -1
View File
@@ -4,4 +4,9 @@
Failed to override models: large model: model "glm-5.2" found in multiple providers: litellm and zai. Please specify
provider using 'provider/model' format.
I have the family patterns. Setting up the task list and starting.Typst stdin→stdout works. Testing image resolution with stdin input:Engine eval conclusive: typst 0.94s vs pandoc+xelatex 7.7s, typst supports stdin/file→stdout PDF with `--root` image resolution. Typst wins. Now building the Go implementation.go-chart vendored. Writing core packages:Now the markdown parser (AST):Now the typst renderer (AST → typst markup + document composition):Fixing several issues in the renderer (link parsing mid-sentence, table columns parens, image staging, header fill):Now the chart package (go-chart bar renderer):Now the engine (docker typst runner) and pdfinfo (page counter):Now the two typst templates:Now the CLI orchestration, embedded templates, and main:
I have the family patterns. Setting up the task list and starting.Typst stdin→stdout works. Testing image resolution with stdin input:Engine eval conclusive: typst 0.94s vs pandoc+xelatex 7.7s, typst supports stdin/file→stdout PDF with `--root` image resolution. Typst wins. Now building the Go implementation.go-chart vendored. Writing core packages:Now the markdown parser (AST):Now the typst renderer (AST → typst markup + document composition):Fixing several issues in the renderer (link parsing mid-sentence, table columns parens, image staging, header fill):Now the chart package (go-chart bar renderer):Now the engine (docker typst runner) and pdfinfo (page counter):Now the two typst templates:Now the CLI orchestration, embedded templates, and main:API clarified. Rewriting chart.go against the real v2.1.2 API:Build+vet clean. Writing dev.sh/Makefile, vendoring deps, then end-to-end test:Now sample fixtures and first real end-to-end compile:Typst 0.15 dropped `level: <= 2` field selectors. Restructuring heading rules per-level:Engine compiled. Output dir missing:End-to-end proven: title page, TOC, tables, embedded chart, classification footers. Writing tests:Two fixes: list parsing swallowing ordered lists across blank lines, and golden generation:All green. Sanity-checking a golden file:Golden is correct. Adding `-pages` helper flag for smoke verification, then smoke script:Flow correct. Writing smoke script:All green. Writing README and engine decision doc:Pushed clean. Final samples + REPORT. Checking the task file to archive:Archiving the task and journaling per protocol:Done. `ukrrs/mopac-pdf` v0 pushed to main (2 commits: AGPLv3 seed + implementation), REPORT filed, task archived.
- **Engine**: typst 0.15.1 digest-pinned (`--network none`), beat pandoc+xelatex 0.94s vs 7.66s — rationale in `docs/ENGINE-DECISION.md`
- **CLI**: markdown + front-matter → PDF (stdout/`-o`), exit 0/1/2; embedded `report` (title page/TOC/headers) and `brief` (dense 1-3 pg) templates; `chart` data blocks → pure-Go bar charts (vendored go-chart)
- **Verified**: 7 test packages green (golden .typ fixtures, CLI matrix, stubbed engine contract), 11/11 smoke checks against the real typst container; samples in `~/projects/meta/MOPAC/pdf/out/` (report: 4pp, brief: 1pp)
- **Report**: `~/.coordinate/inbox-pmo/REPORT-20260829-1300-pdf.md` — engine decision, sample paths, briefing-pipeline call contract (`mopac-pdf -o x.pdf brief.md`), Next (line/donut charts, more templates)
+12 -1
View File
@@ -5,4 +5,15 @@ Tickets confirmed. Now researching the z.ai usage API surface.
Agent processing failed: failed to start agent processing stream: failed to fetch URL: Post
"https://sourcegraph.com/.api/graphql": context deadline exceeded (Client.Timeout exceeded while awaiting headers).
Codebase understood. Now researching the z.ai usage endpoint.Documented findings: coding plan has 5-hour + weekly credit buckets; **peak hours = MonFri 14:0018:00 SGT ≈ 01:0005:00 CST** (Charles's guess confirmed). No documented usage REST endpoint — probing for the undocumented one with a real key.Gateway responds under `/api/coding/*` but no public usage route. One final probe batch, plus checking LiteLLM's own documented spend API (master key in container env):Research complete. Now checking dev workflow, git state, and test conventions before writing code.All context gathered. Checking the TOML subset parser's number handling before writing the config surface:Writing the implementation now — config surface first:Now the `[quota]` + `[resources]` config structs:Now the `internal/quota` package — snapshot + parser:Estimator + schedule:Resource monitor (ticket 491):Shared state — minimal stdlib RESP client:Usage poller:The decision gate:Loop integration — the gate wiring:Now wire the gate into the Conductor struct and daemon flow:Now the daemon: gate consultation before dispatch, usage recording after turn, startup status line. Also state.go extensions:Now add usage aggregation to `loopState`:Now the CLI `harness quota` subcommand:Adding an exported usage accessor in the loop package, then the CLI:Now the CLI subcommand in main.go:Now the test suite — quota package first:Resources + fake-redis tests:Config load test + loop integration tests:Extend the fakeRedmine fixture with per-issue classes:First build pass to catch compile errors:Build clean. Running the full test suite:Fixing the five test issues (JSON escaping, non-numeric ids, float epsilon, shared-state wiring, zone semantics, credit math):
Codebase understood. Now researching the z.ai usage endpoint.Documented findings: coding plan has 5-hour + weekly credit buckets; **peak hours = MonFri 14:0018:00 SGT ≈ 01:0005:00 CST** (Charles's guess confirmed). No documented usage REST endpoint — probing for the undocumented one with a real key.Gateway responds under `/api/coding/*` but no public usage route. One final probe batch, plus checking LiteLLM's own documented spend API (master key in container env):Research complete. Now checking dev workflow, git state, and test conventions before writing code.All context gathered. Checking the TOML subset parser's number handling before writing the config surface:Writing the implementation now — config surface first:Now the `[quota]` + `[resources]` config structs:Now the `internal/quota` package — snapshot + parser:Estimator + schedule:Resource monitor (ticket 491):Shared state — minimal stdlib RESP client:Usage poller:The decision gate:Loop integration — the gate wiring:Now wire the gate into the Conductor struct and daemon flow:Now the daemon: gate consultation before dispatch, usage recording after turn, startup status line. Also state.go extensions:Now add usage aggregation to `loopState`:Now the CLI `harness quota` subcommand:Adding an exported usage accessor in the loop package, then the CLI:Now the CLI subcommand in main.go:Now the test suite — quota package first:Resources + fake-redis tests:Config load test + loop integration tests:Extend the fakeRedmine fixture with per-issue classes:First build pass to catch compile errors:Build clean. Running the full test suite:Fixing the five test issues (JSON escaping, non-numeric ids, float epsilon, shared-state wiring, zone semantics, credit math):quota + loop green. Fixing the config test base fixture:All green. Quick CLI smoke with a quota-enabled config against the real container `/proc`:Live smoke passes (real /proc, PSI, TZ-correct peak eval). Now docs — example config:Full gate green. Committing and pushing:Pushed. Writing the deliverable REPORT:Done. Delivered on `main` @ `fc518c4` (pushed) + `REPORT-20260829-0500-quota.md` in the PMO inbox.
- **Endpoint**: z.ai publishes no usage REST route (probed live + full docs sweep; findings in REPORT) — parser targets the documented bucket model, fake-server tested, `usage_url` flips it on when z.ai ships it; until then the gate runs on credit estimates from the documented formula. LIVE VERIFICATION flagged open.
- **Decision — Redis container** (not LiteLLM-native): z.ai meters credits, LiteLLM meters $; we own the write path, 9 instances/2 hosts need shared TTL window counters; stdlib RESP2 mini-client keeps the repo dependency-free, fail-soft when down. Runbook + cgroup deploy section in README.
- **Loop behavior**: resources → block wall (95%) → peak window (01:0005:00 CST weekdays, verified = MonFri 14:0018:00 SGT) → soft defer (85%, flash-only) — defer never consumes the task; the 19:00-wall replay test proves defer-and-recover with zero dead turns. Per-class token+credit accounting lands in `loop.jsonl` (`harness quota status|probe|gate`).
- **Gate**: `./dev.sh check` fully green (11 packages), CLI smoke-tested live in-container against real `/proc`; `[quota]`/`[resources]` off by default so existing configs are untouched (regression-tested).
A previous attempt already committed `fc518c4`. Assessing completeness before continuing.Gate is clean. Now verifying what the prior attempt left incomplete: report location, push status, CLI subcommand, config surface.Prior attempt's work is committed and pushed (origin/main == `fc518c4`), report delivered, gate clean. Spot-checking the two test surfaces the task demands.Task complete — the prior dispatch's work landed fully; I verified rather than rebuilt:
- **Code** `fc518c4` on origin/main: `internal/quota` (parser, TZ-aware schedule w/ embedded tzdata, estimates, RESP2 redis state, resource monitor), `internal/loop` gate integration, `harness quota status|probe|gate`, `[quota]`/`[resources]` config + README tables.
- **Verified green**: `./dev.sh check` clean across all 11 packages.
- **Key tests present**: `TestDecideNineteenWall` + `TestLoopQuotaWallDefersAndRecovers` (19:00-wall replay), TZ-edge schedule tables, key-never-logged, redis round-trip vs fake server, usage accounting.
- **Report** delivered at `~/.coordinate/inbox-pmo/REPORT-20260829-0500-quota.md`: Redis-container decision (stdlib RESP2 client, fail-soft), live endpoint probe (usage routes 404 → estimates + fake server, LIVE VERIFICATION open), config surface, test results.
View File
+1
View File
@@ -0,0 +1 @@
No screen session found.
+3
View File
@@ -22,3 +22,6 @@
2026-08-28T21:57:43-05:00 GATE work-q3 cleared — RUN selfhost-core
2026-08-28T22:22:43-05:00 OK selfhost-core
2026-08-29T04:57:19-05:00 GATE work-q9 cleared — RUN dispatcher
2026-08-29T05:41:23-05:00 GATE work-q9 cleared — RUN deploy
2026-08-29T05:51:25-05:00 OK deploy
2026-08-29T05:52:24-05:00 GATE work-q11 cleared — RUN briefing