Skip to content

feat(staged): let sessions create any number of projects - #1126

Merged
matt2e merged 2 commits into
mainfrom
10-project-limit
Dec 3, 2026
Merged

matt2e merged 2 commits into
mainfrom
10-project-limit

Conversation

@matt2e

@matt2e matt2e commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Summary

A session, and the sessions in its chain, could hold at most 10 projects created through stagedctl project create. Nothing ever decayed that count. Once 10 of a chain's projects existed, a long-lived orchestrating session was refused for good until the user deleted some. This PR removes the cap.

  • Remove CREATED_PROJECT_LIMIT and both ensure_within_limit checks: the early one in the control request builder and the locked one beside the insert. Delete the creation_limit module.
  • Remove the chain-depth guard (SESSION_LINEAGE_MAX_DEPTH). It only bounded the lineage walk that the count needed.
  • Remove the code this leaves dead: ProjectCreator::limit, plus the store's session_lineage_root, session_actor_id, count_projects_by_creator and list_project_ids_created_by.
  • projects.created_by is still recorded for every project created through the control server, as attribution only. No migration and no schema change.
  • stagedctl project create --help, the pinned help fixture and the agent guide (resources/stagedctl/guide.md) no longer describe a limit.

A connected app approved for a single project still cannot create projects (exit 4, scope_denied).

Testing

  • Tests that pinned the limit's wording now check that the wording is gone.
  • A new test creates 25 projects as a session and 25 as a connected app.
  • The pre-push staged-ci hook passed.

🤖 Generated with Claude Code

A session and the sessions in its chain could hold at most 10 projects
created through `stagedctl project create`. The count had no decay, so a
long-lived orchestrating session was refused for good once 10 of its
chain's projects existed, until the user deleted some.

Remove the cap:

- Drop `CREATED_PROJECT_LIMIT` and both `ensure_within_limit` checks (the
  early one in the control request builder and the locked one beside the
  insert), and delete the `creation_limit` module.
- Drop the chain-depth guard (`SESSION_LINEAGE_MAX_DEPTH`), which only
  bounded the walk the count needed.
- Remove what that leaves dead: `ProjectCreator::limit`, and the store's
  `session_lineage_root`, `session_actor_id`, `count_projects_by_creator`
  and `list_project_ids_created_by`.
- `projects.created_by` is still recorded for every control-created
  project, as attribution. No migration.

`stagedctl project create --help`, the pinned help fixture and the agent
guide no longer describe a limit, and the tests that pinned the limit's
wording now check it is gone. A new test creates 25 projects each as a
session and as a connected app.

Signed-off-by: Matt Toohey <contact@matttoohey.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-03T03:16:18.106274Z 2304af6 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

…docs

Review of the cap's removal found the control server's module doc still
saying a class B grant "is free of the two rules that ask whether the
actor is a session (`open_project`, and the limit on created projects)".
The limit is gone, so only the `open_project` refusal remains.

- `control_server.rs`: state the single rule, matching the "one decision"
  wording `grants.rs` already uses.
- `control_server/enrol.rs`: the "Who may enrol" paragraph listed the same
  limit among what a session would shed by enrolling. The review did not
  flag it; a sweep for the phrase did. Reworded the same way.

Comments only; no behaviour change.

Signed-off-by: Matt Toohey <contact@matttoohey.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@matt2e
matt2e merged commit 42ec05c into main Dec 3, 2026
8 checks passed
@matt2e
matt2e deleted the 10-project-limit branch December 3, 2026 03:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant