tickets
All repositories: gitoria
16.8 KB
# S51 — direct HyperConductor chat pushes and ticket deltasThe revised build was approved at b487b05 and is now deployed under the conductor’s explicit authorization. Live application source is merge 4b4710a, preserving newer conductor records. Deployment and all requested live checks passed; see the deployment result below. No live ticket content was written.Worktree: `/media/STORAGE/claude-scratch/tickets/S51/wt`. Branch: `s51-subscriptions`, from main at `c5d28fb`. The main checkout's source was never edited.## Final implementationSubscriptions store owner, projects (stable IDs or `all`), label, baseline cursor, wakePending/attempt status, created, pushUrl and an encrypted secret. Creation/list/removal rights are unchanged: own subscription, or admin of every listed project for another owner; `all` is self only. Delta is owner-only. Only tickets user bearer tokens authenticate these routes. Explicit scopes allow up to 100 project IDs. Public subscription responses use an explicit whitelist, including the creation response: no secret, ciphertext, nonce or internal signing body is returned.Deltas still compute from existing numbered stream rows and referenced history, with stable actor-ID self exclusion before per-ticket merging. JSON contains all coalesced tickets; Markdown orders relevance first and stays within 4096 UTF-8 bytes. Overflow uses project counts in the same delivered digest; if project names alone exceed 2000 bytes, the remaining names are grouped as `K other projects (N)`. Fetch marks the captured upTo snapshot delivered and clears wakePending; peek does not. No second journal, receipt, acknowledgement endpoint or extra digest was added. Existing stream omissions (comment edits/deletes/likes and member-removal unassignment) remain outside deltas. Mention matching is documented case-insensitive literal display-name substring matching in contributing comments/new summaries, including code/quotes and word substrings. Creation summary is reconstructed from the earliest edit's oldSummary if necessary.`lib/subscription-push.hl` validates the destination and seals/opens its secret. pushUrl must match a complete base from comma-separated TICKETS_PUSH_ALLOWED, followed by `/api/push/<chatId>` where chatId is nonempty digits/hyphens. Other origins, prefix lookalikes, userinfo, query/fragment and other paths are refused with 400. An omitted pushUrl allows delta-only use.Pushes go directly to HC, without any intermediary service or instance control token. The exact body is `{source:"tickets",delivery,text}`; text is the self-explanatory delta curl command and is capped at 500 characters. Headers are X-Push-Delivery and X-Push-Signature-256 (`sha256=<HMAC-SHA256(chat secret, raw body)>`). fetchStart never waits on network inside the ticket write. Redirects are disabled, timeout is 10 seconds. A 2xx or 409 marks the push sent, while the delta stays pending until fetch. Other responses, including 429, retry after 1, 5, 30, 120 minutes, then show failed. Retries/startup reuse the exact delivery ID and body. Main alone dispatches; docker-compose explicitly disables standby dispatch, and main reconciles standby-written numbered rows. The overlap test proves one main push for a standby write.Chat secrets are encrypted at rest with the documented AES-128-GCM plugin: fresh random 12-byte nonce, destination URL as authenticated data, and a 16-byte key derived by HKDF-SHA256 from private TICKETS_PUSH_KEY (minimum 32 characters; README recommends 32 random bytes rendered as 64 hex characters). Creation of push-enabled subscriptions fails if the storage key is absent. There is no plaintext fallback. The operator must keep/back up that key separately; loss/change prevents decryption and requires recreating affected subscriptions with their chat secrets. README documents configuration and cutover; no key or real secret was read or installed by this worker.All tools/waker files were removed in commit d662ad2; the final git tree contains no tools/waker directory. No Python service or installation dependency remains. The earlier service remains only in superseded commit history as explicitly permitted by the requested removal commit.## Gates and old-code proofEvidence paths below are relative to the worktree.| Check | Passed | Failed | Evidence || --- | ---: | ---: | --- || Revised `node tests/subscriptions.mjs` | 51 | 0 | `.scratch/direct-subscriptions.log` || Revised gate against previous waker build ff2e870 | 11 | 8 | `.scratch/direct-prior.log` || Initial delta gate against original main | 0 | 8 | `.scratch/subscriptions-old.log` || AES-GCM secrets fixture | 3 | 0 | `.scratch/direct-secrets.log` || `node tests/browser.mjs` | 453 | 0 | `.scratch/direct-browser.log` || `node tests/events.mjs` (full idle window) | 53 | 0 | `.scratch/direct-events.log` || `node tests/security.mjs` | 309 | 0 | `.scratch/direct-security.log` || `node tests/connect.mjs` | 60 | 0 | `.scratch/direct-connect.log` || `node theme/check-theme.mjs .` | 62 files | 0 problems | `.scratch/direct-theme.log` || Large project-overflow fixture (prior unchanged formatter) | 4009 bytes | 0 | `.scratch/cap.log` |The fake HC implements `/api/push/[0-9-]+`: constant-time signature verification, header/body delivery agreement, body/text validation, 202 acceptance, 409 duplicate delivery, and a 10-second per-chat rate limit with 429. A controlled fake clock advances that rate window. Tests cover the existing delta/rights/baseline/self-exclusion/relevance/merge/peek/drain/overflow behavior plus allowlist refusal, missing secrets, wrong/missing fake-HC signatures, exact direct-push fields, encrypted storage, no secret in creation/list/Markdown/logs, 409 success, 429 retry, restart same-delivery reuse, failed-after-five recovery, delta-only operation and standby ownership. Retry due times are accelerated only by the test helper after it records the actual production delays; production has no fast-retry switch.HMAC's known answer remains `sha256=f7bc83f430538424b13298e6aa6fb143ef4d59a14946175997479dbc2d1a3cd8` for key `key` and message `The quick brown fox jumps over the lazy dog`. The AES fixture proves fresh nonce/ciphertext for repeated plaintext, successful decryption and refusal after URL tampering.The revised gate fails on ff2e870 because that build rejects pushUrl/secret and cannot create the required subscription shape. It stops on the missing usable delta shape, so later dependent checks were not individually run on old code. The initial new-route proof on original main similarly fails because routes fall through to HTML. Legacy gates were not separately rerun on old main.A revision test initially stopped after 24 passes because it guessed subscriptions.db; MPackDB's actual data file is subscriptions.mpack. The corrected at-rest check reads that file. The earlier connect gate initially raced hydration; its existing fix waits for the client socket before changing the SSR form and remains 60/0. The sequential gate shell exited with signal 143 after events printed 53/0, before starting browser; browser was therefore run separately and exited 0 with 453/0. No source behavior was relaxed to pass a gate.## Real Chrome proofThe revised API lifecycle passed in lisbeth's existing Chrome under the lisbeth lock, using one own plain default-context tab and unique host s51.localhost. It created a push-enabled subscription without leaking secret/ciphertext, added bob's local test comment, produced a signature-valid fake-HC POST `/api/push/123` with matching delivery header/body, previewed/fetched the delta, verified an empty next fetch and removed the subscription. No real HC call was made. Evidence: `.scratch/direct-chrome-proof.json`, `.scratch/direct-chrome-proof.log`, `.scratch/direct-chrome-push.json`, `.scratch/direct-real-chrome.mjs`.All four screenshots were opened and inspected: `.scratch/direct-chrome-phone.png` (390×844), `direct-chrome-tablet-portrait.png` (800×1280), `direct-chrome-tablet-landscape.png` (1280×800), `direct-chrome-desktop.png` (1280×900). The unchanged test ticket and its comments remain readable without sideways clipping. No UI source changed.Before/after/third inventories are `.scratch/direct-chrome-before.json`, `.scratch/direct-chrome-after.json`, `.scratch/direct-chrome-final.json`. The proof tab closed. His pre-existing day36-sort tab was untouched; its owner closed it later. Final page list: `[{"id":"2B36106C7AF83C7D196B54C5C499429C","url":"about:blank"}]`. No session was signed out, cleared or changed.## Processes, docs, resources and limitsPorts 8740–8759 were checked before starting. Revision test server/standby/retry PIDs are recorded in `.scratch/direct-subscriptions.log`. Process inventories are `.scratch/direct-process-snapshot.json` and `.scratch/direct-browser-processes.json`. Real-proof server PID 2476258 and SSH PID 2476259 had already exited at the final numeric-PID/cwd check; fake HC PID 2476796 was explicitly stopped after verifying its cwd. Gates stopped their own servers/clients/Chromes. Final inventory contains no retained S51 process and final ss has no listener on 8740–8759. Earlier exited gate-child PIDs were not all captured individually. Supplied helpers used their default shared compile cache and temporary Chrome profiles; no shared cache was deleted.DOCS: the complete amended mission, WORKER-RULES/RULINGS, HL-PRIMER (imports/statics/hybrids/copies/references/events/Bytes), CODE-ORDER (map/thin wrappers/topic files), stream.hl and connections.hl working shapes, full P51 report, README API/Event stream/Test, tickets.hl/api.hl/project.hl, HC README API, fetch README/server.hl (fetchStart/completions/timeouts/redirects), time README/server.hl (now/every/tick), crypto README/server.hl (HMAC through hkdfExtract and AES-GCM key/nonce/Bytes calls), fs and native HTTP server docs were read. The earlier generic constant-time-comparator gap is irrelevant after removing the receiver; this build signs outgoing requests with documented Hybriel crypto. No application JavaScript workaround or subagent was used.The original build used approximately 60 model/tool turns; the binding protocol replacement required approximately 20–25 additional turns for implementation, old-code proof, crypto tests, all gate reruns and real Chrome verification. This exceeds the original approximate request target because the finished transport was explicitly replaced after handoff. Exact dollar spend is not exposed; no external paid API was used. Small commits/current reports preserved state throughout.Limits: no benchmark of very large production backlogs and no exhaustive cross-process cursor fault injection. One enabled main dispatcher per store is required. Delivered-on-GET retains the specified response-loss semantics without fetch receipts. Local tests prove the signed protocol against a fake HC, not Hermes' actual receiver or a parked live chat. These limits do not authorize deployment by this worker.## Commits and handoffInitial checkpoints: fd23726, 8d8e205, 54bc5fe, ff2e870. Revision commits:- d662ad2 — Remove superseded waker service for direct chat push protocol.- a1ac5cd — Push subscription notices directly to signed HyperConductor chat endpoints.- 74e34cc — Verify encrypted push secrets and direct push retry semantics.- Final report/verification commit follows; its identifier is appended to the scratch report after commit.Review the final diff. After review, tickets may be deployed without configured push destinations while Hermes finishes the HC endpoint. Configure TICKETS_PUSH_ALLOWED/TICKETS_PUSH_KEY and create push-test subscriptions with per-chat secrets when ready, then perform the prescribed parked-chat live proof. STOP reached before deployment or any live write.Final revision commit: `b487b05a72aae7bc3eb0dafd00aa13caaf3bc53e`. Git status is clean; final retained process list is empty and ports 8740–8759 have no listeners.## Authorized deployment (conductor approval after b487b05)The conductor authorized live config, merging to main and deploy-init, superseding the prior STOP. Byrodin .env was backed up as .env.bak-20261101 mode 600. The key was generated there by openssl and written directly without printing; grep count for TICKETS_PUSH_ is 2. Both compose services bind the same host app directory to /home/tickets and run there; Hybriel reads the mounted .env. The old live compose had no standby disable flag; approved incoming compose adds TICKETS_WAKES_DISABLED=1. Main merged the approved branch cleanly at 4b4710a and retains newer conductor commit a731ef7. Deploy-init is running with public HTTP monitoring. Evidence: wt/.scratch/deploy-init.log, deploy-curl.jsonl, deploy-pids.json, deploy-summary.json (when complete). No extra production ticket writes are authorized outside push-test.Deployment progress: boot-gate passed 200 after 52 seconds, RestartCount 0, boot-gate rc=0; browser gate 453 passed / 0 failed. Events is running its full idle interval. Public monitor has observed only HTTP 200 so far.## Deployment result — authorized 2026-11-01The conductor approved b487b05 and authorized live configuration, main merge and deploy-init. Approved source was merged as **4b4710ad98a5c6e5c7c7b720529b3942ffe2093c**, retaining conductor record **a731ef7**. deploy-init pushed only after deployment rc=0. Report-only commit **c980856** records progress; this follow-up records the complete verified result after correcting a local report-command working-directory error. Application source was unaffected by that report error.**Live config:** TICKETS_PUSH_ALLOWED is `http://100.77.141.84:8100,http://127.0.0.1:45010,http://100.109.3.10:8100`. A 64-hex-character TICKETS_PUSH_KEY was generated on byrodin with openssl and written directly, without printing the key or file. `grep -c '^TICKETS_PUSH_' .env` returned **2**. The old file remains as **.env.bak-20261101, mode 600**. Both containers bind the same host app directory to `/home/tickets`, run there and load the mounted .env through Hybriel. After deployment main is **running**, standby **exited** with **TICKETS_WAKES_DISABLED=1**; the main container also sees exactly **2** push entries. No key or token was printed.**Deployment evidence:** `/media/STORAGE/projects/WorldAPI/worldapi-conductor/deploy-init.sh tickets` ran with no skipped gates. Boot gate reached 200 after **52 seconds**, RestartCount **0**, `boot-gate rc=0`. Gate totals: browser **453/0**, events **53/0**, security **309/0**, error-pages **26/0**, signin-return **3/0**, ident-access **32/0**, theme **62 files / 0 problems**. The final deploy summary ends **try 1 (1 s): 200; rc=0**. FAILED lines: **0**. No flake or EADDRINUSE occurred; no rerun was needed. Evidence: `wt/.scratch/deploy-init.log`, `deploy-summary.json`, plus `/media/STORAGE/claude-scratch/atlas/deploy/initdeploy-tickets.log`.**Backup:** `/media/STORAGE/deploy-backups/tickets.worldapi.org/tickets.worldapi.org-20261101-0420.tgz`, **24,289,391 bytes**, gzip integrity verified, mode **600**. Standby port 45013 answered 200 at **04:21:37** (38 seconds) before main restarted. Main port 45003 answered 200 at **04:21:45** (4 seconds). The handover completed in **71 seconds** and stopped standby at **04:22:10**. No second restart was performed.**Curl loop:** **261 samples**, all **HTTP 200**, **0 × 5xx**, **0 connection failures**, covering the full deploy-init and standby swap. Evidence: `wt/.scratch/deploy-curl.jsonl` and `deploy-summary.json`.**Live checks:** `/`, `/tickets.worldapi.org`, `/tickets.worldapi.org/51`: **200 HTML**. Ticket #51 API with User-Agent + Accept text/markdown: **200**, `text/markdown; charset=utf-8`, **1266 bytes**. Token-authenticated `/api/events`: **200**, first line **: connected**, client then closed. GET subscriptions initially and finally returned exactly **{subscriptions:[]}**. Token was read only within the client and never printed.A subscription without pushUrl was created for Tickets on push-test **0mvx8azokwks**, id **0mvx9lalk90u**, status **201**. Its delta returned **200**, well-formed, **from=3765**, **upTo=3765**, **tickets=[]**, **more=false**. Removal returned **200**, and the list was empty again. No comment or other live ticket-content mutation was made. Container log check: **wake_error_lines=0**. Evidence: `wt/.scratch/live-checks.json`. Real parked-chat push proof was not attempted and still waits for HC endpoint readiness and a chat secret.**Processes:** deployment runner/curl-monitor owner **2656990** and deploy-init **2657057** completed; the monitor stops with deploy-init. The SSE client closed. Boot staging was cleaned, deploy worktree was removed by deploy-init, and standby is stopped. `wt/.scratch/deploy-final-processes.json` is empty: no retained worker process. The intended production main remains running. The prescribed shared SSH helper manages its ControlPersist connection; no unrelated process was killed.This report-only update is pushed after rc=0; main/origin/main equality is checked again below. The deployed application source remains the approved merge.
Branches
Latest commits
- 5d144817Merge branch 'records-t40' into mainTickets
- 44ee6f06|||PR records: #43 #45 livemre
- b8fdeee9Merge branch 'p39-routes' into mainTickets
- a0187a0a|||PR Remove redundant route-order loopmre
- 369e4b9cMerge branch 'k40-lists' into mainTickets
- 9af8e780|||PR Use keyed list mutations for live ticket updatesmre
- 610d8e8aMerge branch 'records-t39' into mainTickets
- 32bcdf24|||PR records: GO P39 K40mre
- 4123c6d1Merge branch 'records-t38' into mainTickets
- cd3641a1|||PR records: day72 deploy live, tickets closedmre
- 7d44d852Merge branch 'records-t37' into mainTickets
- 926f7061|||PR records: merges, D36 deploymre
- bf58534eMerge branch 'l33-final' into mainTickets
- 759a9ac3|||PR thin login (tickets#46, #45): merge main, route entry cleanupmre
- 239436d8Merge remote-tracking branch 'origin/main' into l33-finalmre
- 5822cb3aMerge branch 'o34-clean' into mainTickets
- 0870653c|||PR offline note from __hlOnline, no polling (tickets#41)mre
- 14cf96b4Merge branch 'records-t36' into mainTickets
- 07749fa1|||PR records: day72 + #40 mergedmre
- ecd7e226|||PR Consolidate login and move handler logic into topic libraries (partial)mre