ThinkingCap
ThinkingCap Research And Development CapCom Tooling Candidates for Deterministic Software

Candidates for Deterministic Software

Published 2026-09-15 Updated 2026-11-09 ThinkingCap
Research And Development

Candidates for Deterministic Software

What the agents keep doing by hand — and what should become tools

Status 2026-09-09: Wave 0 (the Refire Mechanism, §2) is LIVE — invocation hooks wired into both Claude + Kimi settings, ledger at ~/agent-ops/ledger.jsonl, nightly repeat detector (cron 04:37) publishing ~/agent-ops/candidates.md. Waves 1+ land in ~/agent-ops/bin/ as signatures cross the threshold.

Date: 2026-09-08 Prepared by: Claude (kimi-k3), at Douglas's request Corpus reviewed: 831 Kimi session transcripts (1.2 GB JSONL), 1,160 Claude session transcripts (102 MB), 368 memory files, full cron/systemd automation inventory. All staff sessions (Douglas, Campbell, Sejal, Smarandita, Radu, Cal, Cynthia, Isobel, Lia).


1. The thesis

Every day the agents do dev-grade work by hand: push to git, file and update Issue Manager tickets, run UPDATEs against client databases, build ACR images, email exports. Each time, the mechanics are re-derived from scratch — the same base64→docker-cp→docker-exec incantation, the same closeout SQL, the same nodemailer boilerplate — rebuilt in /tmp, run once, and lost.

The measured scale of re-derivation, from the transcript census:

Pattern (sessions containing it)Kimi (831)Claude (1,160)
UPDATE/INSERT SQL790279+
KB drafts (kb_draft_save)789—
SES / email sends65140 (nodemailer)
srv bare pushes52027 (git push)
worker_types metadata edits458—
az vm run-command51679
docker exec / docker cp41055
SAS link generation378—
capcom2 .cjs bridge (base64→cp→exec)349(same recipe, older corpus)
xlsx export builds29116
az acr build11169
systemctl restarts29318

Tool-call census (Kimi): capcom MCP 7,057 calls (postgres SQL 3,495, sqlserver SQL 1,081), github_* 2,870 combined, issue_sql 672, pg_sql 406, exec 1,150.

