From cef70e6fc5894e36f01ccf1b27cd451d90979d9b Mon Sep 17 00:00:00 2001 From: codex Date: Wed, 21 Oct 2026 08:08:41 +0200 Subject: [PATCH] CUST-WP-0079: first timer fire failed on hub connection reset; retry hub read, reopen T03 Co-Authored-By: Claude Opus 5.5 --- WORK-RECORDS.md | 4 ++-- scripts/sync_resolved_decisions.py | 16 ++++++++++++++-- .../CUST-WP-0079-deterministic-security-flow.md | 12 ++++++++++-- 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/WORK-RECORDS.md b/WORK-RECORDS.md index 122b429..2680ad7 100644 --- a/WORK-RECORDS.md +++ b/WORK-RECORDS.md @@ -79,7 +79,7 @@ | workplan | CUST-WP-0076 | finished | — | workplans/CUST-WP-0076-provisioning-window-cadence.md | | workplan | CUST-WP-0077 | finished | — | workplans/CUST-WP-0077-dependency-root-execution-wave.md | | workplan | CUST-WP-0078 | finished | — | workplans/CUST-WP-0078-security-collaboration-consolidation.md | -| workplan | CUST-WP-0079 | finished | — | workplans/CUST-WP-0079-deterministic-security-flow.md | +| workplan | CUST-WP-0079 | active | — | workplans/CUST-WP-0079-deterministic-security-flow.md | | workplan | CUST-WP-0080 | finished | — | workplans/CUST-WP-0080-netkingdom-security-blueprint-and-gap-closure.md | | workplan | CUST-WP-0081 | finished | — | workplans/CUST-WP-0081-netkingdom-architecture-review-and-reuse.md | | workplan | CUST-WP-0082 | backlog | — | workplans/CUST-WP-0082-netkingdom-security-hardening.md | @@ -501,7 +501,7 @@ | task | CUST-WP-0078-T04 | done | — | workplans/CUST-WP-0078-security-collaboration-consolidation.md | | task | CUST-WP-0079-T01 | done | — | workplans/CUST-WP-0079-deterministic-security-flow.md | | task | CUST-WP-0079-T02 | done | — | workplans/CUST-WP-0079-deterministic-security-flow.md | -| task | CUST-WP-0079-T03 | done | — | workplans/CUST-WP-0079-deterministic-security-flow.md | +| task | CUST-WP-0079-T03 | progress | — | workplans/CUST-WP-0079-deterministic-security-flow.md | | task | CUST-WP-0079-T04 | done | — | workplans/CUST-WP-0079-deterministic-security-flow.md | | task | CUST-WP-0079-T05 | done | — | workplans/CUST-WP-0079-deterministic-security-flow.md | | task | CUST-WP-0079-T06 | done | — | workplans/CUST-WP-0079-deterministic-security-flow.md | diff --git a/scripts/sync_resolved_decisions.py b/scripts/sync_resolved_decisions.py index 5202b8c..dbc48e8 100644 --- a/scripts/sync_resolved_decisions.py +++ b/scripts/sync_resolved_decisions.py @@ -8,7 +8,19 @@ normalized, case-insensitive). Uses the sanctioned POST /decisions/{id}/resolve. Usage: sync_resolved_decisions.py [--apply] [--hub http://127.0.0.1:8000] """ -import argparse, glob, json, os, re, urllib.request +import argparse, glob, json, os, re, time, urllib.error, urllib.request + + +def get_json(url, attempts=3, delay=5): + # The workstation hub forward occasionally drops a first request; retry reads only. + for i in range(attempts): + try: + with urllib.request.urlopen(url, timeout=30) as r: + return json.load(r) + except (ConnectionError, urllib.error.URLError): + if i == attempts - 1: + raise + time.sleep(delay * (i + 1)) def norm(s): @@ -33,7 +45,7 @@ def main(): ap.add_argument("--apply", action="store_true") a = ap.parse_args() known = repo_resolved(a.root) - data = json.load(urllib.request.urlopen(f"{a.hub}/decisions/?status=open&limit=500")) + data = get_json(f"{a.hub}/decisions/?status=open&limit=500") data = data.get("items", data) if isinstance(data, dict) else data hits = 0 for d in data: diff --git a/workplans/CUST-WP-0079-deterministic-security-flow.md b/workplans/CUST-WP-0079-deterministic-security-flow.md index dbdb0ab..3c2475c 100644 --- a/workplans/CUST-WP-0079-deterministic-security-flow.md +++ b/workplans/CUST-WP-0079-deterministic-security-flow.md @@ -4,7 +4,7 @@ type: workplan title: "Deterministic security flow: standing authorizations, flow report, and agent re-engagement" domain: infotech repo: the-custodian -status: finished +status: active owner: claude-code topic_slug: custodian created: "2026-10-11" @@ -59,7 +59,7 @@ resolved or accepted). ```task id: CUST-WP-0079-T03 -status: done +status: progress priority: high state_hub_task_id: "1be0569c-221d-5925-a0ff-fd2af88e52b1" ``` @@ -80,6 +80,14 @@ environment and state dir; Result=success) as sufficient and closed T03 before the first timer fire. The timer's first fire (2026-10-21 ~08:03) is still checked; a failure reopens T03. +2026-10-21 first timer fire: started 08:05:31, failed 08:05:55 (exit 1). +`sync_resolved_decisions.py` got `ConnectionResetError` from the hub forward on its +first request (workstation booted 07:24; the forward is known to drop a first +request). T03 reopened per the rule above. A manual `systemctl --user start` of the +same unit at ~09:20 succeeded. Fix: the decision read now retries connection errors +three times with backoff (message delivery POSTs are not retried; they keep their +recipient checkpoints). T03 closes on the next unassisted fire with Result=success. + Run `sync_resolved_decisions.py --apply` and `security_flow_report.py --json` daily (activity-core schedule, or a workstation timer until activity-core has the lane). Post a hub message to the coding agent only when UNBLOCKED or READY changed, and to the founder only when ATTENDED is