A skewed framework build is refused by the repo's layout marker (fix #1575) - #1598
Merged
Conversation
…1575) Cloud web runs execute the published npm build, and a published build that predates a repo-side rename committed its session archive under the retired sessions/ name (#1574) — caught hours later by main's guard test instead of seconds in, with a message about symptoms rather than the cause. The repo now records the bookkeeping layout it is on in a tracked .the-framework/LAYOUT marker, and a build whose own layout differs refuses the session outright before writing anything — both layouts and the fix named, no degraded mode, the same stance as the extension version gate (#1519). The marker's content derives from the build's layout constants, so a rename changes it by itself, and a lockstep test pins the checked-in marker to the derivation — a rename cannot land without regenerating it. Install seeds the marker (and un-ignores it), so every newly activated repo is gated from the start; a repo without one stays ungated. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Member
Author
|
Live-tested end to end against a scratch repo, using the built CLI (
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The problem, plainly
Cloud web runs don't use your local build — the cloud environment installs the framework from npm, and the published version can be older than the repo it works on. That happened in #1574: the repo had renamed its archive folder from
sessions/toagents/weeks earlier, but the published build didn't know, saved a session archive under the old name, and the bad commit sailed into a PR — caught only hours later by main's guard test, with an error about symptoms rather than the cause.The fix, plainly
The repo now carries a small committed file,
.the-framework/LAYOUT— 7 lines saying where the framework keeps its bookkeeping:Before starting any session, the framework compares this file against what the running build would write. If they disagree, the session is refused immediately — exit 1, both layouts printed side by side, the fix named — before a single file is written. Same stance as the extension version gate (#1519): refuse, don't warn, because a skewed build doesn't fail loudly on its own — it half-works, and its wrong-layout commits look plausible to a human.
The file's content is generated from the code's own constants, and a lockstep test pins the checked-in file to that generation (the
EXPECTED_EXTENSION_VERSION↔manifest.jsontrick). So nobody has to remember to bump anything: renaming a folder in code breaks the test until the file is regenerated in the same PR.What changed where
src/layout.ts(new) — the marker derivation +checkLayout(). A repo without the marker passes ungated (how test fixtures and pre-gate repos keep working; install writes it, so every newly activated repo is gated).src/cli.ts— the gate runs indriveAgentright after the workspace is known, before any write.src/install.ts— seeds the marker; the seeded.gitignoregains!LAYOUT(its*rule would otherwise keep the marker out of the install commit).src/layout.test.ts— unit coverage + the lockstep test;control.test.ts's committed-files guard now allowsLAYOUT..the-framework/LAYOUT+.the-framework/.gitignore— the repo's own marker, checked in.How this fits #1595 (data branch)
Compatible — and complementary. #1595 keeps every name this marker derives from (
tickets,TODO_AGENTS.md,agents, …) but changes where they live (thethe-framework_databranch). Two touchpoints:data-branch: the-framework_datafrom itsDATA_BRANCHconstant — so the placement change itself becomes a layout change the gate catches. One line inlayoutMarker(); the lockstep test then forces the checked-in marker to regenerate in that same change.Only textual overlap: both touch
.the-framework/.gitignore(!LAYOUTmust survive #1595's simplification).Limits