diff --git a/docs/adr/0055-first-issue-and-weekly-hand-off.md b/docs/adr/0055-first-issue-and-weekly-hand-off.md new file mode 100644 index 0000000..6643f1b --- /dev/null +++ b/docs/adr/0055-first-issue-and-weekly-hand-off.md @@ -0,0 +1,35 @@ +# 0055 — The first issue goes out without the remaining entry facts; a weekly hand-off builds each issue; work runs in batches + +- **Status:** accepted +- **Date:** 2026-11-16 +- **Roadmap item:** Phase 2, Marketing and outreach agent: "Publish on Substack for now" and "Weekly issue hand-off" +- **Amends:** ADR 0053 (the agent's proposal that the first issue waits for every entry fact); ADR 0045, decision 4 (the catch-up review of main now waits for the owner's answer) and decision 5 (how often the review is re-tried, now moot) + +## Context + +The weekly digest, the paid issue, the issue layout and the indication on each entry are built (ADR 0047, 0049, 0053). ADR 0053 proposed that the first issue wait for four more facts on every entry: conference dates, development stage, company pipeline pages, and cohort size. Each is its own pull request, and cohort size first needs an owner-only spec change. + +The owner said on 2026-11-16 that they "can't afford all these token costs" and asked what is left before launch. Asked whether the first issue should wait for the four facts, the owner chose "Launch without them". + +On 2026-10-26 the owner asked that coding work run "in batches" and that product jobs run "once per day". The collect and extract workflows already run once each weekday on a schedule (`collect-live.yml`, `extract-live.yml`). + +The Claude review failed from 2026-10-20 because the account's purchased credit balance was $0; promotional credit does not cover Claude Code. The owner bought credits on 2026-11-16, and the review returned a verdict again that day, so ADR 0045's interim rule ended. + +## Decision + +1. **The first issue does not wait for the remaining entry facts.** Conference dates, development stage, pipeline pages and cohort size stay on the roadmap in ADR 0053's order and are added to issues as each one merges. No check is loosened: an entry still publishes only through the publish gate, and a fact still appears only with its own claim. +2. **Weekly hand-off, every Monday.** A scheduled task starts a fresh coding session each Monday morning, New York time. That session follows `docs/weekly-issue.md`: it makes a one-off key pair, runs `extract-live.yml` in `export` mode with the public key, unseals the export, builds the free and paid pages with `catalyst digest --from-export --page`, and sends both pages to the owner privately with the week's counts. It prints counts only. It never commits, publishes, or posts the pages, the export, or the key. The owner reads each issue and publishes it on Substack by hand, which is the approval ADR 0020 requires. +3. **Work runs in batches.** A coding session takes a stretch of roadmap work and finishes it in one go. It checks CI and reviews when its work is done instead of reacting to each GitHub event, so a long session is not re-read on every event. Model-using product jobs run at most once a day; the existing schedules already do. +4. **ADR 0045 has ended.** Its decision 4 asks for one Claude review of main's state to look for anything the interim reviews missed, covering every pull request merged between 2026-10-20 and 2026-11-16. That review costs roughly $5 to $15 of the owner's credit, and the owner asked on 2026-11-16 to cut costs, so this ADR changes decision 4: the agent asks the owner whether to run it, and runs it as soon as the owner says yes. Until the owner answers, the question stays open in the agent's report to the owner. + +## Alternatives + +- **Wait for all four facts (ADR 0053's proposal).** Declined by the owner: several more weeks and four reviewed pull requests before any issue. +- **Build the issue in a GitHub Actions job.** The paid page must never appear in a public log or artifact, and the repository is public, so the pages are built only in a private session from the sealed export, as the prototype pages are. +- **The owner runs the steps.** The owner is not a programmer and asked not to click through technical steps. + +## Consequences + +- The first issues show indication but not the other four facts. Entries without an indication still publish, as ADR 0053 allows. +- Each Monday costs one short coding session. The prompt is fixed and the steps are scripted, so it stays small. +- Before the first issue is published, CP7b still applies: the Opus review of the issue-building code, and the owner's test email from Substack with a postal address and a working unsubscribe link. diff --git a/docs/roadmap.md b/docs/roadmap.md index b1bfcfe..5a05fce 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -67,9 +67,9 @@ Claude Code: tick items (`[x]`) in the same pull request that finishes them. - [x] Weekly digest built by plain code, no model: `catalyst digest` writes one issue per Monday from published catalysts (dates that moved, new catalysts, and the next 30 days), each entry with its quote and deep link, as JSON and safe HTML; it holds only what a free caller may see and sends nothing (owner request 2026-11-09; ADR 0047) - [ ] Publish on Substack for now (owner decision 2026-11-09; ADR 0049): `catalyst digest --page` writes the issue as a complete page the owner copies into Substack's editor; the owner publishes each issue by hand, which is the approval ADR 0020 requires; no program posts to Substack; an unapproved issue never appears in a public log, file, issue, or pull request; before the first send the owner checks a test email for a postal address and a working unsubscribe link (CP7b) - [x] Paid issue (ADR 0049): `catalyst digest --access paid` builds a second weekly post for paid Substack subscribers with the calendar from the issue date on (the first 200 entries listed, the rest counted), every date move of the week, and each catalyst's date history, from the paid shape by the same plain code; a test proves the free issue can never carry it; never printed anywhere public; `--page` writes either issue as a complete page to copy, and `--from-export` builds it from the private export where the database cannot be reached; $15 a month with an annual plan, set by the owner in Substack; the owner chose on 2026-11-09 to take payment now as an individual, which is the one exception to the spec's business-setup rule and Gate 3 (ADR 0049, decision 5) - - [ ] Weekly issue hand-off: each Monday a coding session runs the data jobs' export, builds the free and paid pages, and hands them to the owner privately with the week's counts; jobs print counts only (ADR 0049; a schedule, so set up with the owner's go-ahead) + - [ ] Weekly issue hand-off: each Monday a coding session runs the data jobs' export, builds the free and paid pages, and hands them to the owner privately with the week's counts; jobs print counts only (ADR 0049; a schedule, so set up with the owner's go-ahead). Owner's go-ahead 2026-11-16; steps in `docs/weekly-issue.md` (ADR 0055); ticked once the Monday schedule exists - [x] Issue layout (owner decision 2026-11-10; ADR 0053, decision 1): "Rescheduled Catalysts", "New", and "Upcoming Catalysts through [date]"; a colour key of coloured squares at the top; "When:" in words with who stands behind the date, replacing the date label; the quote reached through a text-fragment link instead of printed; the financial notice once, last, in small type - - [ ] Facts on every entry (owner request 2026-11-10: indication, phase including preclinical, cohort size, named conferences' dates, pipeline and program links; the methods below and the wait for the first issue are the agent's proposals; ADR 0053, decisions 2 to 6), each its own pull request: + - [ ] Facts on every entry (owner request 2026-11-10: indication, phase including preclinical, cohort size, named conferences' dates, pipeline and program links; the methods below are the agent's proposals; ADR 0053, decisions 2 to 6; the first issue does not wait for them, owner decision 2026-11-16, ADR 0055), each its own pull request: - [ ] Indication (ADR 0053, decision 2 as amended): its own quote naming the drug and the disease, matched to one MeSH disease by plain code; gated on its own, so the catalyst still publishes without it; publish gate, test first, Opus review - [x] MeSH file and matcher: `catalyst collect --sources mesh` stores NLM's yearly descriptor file with its hash; `catalyst.mesh` matches whole words to exactly one disease, refusing narrower, negated, broad, and short-form matches (41% of 371 extracted indications; two samples of 40 all correct) - [x] The indication's own sentence, read by one model and checked by a second (owner decision 2026-11-10; ADR 0053, decision 2 as amended): plain code offers the visible sentences naming the drug; the first reader (extractor role) picks one and copies the disease; plain code checks it is written there and names one MeSH disease; the second reader (verifier role) confirms the sentence states the drug is aimed at it for this event; scored on 20 gold events and 39 planted cases; three earlier routes not merged (their results are in the ADR) @@ -205,6 +205,7 @@ Newest first. Every ADR in `docs/adr` adds a line here. | Date | Decision | | --- | --- | +| 2026-11-16 | ADR 0055 (owner decisions): the first issue goes out without conference dates, development stage, pipeline pages and cohort size, which follow as each merges; each Monday a scheduled fresh session builds the free and paid pages from the sealed export per `docs/weekly-issue.md` and hands them to the owner privately; coding work runs in batches and model-using product jobs at most once a day; ADR 0045's interim merge rule ended when the review returned a verdict on 2026-11-16 | | 2026-11-12 | ADR 0053, decision 2: the writer's indication pass sets a catalyst's `indication_id` only from its latest `indication_attempt` when that try found one, after checking the claim is the catalyst's own, the second reader's pass is stored, and the quote still matches its stored copy; a change row cites the claim; the read API prints the sentence's words, not the MeSH name; the weekday extract run asks and writes right after publishing, inside the existing caps | | 2026-11-12 | ADR 0053, decision 2: the indication reading job (`catalyst indicate-catalysts`) asks both readers about published catalysts with one drug tested alone and no indication, only while the indication gate is clear; a found indication is a claim (field `indication:`, quote its sentence) with the second reader's pass as a check; every try is kept in `indication_attempt` so none is paid for twice; it never writes a catalyst; plain code also refuses a disease written straight before another MeSH disease term | | 2026-11-12 | ADR 0053, decision 2: floors for the indication readers, at the third run's scores (found_right ≥ 0.133, none_right ≥ 1.0, wrong ≤ 0.0; checker accepts_true ≥ 1.0, refuses_false ≥ 0.962), as owner paths in `scripts/merge_gate.py`; the readers may not run on live data unless their scores match the current prompts, role settings, and label sets and meet the floors | diff --git a/docs/weekly-issue.md b/docs/weekly-issue.md new file mode 100644 index 0000000..3e74024 --- /dev/null +++ b/docs/weekly-issue.md @@ -0,0 +1,15 @@ +# Weekly issue hand-off (ADR 0055) + +Run each Monday by a fresh coding session. It builds the free and paid Substack pages from the live data and gives them to the owner privately. Print counts only. Never commit, publish, upload as an artifact, or paste into a pull request, issue, or log: the export, the private key, or either page. + +Work in the session's scratchpad directory, written below as `$S`. Every file made here stays there with mode 600. + +1. **Key pair.** `uv run --frozen catalyst seal-keygen --private-key $S/keys/week.pem > $S/keys/week.pub`, then `chmod 600 $S/keys/week.pem`. Only the public key leaves the session. +2. **Sealed export.** Start `extract-live.yml` on `main` with inputs `mode=export` and `public_key=`. Through the REST API, send the dispatch body as JSON with `Content-Type: application/json`. Wait for the run to finish. The export makes no model call. +3. **Unseal.** Download the run's job logs to `$S/dl/week/log.txt`. The log holds one block starting `-----BEGIN CATALYST SEALED FILE-----`. Run `uv run --frozen catalyst unseal --private-key $S/keys/week.pem --in $S/dl/week/log.txt --out $S/dl/week/export.json`, then `chmod 600` it. +4. **Build both pages.** For `a` in `free` and `paid`: `uv run --frozen catalyst digest --issue-date --from-export $S/dl/week/export.json --access $a --out $S/issue/$a.json --page $S/issue/$a.html`. Each command prints the week's counts. +5. **Look before sending.** Open the free page in the pre-installed Chromium with outside requests blocked, and check that it renders: title, colour key, the three sections, and the notice at the end. +6. **Hand over.** Send `free.html` and `paid.html` to the owner privately (the session's file-sending tool), with the counts from step 4 in two plain lines. Remind them the paid page is for paid subscribers only. +7. **Clean up.** Delete `$S/keys/week.*` and `$S/dl/week/`. Keep nothing else. + +If any step fails, say which step and the error's first line, and stop. Do not retry more than once (AGENTS.md: two failures, stop and explain). diff --git a/uv.lock b/uv.lock index a4abc12..aa552c5 100644 --- a/uv.lock +++ b/uv.lock @@ -1,5 +1,5 @@ version = 1 -revision = 5 +revision = 3 requires-python = "==3.12.*" [[package]] @@ -776,14 +776,14 @@ wheels = [ [[package]] name = "opentelemetry-api" -version = "1.45.1" +version = "1.45.2" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/2e/02/6e0ae9cc61bd3169d401077b507b3ebc344745171e1051ab430be012dcd9/opentelemetry_api-1.45.1.tar.gz", hash = "sha256:aa38ed19bcc084ba42782a73255b3582283eced7ad6dddbd6695189e69adfb75", size = 72804, upload-time = "2026-10-06T17:32:58.133Z" } +sdist = { url = "https://files.pythonhosted.org/packages/19/14/cf3a6b6448849656e1e5f4e2101f3988dc6789724050096aba1bc5ccf592/opentelemetry_api-1.45.2.tar.gz", hash = "sha256:d7b0008e21e5fd61cbe7a7f34ca3b6905a78ab677d9bc395e299359c75cda6b4", size = 73277, upload-time = "2026-10-29T17:29:37.888Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/1e/41/f7dcf80b81ee8e71c1a2b59f14208bc723edbd89ed027a73b175abf6348e/opentelemetry_api-1.45.1-py3-none-any.whl", hash = "sha256:b31553efa588ae44bc306f863c785c5333a9ecc091248c6ee68b4b6c87fdedfb", size = 60256, upload-time = "2026-10-06T17:32:33.506Z" }, + { url = "https://files.pythonhosted.org/packages/a9/2d/610db864d7513158cebb8f36cc88e67e73bd6c7aa1905ef18d89e1281c81/opentelemetry_api-1.45.2-py3-none-any.whl", hash = "sha256:2cbd737377e710ee740d261c94e93fa0f08e6d037c18f17513cc0a2d94479a34", size = 60335, upload-time = "2026-10-29T17:29:06.955Z" }, ] [[package]]