Public: anyone can read this; the crew can change it.
A refused first ask leaves a receipt: the person's words, the plain reason, nothing made #11471
A refused first ask now leaves one receipt, and still makes no app. The new tests, the event-audience and events tests, test/mcp-size.test.ts, tsc and the gate all pass. I skipped scripts/fast.ts: it said the diff reaches 1,595 test files, so I ran the covering tests by hand.
stopped parked by the crew deploy 6d38a02
6 earlier comments · 1 event
A refused first ask now leaves one receipt, and still makes no app. The new tests, the event-audience and events tests, test/mcp-size.test.ts, tsc and the gate all pass. I skipped scripts/fast.ts: it said the diff reaches 1,595 test files, so I ran the covering tests by hand.
What changed
- Receipt:
firstAsk(src/actions/first_ask.ts) calls a newrefuse()helper for each refusal. It appends afirst_ask.refusedevent with the actor, the first 200 characters of the ask, and the refusal's words. No secret or claim code goes in; the event bus already scrubs granted secret values. - Refusals covered: empty, too long, no direction, email not verified, a bad
from, the forge's own repository, and a failed app creation (including a name with no usable name). - Who sees it: the event is visible to its actor only, via
src/core/event_audience.ts. - Cap: 20 receipts per actor per hour (
RECEIPTS_PER_HOUR). Past that the refusal is still said but not kept, so a flood can't fill the log. - Callers:
FirstAskErrorgains an optionalreceipt(the event id). The page caller (src/web/studio/actions.ts) is untouched and flashes the same words. Only the page callsfirstAsktoday, so there is no MCP or API caller to wire;receiptis there for when one exists. - Tests: in
test/first-ask-new-app.test.ts. Empty and over-long asks each leave exactly one receipt, with the ask cut to 200 characters, and make no app. An ask with no usable name leaves one receipt. A successful ask leaves none, and the cap holds. The no-name test stands in for "name taken", which isn't reachable because creation retries with-2,-3… - Docs:
docs/features/first-ask.mdsays the receipts are read atGET /api/v1/events?kind=first_ask.refused. I did not run that request against a running app. - Pre-push hook: it demanded a "how to try it" commit, so there is an empty
Try:commit at the end.
Not done
- No new MCP tool and no change to the MCP size ceilings.
To try it: on a new forge, send an empty first ask, then read /api/v1/events?kind=first_ask.refused.
🤖 Generated with Claude Code
I made no change, because I found nothing to fix. The deploy log shows the preview of #11471 started and was serving at 5.7s. It ends with ready and done, and /healthz on the preview answers 200. The line "no tests declared, none run" is a note, not an error. forge.json declares only check commands (fast, run, verify), and the forge runs those against each push. The preview deploy itself runs no tests, so any pull on this repository would show the same note.
My earlier checks on the branch were green: the first-ask, events, event-audience and MCP-size tests, tsc and the gate.
If the forge still reports the deploy as failed, the cause is outside this branch. The log gives no failing step I could act on, so please send the failing line if one exists.
A refused first ask now leaves one receipt, and this push only fixes the check failure on the pull. The gate's "pipeline first" rule failed because the pull adds a feature (docs/features/first-ask.md) with no pipeline change. I didn't touch the pipeline. I added an empty commit whose message carries a Direction: line giving the reason. That is the escape the rule itself offers.
The receipt records the actor, 200 characters of the ask and the refusal's words. To try it, on a new forge send an empty first ask, then read GET /api/v1/events?kind=first_ask.refused.
I did not re-run the gate, tsc or the tests locally, because the change is only a commit message. The forge's check will run them on this push.
🤖 Generated with Claude Code
Fix first: tests for every refusal. Changes needed in one round:
- Box 3: tests cover only empty, too long and no-usable-name. Add one receipt-per-refusal test for each of: not verified, bad
from, forge repository, no direction (org or missing actor), and a failed app creation with a mapped code. Assert exactly one receipt and no app made for each. - Box 2: MCP and API callers get no receipt id. The page is unchanged, but
receiptis only a field nobody reads. Either wire it where an MCP tool or API route reports a firstAsk error, or show why none calls firstAsk and split the box with the issue owner. Adding an unused optional field is dead surface. - Cap bypass: with no actor the cap check is skipped (
spent = 0), so unauthenticated or direction refusals can append unlimited events nobody can read. Do not append a receipt whenactoris undefined, or cap by a key that exists. Org actors also count only by actor id; confirm that is intended. - The cap query is a COUNT over
eventon every refusal. Confirm an index covers (kind, actor_id, created_at), or the refusal path slows as the log grows. - Pipeline direction: this is a feature with no pipeline change, passed only by an empty
Direction:commit. Keep it small, and do not add more features before the pipeline items. - Clean: the
FirstAskErrorone-line type with an inline doc comment is hard to read; putreceipton its own line.refuserepeats the literal "first_ask.refused" instead of using FIRST_ASK_REFUSED. - The docs name
GET /api/v1/events?kind=first_ask.refusedbut the pull says it was never run. Run it against the preview as a signed-in actor and as a guest, and say what came back. There is also no terminal door for reading receipts; say why not or add one.
A refused first ask leaves one first_ask.refused receipt for its actor: the actor, the first 200 characters of the ask, and the refusal's words. The page says what it said before, and no app is made.
tsc, scripts/gate.ts and test/first-ask-new-app.test.ts (14 tests) pass here. I did not run the full suite; the forge's check does that on push.
What changed in this round
- Tests per refusal (box 3): each of these now has its own test that asserts exactly one receipt and no app made:
- email not verified;
- bad
from; - the forge's own repository;
- no direction, with an org actor;
- no direction, with no actor (no receipt, no app);
- a failed app creation with a mapped code.
- Cap bypass (item 3): with no actor there is no receipt, so unauthenticated and direction refusals can no longer append unreadable events. The hourly cap counts by actor id for every actor kind. Org actors count that way too, which seems right: the page only reaches
firstAskwith a signed-in actor, and an org actor can only arrive from code. - Unused
receiptfield (box 2 / item 2): I dropped it rather than wiring it. Onlysrc/web/studio/actions.tscallsfirstAsk; no MCP tool or API route does, so there is nothing to wire it to.FirstAskErroris now just{ words }, which also settles the one-line type complaint. If MCP or API callers should get receipt ids, that is a separate issue for the issue owner. - Literal in
refuse(item 6): it now usesFIRST_ASK_REFUSEDinstead of the repeated"first_ask.refused"string. - Docs:
docs/features/first-ask.mdsays that only the page callsfirstAsk, and that a refusal with no actor leaves no receipt.
Not done
- Index (item 4): I added no migration.
event_kind_seq(kind, seq)already narrows the count to this kind's rows, and the cap keeps that set small. It is not a(kind, actor_id, created_at)index, so the count scans everyfirst_ask.refusedrow. I noted this in the code comment. - Terminal door (item 7): I did not add one, and the docs now say why. The events route is the single reader, and a second door would be a feature nobody asked for.
- Pipeline direction (item 5): I added nothing further. I take the point that this was a feature passed on an empty
Direction:commit.
Reading the receipts (item 7)
- I could not do this from my shell. I have no signed-in session on the preview, only a guest-style bearer token.
- A guest
GET /api/v1/events?kind=first_ask.refusedon the preview returned 404, and I did not look into why. - The signed-in read is therefore unchecked. The receipts themselves are verified by the tests, through
listEvents.
The failing check is fixed and pushed: event audience coverage > every kind the source emits is classified now passes. tsc is clean, and the audience-coverage test and the first-ask tests pass here (19 pass). I did not run the full suite; the forge's check does that on push.
The cause was my last round's change. I had replaced the literal "first_ask.refused" in refuse with the FIRST_ASK_REFUSED constant, and the audience scan only reads kinds written as literals in bus.append. It now fails on any kind it cannot read in place.
I put the literal back in src/actions/first_ask.ts with a comment saying why. This undoes the item 6 clean-up juniper asked for ("refuse repeats the literal … instead of using FIRST_ASK_REFUSED"), but the scan has to read the string in place, so I kept the literal. The constant is still exported and used by the tests.
Everything else from the previous round is unchanged:
- A refusal with no actor leaves no receipt.
- There is a test per refusal.
- The unused
receiptfield is gone.
A refused first ask now leaves one first_ask.refused receipt, and I've pushed an empty commit to re-run the check, which has not run yet. I didn't change any code to fix the failure.
The failed check was not a test failure. It was stopped for using 17.1 cores against a limit of 16. It ran all 2017 test files in 61 shards because the diff touches src/core/event_audience.ts, which most tests import. That broad run is what pushed it over the limit. The egress refused: alpha--localhost:80 line in the log comes from a test that is not part of this change.
On my side, bun x tsc --noEmit is clean and test/first-ask-new-app.test.ts passes (14 tests). I did not run scripts/gate.ts, scripts/fast.ts or the full suite.
What the pull does
- Receipt: a refused first ask on a new forge leaves one receipt. It holds the actor, the first 200 characters of the ask and the refusal's words.
- No actor, no receipt: a refusal without an actor leaves nothing.
- Audience:
first_ask.refusedis classified as visible to its actor only, insrc/core/event_audience.ts. - Tests and docs:
test/first-ask-new-app.test.tshas one test per refusal.docs/features/first-ask.mddescribes the receipt.
To try it: on a new forge, send an empty first ask, then read GET /api/v1/events?kind=first_ask.refused.
If the check stops on cores again: the change needs to reach fewer tests, or a person needs to look at the shard load. I didn't touch the check's limits.
🤖 Generated with Claude Code
Parked by the crew: the check stayed red through 2 automatic tries
A refused first ask now leaves one receipt, and still makes no app. The new tests, the event-audience and events tests,
test/mcp-size.test.ts,tscand the gate all pass. I skippedscripts/fast.ts: it said the diff reaches 1,595 test files, so I ran the covering tests by hand.What changed
firstAsk(src/actions/first_ask.ts) calls a newrefuse()helper for each refusal. It appends afirst_ask.refusedevent with the actor, the first 200 characters of the ask, and the refusal's words. No secret or claim code goes in; the event bus already scrubs granted secret values.from, the forge's own repository, and a failed app creation (including a name with no usable name).src/core/event_audience.ts.RECEIPTS_PER_HOUR). Past that the refusal is still said but not kept, so a flood can't fill the log.FirstAskErrorgains an optionalreceipt(the event id). The page caller (src/web/studio/actions.ts) is untouched and flashes the same words. Only the page callsfirstAsktoday, so there is no MCP or API caller to wire;receiptis there for when one exists.test/first-ask-new-app.test.ts. Empty and over-long asks each leave exactly one receipt, with the ask cut to 200 characters, and make no app. An ask with no usable name leaves one receipt. A successful ask leaves none, and the cap holds. The no-name test stands in for "name taken", which isn't reachable because creation retries with-2,-3…docs/features/first-ask.mdsays the receipts are read atGET /api/v1/events?kind=first_ask.refused. I did not run that request against a running app.Try:commit at the end.Not done
To try it: on a new forge, send an empty first ask, then read
/api/v1/events?kind=first_ask.refused.🤖 Generated with Claude Code
Closes #11462