tickets
All repositories: gitoria
11.1 KB
# S51 — ticket deltas and push subscriptionsThe build is complete at the mission's STOP point. All required local gates pass. Nothing was deployed, pushed, sent to another chat, or written to a live ticket. The next action belongs to the conductor: review this branch, then separately authorize deployment and the specified push-test live proof.Worktree: `/media/STORAGE/claude-scratch/tickets/S51/wt`. Branch: `s51-subscriptions`, created from main at `c5d28fb`. The main checkout's source was never edited.## What was built`subscriptions.db` stores owner, project IDs or `all`, label, baseline cursor, wakePending, created time and wake attempt/status fields. The new token-only create/list/remove and owner-only delta routes are in `lib/subscriptions-api.hl`. Admin rights are checked across every listed project when acting for someone else; all-project subscriptions are self only. Project keys, cookies and ident access keys cannot own these routes. Explicit lists allow at most 100 project IDs and labels at most 100 characters.Deltas compute from the numbered stream and referenced history, with stable actor-ID self exclusion before per-ticket merging. JSON retains every coalesced ticket. Markdown orders relevance first and caps the output at 4096 UTF-8 bytes, with project counts for omitted tickets in the same digest. GET marks only its captured high-water snapshot delivered; peek leaves it pending. Snapshot/render/cursor update is one synchronous event-loop call with no network wait. Mentions use the owner's current nonempty display name as a case-insensitive literal substring in contributing full comments/new summaries; @ is optional, and code/quotes/word substrings count. This exact rule is in README. Creation summary is reconstructed from the earliest edit's oldSummary when necessary. Existing stream omissions (comment edits/deletes/likes and member-removal unassignment) remain outside this delta design.Stream writes trigger content-free signed wakes with fetchStart. Tickets stores no HC credential. One fixed configured waker URL receives `{subscription,at,delivery}`. HMAC-SHA256 is the documented hkdfExtract(secret, body); a known-answer test proves the bytes. Pending suppresses further wakes until fetch. Failures retry after 1, 5, 30 and 120 minutes, then expose failed status. Restart resends pending changes with the same delivery/body. Standby's environment explicitly disables dispatch; main also reconciles stream rows locally every second so standby writes are noticed after takeover. The overlap gate proves a standby write causes exactly one main wake.`tools/waker/waker.py` is a loopback-only Python 3 stdlib bridge. It verifies signatures in constant time, persists successful delivery deduplication in SQLite, routes from its private registry to HC project or chat, rejects redirects, and returns success only after HC succeeds. Tokens come from operator-owned files and are never logged. `tools/waker/README.md` contains the config, systemd installation and cutover steps for Apollo.## Decisions, deviations and limitsThe mission's binding Design supersedes P51's alternative journal, fetch receipts, public callbacks and HC credentials in tickets. No second journal, ack endpoint, extra digest, UI or gitoria callback protocol was added.Python is the permitted waker fallback: the read Hybriel docs provide HTTP/fetch/HMAC shapes but no documented general constant-time byte comparator. Password verification is not a signature comparator. The operator's routing registry is JSON; its secret is supplied by a root-only systemd EnvironmentFile, while URLs and token-file paths live in the adjacent root-only JSON registry. Tickets never receives those paths or URLs.A project-name summary alone can exceed 4 KB across many projects. After 2000 bytes of named project counts, the remaining projects are grouped as `K other projects (N)` to preserve the hard cap. This edge case is documented; the 100-project cap fixture renders 4009 bytes.Waker deduplication cannot atomically commit with HC enqueue: a crash after HC accepts but before SQLite commit can duplicate that notice. The HC API has no idempotency key. This is documented, and ordinary retry/restart repeats after the commit are suppressed. Do not run two enabled main dispatchers against one store. The standby overlap proof covers sending ownership; exhaustive cross-process cursor-write fault injection was not performed. Delivered-on-GET has the specified response-loss semantics, without a fetch receipt. Local reconciliation scans retained rows and subscriptions; large production backlogs were not benchmarked.The connect gate initially timed out after 54 passes because it dispatched a change on an SSR form before hydration. Only the gate was changed to wait for its client socket before input; the unchanged connect application then passes 60 checks. The earliest simultaneous gate launch also hit EADDRINUSE on 8741; all recorded legacy gates were rerun sequentially.Build/test artifacts are under S51. The vendored runtime and supplied browser helpers also used their default shared compilation cache and temporary Chrome profile locations; no shared cache was deleted. Recorded helper profiles were checked for cleanup. No .env or real token was read. Test credentials were locally generated fixtures.## Gate evidenceAll paths below are relative to the worktree.| Gate | Passed | Failed | Evidence || --- | ---: | ---: | --- || `node tests/subscriptions.mjs` (final release run) | 37 | 0 | `.scratch/subscriptions-release.log` || Same new gate against archived old main | 0 | 8 | `.scratch/subscriptions-old.log` || `node tests/browser.mjs` | 453 | 0 | `.scratch/browser.log` || `node tests/events.mjs` (full 125-second idle window) | 53 | 0 | `.scratch/events.log` || `node tests/security.mjs` | 309 | 0 | `.scratch/security.log` || `node tests/connect.mjs` (hydration wait) | 60 | 0 | `.scratch/connect-final.log` || `node theme/check-theme.mjs .` | 60 files | 0 problems | `.scratch/theme-release.log` || `python3 tools/waker/test_waker.py` | 1 unittest | 0 | `.scratch/waker-release.log` || `bin/hybriel tests/subscriptions-cap.hl` | 4009-byte output | 0 | `.scratch/cap.log` |The new gate covers create/list/remove, ownership/admin refusals, baseline, own-event exclusion, one signed wake per pending episode, another episode after fetch, per-ticket state merging, comment counts/snippets, all relevance flags, edits/assignment/links, JSON/Markdown shapes, peek, delivery drain, all-project overview across alpha/beta, restart reuse of delivery ID, 4 KB summary, full JSON overflow, standby overlap and actual HTTP 503 retries to failed. The test-only retry helper advances due times after recording the production delays; production has no accelerated retry environment switch. HMAC's known answer is `sha256=f7bc83f430538424b13298e6aa6fb143ef4d59a14946175997479dbc2d1a3cd8` for key `key` and message `The quick brown fox jumps over the lazy dog`.The old-code run meaningfully fails auth/rights/create/list because subscription routes do not exist and fall through to HTML; its missing HMAC module also fails. It stops at the missing list shape, so later dependent checks were not individually exercised on old code. Legacy gates were not separately rerun against old main. The waker unittest exercises real HTTP missing/wrong signatures (403/403), fake HC project/chat endpoints, no-token-logging code path, durable dedup and HC failures. No real HC call was made.## His ChromeThe API lifecycle passed in lisbeth's existing Chrome: create a subscription, add bob's comment to the local test ticket, preview, fetch Markdown, verify an empty next fetch, and remove. Evidence: `.scratch/chrome-proof.json`, `.scratch/chrome-proof.log`, `.scratch/real-chrome.mjs`. Only a plain default-context tab was used under the lisbeth lock. Four screenshots were opened and inspected: `.scratch/chrome-phone.png` (390×844), `.scratch/chrome-tablet-portrait.png` (800×1280), `.scratch/chrome-tablet-landscape.png` (1280×800), `.scratch/chrome-desktop.png` (1280×900). Each shows the readable alpha #1 ticket and bob's `Chrome proof for alice` comment; no sideways clipping was visible. No UI source changed.The first attempt's reverse tunnel bound loopback rather than 127.0.0.51. Its own tab was explicitly closed and its hung script PID 2147645 stopped, then the proof was rerun on the unique host s51.localhost. Before/after/third target inventories are saved in `.scratch/chrome-before.json`, `.scratch/chrome-after-first.json`, `.scratch/chrome-after.json` and `.scratch/chrome-final.json`. Final page list: `[{"id":"2B36106C7AF83C7D196B54C5C499429C","url":"about:blank"}]`. No proof tab remains; no existing page was touched, cleared or signed out.## Processes and resource accountingPorts 8740–8759 were checked with ss before startup. Gate servers, fake waker/HC, fixture clients and local automated Chromes were stopped by their owning test cleanup. The standalone compile launch PID 1628257 exited; compile-session server also exited after its reserved-word parse error was corrected. The real-Chrome server PID 2129419 and SSH tunnel PID 2130080 have exited. The terminated first proof script was PID 2147645. Recorded browser/helper inventory is `.scratch/process-snapshot.json`; final cleanup inventory `.scratch/processes-to-stop.json` is empty. Final `ss -ltnp` for 8740–8759 has no listeners, and the final /proc cwd check finds no retained S51 background process. Earlier exited gate-child PIDs were not all individually captured; the fixtures' cleanup and final inventory establish none remain.Approximately 60 model/tool turns were used: documentation/worktree/report setup roughly 12, implementation and test creation roughly 20, gates/corrections/Chrome/cleanup/report roughly 28. Exact dollar spend is not exposed to this worker; no external paid API or subagent was used. Work was committed in small checkpoints so state would survive a cap stop.DOCS: HL-PRIMER (file/static/imports, hybrid copies/references, calls/events/errors/Bytes), CODE-ORDER (map/thin wrappers/one topic), fetch README from the Hybriel source plus vendored fetch/server.hl (fetchStart/completions/timeout), time README/server.hl (now/every/tick), crypto README/server.hl (hkdfExtract = HMAC), fs/server.hl, http1/server.hl and native_http_server.hl, stream.hl and connections.hl working shapes; README API/Event stream/Test, tickets.hl, api.hl, project.hl, full P51 REPORT, archived WORKER-RULES/RULINGS, HC README API. Doc gap: no documented constant-time generic signature comparison in the read crypto surface. No application JavaScript workaround was used.## Commits and next step- `fd23726` — Add subscription delta API and signed wake bridge.- `8d8e205` — Document subscription contract and exercise delta delivery (also removes an accidentally staged Python cache).- `54bc5fe` — Harden delta relevance, overflow caps and retry verification.- Final handoff commit follows this report; its exact identifier is appended to the scratch report after commit.Review the diff before any live change. Deployment, live `.env` setup, Apollo's waker installation/token provisioning and the mission's push-test parked-chat proof have intentionally not been performed. STOP reached.
Branches
Latest commits
- ff2e8701Finalize subscription build verification and handoff reportmre
- 54bc5fe1Harden delta relevance, overflow caps and retry verificationmre
- 8d8e2053Document subscription contract and exercise delta deliverymre
- fd23726aAdd subscription delta API and signed wake bridgemre
- c5d28fb5Tickets conductor: S51 startedmre
- fd6ca1e6Tickets conductor: brief 027 waker design, push-test projectmre
- e448e656Tickets conductor: STATUS #51mre
- 1c10857bTickets conductor: P51 eval, brief 027mre
- e725969dTickets conductor: #51 directionmre
- 1b5c63ddTickets conductor: P51 startedmre
- 9f13fbdaTickets conductor: brief 026 prioritymre
- acc477d9Tickets conductor: brief 026 + Vinzenz recommendationsmre
- 9233a734Tickets conductor: brief 026 completemre
- 5da589fdTickets conductor: brief 026 + Gitoria's answermre
- a3cd5329Tickets conductor: tickets#51 opened, brief 026 draftmre
- 6f6e5797Tickets conductor: STATUS wordingmre
- 957de51fTickets conductor: T36 live, #36 review, #50 donemre
- bc2fde32Merge branch 'main' into t36-stylemre
- b7ca093atests: wait for the new row and normalize editor marker spacesmre
- 41da3525Tickets conductor: flake cause, T36 deploy stepmre