Operating rule (Douglas's directive): an agent does a thing one-off only until we know it's a repeating task. Then it graduates. The rest of this document is (a) the mechanism that detects repeats and fires the graduation, and (b) the ranked candidate list the review found.


2. The Refire Mechanism (candidate #0 — build this first)

Finding from the automation audit: nothing on this box logs agent task invocations. No hooks in any settings.json (Claude or Kimi), no task ledger. The closest existing pieces are teamCollectPush.ts (05:10 cron, ships session digests to capcom for the 06:00 review) and dirkGitPush.ts (05:20, commits). Session-level, not action-level. The refire loop has no sensor.

Proposed design

ACT                     SENSE                    DETECT                     GRADUATE
agent does task   →   hook appends to      →   nightly counter finds   →   script/tool built,
by hand (1st,         agent_ops_ledger          signatures seen              signature next fires
2nd time)             (one JSON line per        ≥3× in ≥2 sessions           the TOOL, not the agent
                      mutating call)                                         (refire)
  1. Ledger. A PostToolUse hook in ~/.claude/settings.json and ~/.claude-kimi/settings.json appends one JSON line per operational call to ~/agent-ops/ledger.jsonl: {ts, session, user, tool, signature, params_hash, target}. The signature is the normalized task name — capcom2-exec, im-ticket-response, srv-push, ses-send, acr-build, queue-refire — derived by a small deterministic mapper (tool name + command head + target host/queue/db). Params are hashed, never stored raw (credentials stay out).
  2. Repeat detector. Nightly cron (piggyback the 05:10 team-collect) runs detect-repeats.py: counts per signature over a trailing 30 days, emits candidates.md — "seen N times in M sessions by K users, last seen <date>". Threshold: N ≥ 3 in ≥ 2 sessions → flag for graduation. Also watches for new signatures crossing the threshold, so the list grows continuously — this is the "grow new software continuously" part.
  3. Graduation states. Every task is in exactly one state:
    1. one-off — agent does it inline (novel work, debugging, judgment).
    2. repeat-detected — ledger flagged it; a script gets written to ~/agent-ops/bin/ with a real CLI contract (flags, --dry-run default, exit codes).
    3. standing tool — promoted to a versioned home (tc-agent-ops repo or capcom listActions()), callable by any agent or fired by cron/queue/webhook. The agent's job becomes parsing the request into the tool's parameters and validating the result.
  4. Refire. Each standing tool declares its trigger: manual (CLI), cron <schedule>, queue <name> (a capcom queue message fires it), or webhook <path>. Repeat incidents then refire the tool — no agent re-derivation. The auto-attendant SOP model and the data-cartographer daemon are the existing proofs this works.

Effort: ledger hook + mapper ≈ 1 day. Detector ≈ half a day. The tools below are the backlog it will drain.


3. The candidate catalog

Ranked by (frequency × determinism × pain). Each entry: what agents do by hand today → the proposed deterministic form, its input contract, and its refire trigger. Graduation status: ad-hoc (rebuilt every time) / recipe (documented in memory, still hand-run) / scripted (exists, scattered) / automated (no agent involved).


P0 — Universal substrate (used by nearly every session)

1. run-in-capcom2 — remote script bridge — ad-hoc, 349 Kimi sessions, ~20 memory recipes

2. client-sql — client database resolver + query runner — ad-hoc, spine of all ticket work (790 sessions w/ DML)

3. srv-push — the git closeout that ends every coding task — ad-hoc, 520 sessions

4. im-ticket — Issue Manager closeout ceremony — recipe, ~20 tickets in 3 weeks, 87 ticket-session files

5. send-ses-mail + blob-sas — email and large-attachment delivery — recipe (3 overlapping memories), 651 sessions


P1 — High-frequency recipes

6. xlsx-export — query → workbook → delivery — recipe, 291 sessions, scripts deliberately ephemeral in /tmp

7. queue-refire — job re-enqueue / dual-write ingress — recipe+scripts, used across scormapi / priority-notifications / reportrequests / rolluplps / queuejobs

8. vm-docker-redeploy + live-roll-unblock — hand-roll & pin-move — recipe (3+ memories), ~12 hand-rolls in 4 weeks

9. acr-build-tag-bump — build → tag check → worker_types metadata — ad-hoc, 111 sessions (az acr build), 458 touching worker_types

10. control-flip — compliance control status + audit row — recipe, ~6 flip events incl. a 16-control batch

**11. Fleet/shift-start status report — recipe, designed for daily, never cronned**

12. new-dbscript — LMS migration scaffolder — convention, dozens of uses


P2 — Campaign-grade kits (partially scripted — formalize, don't rewrite)

13. Report-worker optimization harness — playbook + per-report /tmp harnesses, ~10 report repos in 2 weeks

14. Split/carve kit — scripted, scattered (~/tc-report-split/, carve-worker.sh, onboard CSVs, request-fix-ci.sh)

15. Credbroker rollout driver — scripted (/tmp/wire/*.py went 14/14 hands-off), ~250+ services wired

16. Surface scaffold/onboard — scripted (scaffold.sh, sync-bridge.sh, ONBOARDING.md), ~26 instances

17. Failed-job triage — partially scripted (bgjobs-rerun.sh), 754-ticket triage 09-01

18. TinyAward PG reload — runbook + scripts, 4 runs ("Campbell asks each time")

19. Metadata-fields extraction — scripted, client-parameterized; ARCA gate GREEN

20. Monitor templates — ad-hoc per concern


P3 — Hygiene & glue

21. Shared-clone git guard — ~/capcom hosts ~32 concurrent sessions; 3 clobber incidents in 10 days. A wrapper (or pre-push hook) enforcing pathspec-only commits + git show --stat verify + fetch-rebase-before-push. Subsumed by candidate 3 if srv-push is mandatory there.

22. Deliverables router — deliver --to <person> <file> encoding the rules now kept in 3 memory files: /media/shared/<TheirName>/ via sudo cp (never For-Douglas for others), Liam compliance docs → claudexfer (md draft + PDF), Liam transcripts → claudexfer sessions/ only. Misrouted twice this month.

23. TCOV schema trio lint+upload — schema-publish <dir>: lint via POST /api/schema/lint, validate Draft 2020-12 + sample, upload trio to tcsettings/schemas with the layout rules (no extra prefixes, category match), drift check local-vs-Azure. 88 sessions touched schema lint/upload.

24. Disk-sweep stale-clone rule — hourly housekeeping is automated, but the 09-08 manual sweep freed 142 GB from stale clones the script doesn't cover. Add the SAFE-to-delete rule (clean porcelain + no unpushed vs git ls-remote srv + tar-before-delete) to the timer.

25. Front Door cert rotation helper — cert-rotate <domain> writing the tls_certificates/cert_deploy_jobs rows in the audited shape + post-propagation re-probe (apex ~45 min). Partially daemonized already.

26. Loom git-ops — loom-git <loom> <op>: temp-clone merge, push, reset --hard in loom clone, npm ci. Recipe-documented, 4+ uses.


4. Already graduated (proof the model works — do not re-propose)

~48 active cron entries + 4 custom systemd timers on this box, all built by prior agent work:

Automated taskTrigger
~32 compliance evidence pipelines (collect → publish-to-capcom)daily crons 03:30–08:45
VM-02/VM-05 vuln collectors, trivy (VMs + ACR), Semgrep sweepdaily/weekly
PI suite + PI-03-1 quarterly collectordaily 06:45 / quarterly
suspend_data truncator (XML-shred)weekly Sun 02:00 systemd
Lingoda review-notes export → SESmonthly 13 8 1 * *
team session collect (05:10) + review (06:00); dirk git push (05:20)daily
dirk brief 06:30, crew-nightly 03:17, compliance digest + obligations-nagdaily/weekly
devops-checks bucket (disk alerts/cleanup); disk housekeepinghourly
IM mirror syncdaily 05:00
capgpt on-prem indexdaily 02:30 systemd
Auto Attendant SOP execution (autonomous remediation)60 s event poll
data cartographer daemon (scan + onboard-on-build)15 min incremental
baker builds + capcom web self-deployper-push CI
DevOps monthly reportFriday-gated cron

Found broken during the audit (fix while here): gdpr35-privacy-vendors cron points at a refresh-and-publish.sh that no longer exists on disk; mother-vision.timer is a dangling symlink (unit file deleted).


5. What must NOT be codified

The boundary of the model. Agents keep: novel root-cause debugging (every deadlock, plan-lottery, and CPU cliff was different), first-instance ticket investigation, schema authoring (judgment about the domain), incident command (the watcher/dump/rollback tools get codified; the decisions don't), and anything touching credentials policy or the operator deploy gate. The rule is: judgment stays with the agent; mechanics graduate to software.

The operator deploy gate itself is not a candidate. It appeared in ~60 memory entries and 32/40 recent sessions — it is policy, not missing tooling. What the candidates do is shrink everything up to the gate so the gate is the only manual step left.


6. Proposed build order

WaveItemsWhy first
0Refire Mechanism (ledger hook + repeat detector)The sensor; without it this list is a snapshot, not a process
11 run-in-capcom2, 2 client-sql, 3 srv-push, 5 send-ses-mail+blob-sasSubstrate everything else calls; kills credential-in-transcript exposure
24 im-ticket, 6 xlsx-export, 7 queue-refire, 11 fleet-status cronHighest-frequency ceremonies; #11 is two cron lines
38, 9, 10, 12Incident/deploy mechanics
413–20 campaign kitsFormalize, mostly not rewrite
521–26 hygieneAs touched

Each wave ships with its signature registered in the ledger mapper, so the detector measures the drop in hand-runs — that's how we know the graduation is working.


Method note: quantitative census via tool-call extraction over all 831 Kimi JSONL transcripts and pattern counts over all 1,160 Claude session transcripts; qualitative recipes extracted from 368 memory files, 16 sampled Claude transcripts across 12 filename clusters, and the 40 most recent Kimi sessions; automation inventory from crontab, systemd, and the ~/ pipeline directories. Full extraction detail in session transcript ~/.claude/sessions/2026-09-08-deterministic-software-candidates.txt.

Read this page as Markdown: https://console.thinkingcap.com/guest/Research-and-Development/CapCom/Tooling/deterministic-software-candidates.md
Same content, machine form. The whole corpus: /guest/all.md.