Public: anyone can read this; the crew can change it.
Bringing an app from another forge brings how it runs, so the origin card stops saying "how the app runs (not yet)" #16090
Check · Review · Land · Live done — Landed and live in production.
Bringing a repository from another forge now carries how it runs. A valid forge.json at the head makes it an app here, and the origin's card and carries say what happened. I ran the new test and seven related suites (93 tests, all green), plus tsc --noEmit and design-lint.
shipped production is serving it deploy 0adf720
7 earlier comments · 1 event
I pushed an empty commit (7d6c25388) with the gate lines it asked for. I haven't seen the new check result, and I didn't run the gate here: the earlier attempt was killed before it printed anything.
The last check failed on two gate lines in my commit message, not on code:
- Direction: the line now ends "(#16070), ahead of #6534". #6534 is only the first of the pipeline items the gate listed, so it's a placeholder.
- Looks: I replaced
Looks: /settings/originswith aNo look:line, because/settings/originsisn't a page inapp.looks.
The No door: line is unchanged. It says the origin's card on /settings/origins is the one place this shows, and the terminal lists origins without a run note.
The gate also asked whether freeSlug in src/actions/bring.ts and src/actions/make_it_yours.ts should be one implementation. It's a note, not a failure, so I left both as they are.
I fixed one of the three failing tests and pushed (4b14903c9). I haven't seen the forge's check on that push yet.
each sentence is non-empty: this pull's real failure. The test intest/origin-words.test.tscounts every export ofsrc/origins/words.tsas a sentence. This pull addedforgeCarries, a function, so the count and the.trim()check broke. The test now counts only string exports, so the count stays 8. The test was wrong, not the code. It passes here, andtscis clean.- The two other reds are not touched:
- Snapshot bundle test:
test/snapshot-repositories.test.tspasses here, with "bundle did not finish within 0 s" in its log, which is what that test provokes. The forge's check found it green on main ate552430, so I take it as a timing flake under load. deploy_pull retention: this test belongs to the same load-sensitive group, and nothing in this diff touches it. I did not run it here.
- Snapshot bundle test:
If either fails again on the new push, I'll look at it then.
The "each sentence is non-empty" failure is already fixed on this branch, so I pushed nothing.
The check that failed ran on a commit where test/origin-words.test.ts expected nine sentences. The test counts the string exports of src/origins/words.ts, and there are eight. forgeCarries is a function, not a string, so it isn't counted. The latest commit (4b14903c9) corrects the count to eight.
On the current head, bun test test/origin-words.test.ts passes both tests. The branch matches origin/ and the working tree is clean. A fresh push would only re-trigger the check.
bun x tsc --noEmit didn't finish within the shell's 120 s limit, so I have no result for it. bun scripts/gate.ts --fix printed only its duplicate-scan timeout notice, and I didn't confirm it passed. The forge's own check runs both.
What this pull does is unchanged: bringing an app from another forge now brings how it runs. The origin card shows that run note instead of "how the app runs (not yet)", through the new forgeCarries sentence in src/origins/words.ts. I left out the terminal listing of origins, which still has no run note. There is no review block or look, because /settings/origins is behind sign-in and isn't a page in app.looks.
Direction: this is a feature pull while the owner's direction is pipeline first (#6534 and the rest); the commit only names #6534 as a placeholder. Findings, most important first: (1) HIGH: text from an untrusted forge.json (the parser message) is stored and printed raw in the terminal connections screen; only whitespace is collapsed, so escape and control characters reach the terminal. Strip control characters, or do not echo the parser message. (2) MED: carryRun is awaited inside the mirror job with no guard; a throw after the repo is mirrored fails the job. Catch it and record a note. (3) MED: one run_note per origin is overwritten by each bring, so it describes the last repository while reading as a statement about the origin. (4) Principles 1 and 8: the card now says how the app runs twice. (5) Clean: one-line statements and a double blank line in the new test, and a mangled literal in tui-waves. (6) The paste-a-link path still registers any repo as an app, so the two paths disagree. No review block or look of the card was given.
This pull now carries how the app runs when a repository brought from another forge has a valid forge.json. The origin card says so once instead of "(not yet)". I addressed findings 1, 2, 4 and 5 and answered 3 and 6 below, but I didn't write the review block for the card or answer the direction point.
- Terminal escapes (1): the parser message kept from an untrusted
forge.jsonnow has every control and format character collapsed to a space before it is stored (src/origins/bring.ts). A new test intest/forge-origin-run.test.tsfeeds it an ESC and a BEL and checks neither survives. carryRunthrowing (2): the call insrc/origins/mirror.tsis wrapped, so a bring that landed no longer fails the job if the note throws. The note is lost silently in that case; nothing records it.- Card said it twice (4): when a note exists,
forgeCarriesnow replaces the generic "How the app runs comes when…" sentence with "How the app runs, from the last bring: …". The note's wording and the tests that matched it are updated. - Formatting (5):
runNoteis on its own line intest/tui-waves.test.ts. I added no double blank line. - One note per origin (3): I left this. The note already starts with
owner/name, so it says which repository it describes, and the card now calls it "the last bring". Keeping a note per repository would need a new table, and I didn't think that was worth it for a single line on the card. - Paste-a-link path (6): I didn't touch it. Making it agree with the bring path is a separate change.
- Direction: pipeline-first versus this feature is the owner's call, so I did not change anything for it.
I ran bun x tsc --noEmit, which is clean, and bun test test/forge-origin-run.test.ts test/tui-waves.test.ts, which passes (26 tests). scripts/fast.ts named 3538 of 4199 test files, too broad to run here, so the forge's check will run the rest. scripts/gate.ts --fix reported one freeSlug similarity note between src/actions/bring.ts and src/actions/make_it_yours.ts. I didn't touch it.
This pull brings an app from another forge, and the run note travels with it. The origin's carried-over text now says what the run note covers.
Fix for the red check. The failing test, "the app page says in a sentence that production is not running" in test/web-apps.test.ts, was flaky and unrelated to this change.
- Cause (my diagnosis): the test stops production through
/app/production/stop. When production's environment isn't there yet, that route answers 404. I got exactly that 404 when I ran the test on its own, and I think the same thing happened in the check's shard. I couldn't confirm that, because the log didn't show the status. - Fix: the test now waits for the first deploy's run, then retries the stop for up to 10 seconds while it still gets 404.
- Test code only: no source changed for this fix.
Verification. test/web-apps.test.ts passed four times in a row locally, and tsc is clean. I did not run the full suite or any shard, so I haven't seen the shard that failed go green. The forge's check on this push will be the first proof of that.
To try the main change: bun test test/forge-origin-run.test.ts test/origin-words.test.ts.
Left out: I did not change anything outside test/web-apps.test.ts in this fix.
🤖 Generated with Claude Code
This pull brings an app from another forge and carries its run note over. The origin's carried-over text now says what the run note covers.
Fix for the red check. The gate refused my earlier fix to test/web-apps.test.ts. That fix retried the stop request in a loop with Bun.sleep, which counted as a third fixed wait in the file where two are allowed. I removed the loop. The "production is not running" test now waits with await runsOf(hello), the file's existing helper that waits for the first deploy run, and makes one stop request. It is still the only change to that test.
Verification.
bun scripts/gate.tsexits 0 and no longer reports the fixed-wait rule.test/web-apps.test.tspasses (29 tests) andtscis clean.- I did not run the full suite, and I haven't seen the shard that failed go green. This push's check will show that.
Gate advisory, left alone. The gate still prints freeSlug in src/actions/bring.ts as 0.73 similar to the one in src/actions/make_it_yours.ts. Both exist on main, and this pull only exports the one in bring.ts. Merging them is a separate refactor, so I did not do it here.
To try the main change: bun test test/forge-origin-run.test.ts test/origin-words.test.ts.
🤖 Generated with Claude Code
I fixed one of the two failing tests and left the other alone. I haven't seen the check re-run.
- "the app page says … production is not running": the test stopped production before the app's first deploy had settled. Waiting for any run wasn't enough. It now waits, up to 30 s, for a run that is no longer queued or running (
test/web-apps.test.ts).test/web-apps.test.tspasses locally. - "a fork that never followed says nothing false …": I left this one unchanged.
test/fork-last-follow.test.tspassed three times alone, and this pull changes nothing it reads: it touches no follow or standing-line code. It looks like a load-dependent flake in the 145-shard run. If it fails again on this push, it needs its own look.
The change is to test code only. tsc --noEmit is clean. bun scripts/gate.ts --fix printed one note: freeSlug in src/actions/bring.ts is 0.73 similar to the one in src/actions/make_it_yours.ts. I did not act on it, and it is from earlier in this pull, not this fix.
Since my last review the changes are the control-character strip on the kept parser message, the try/catch around carryRun, the card saying it once, the runNote formatting, and a test-only wait in test/web-apps.test.ts. Earlier asks: terminal escapes in the kept parser message are stripped and tested (met); a throwing carryRun no longer fails a landed bring (met); the card no longer says the run sentence twice (met); formatting (met); the per-origin note and the paste-a-link path were answered with reasons, which I accept. forge.json is judged by parseManifest, capped at 64 KiB, with no shell or SQL built from its text. The app is private and asleep, and no secrets are read. The terminal connections screen shows the same words as the page. The how-to is in docs/features/forge-origin.md, not README.
Non-blocking: the empty catch in src/origins/mirror.ts loses the note silently; log it. Non-blocking: freeSlug is now exported from bring.ts and exists twice (see make_it_yours.ts); merge them later. Non-blocking: this is a feature ahead of the pipeline-first list; the owner decides the order.
Bringing a repository from another forge now carries how it runs. A valid
forge.jsonat the head makes it an app here, and the origin's card andcarriessay what happened. I ran the new test and seven related suites (93 tests, all green), plustsc --noEmitanddesign-lint. I did not runbun teston the whole suite, and the forge's check will run on this push.src/origins/carry_run.tsreadsforge.jsonat the default branch's tip. It judges the file with the existingparseManifest, capped at 64 KiB, so untrusted input gets the same check a push does. If it is valid, the repository becomes an app here withenableApp: private, and no run or deploy is started, so it waits until the owner starts it. Plain git hosts are untouched.run_notecolumn (migration20261123130000, pinned). The card, the terminal's connections screen,GET /api/v1/user/originsand the MCP origins tool all show it throughforgeCarries(). For example: "alice/runs was carried: its forge.json is valid, so it is an app here, private and asleep until you start it". A bring that was not carried gives the reason: "it has no forge.json", "its forge.json does not declare an app", or "its forge.json is not valid (…)".test/forge-origin-run.test.tsbrings from a second real forge. A repository with a validforge.jsonends up as a private app with no runs, with the card andcarriessaying it was carried. A repository with noforge.jsonand one with a broken one make no app and give their reasons. It also checks that a.envin the source repository never shows. Its assertions onrun_noteand the new card words would fail without the change.What I left out:
I also changed
test/tui-waves.test.ts, where anOriginliteral needed the newrunNotefield. I added an empty commit with aTry:line because the pre-push hook asks for one.To try it, connect another forge at
/settings/origins, bring a repository that has aforge.json, and read the card.🤖 Generated with Claude Code
Closes #16070