Skip to content

feat: run BReg and Casework together with rstack dev - #2637

Merged
jeremi merged 34 commits into
mainfrom
feat/rstack-dev-2635
Nov 11, 2026
Merged

jeremi merged 34 commits into
mainfrom
feat/rstack-dev-2635

Conversation

@jeremi

@jeremi jeremi commented Nov 10, 2026

Copy link
Copy Markdown
Member

What changed

  • Add rstack dev start, status, token, and stop for isolated project runs. The launcher delegates through the verified toolset and keeps its bootstrap dependency boundary.
  • Validate a versioned dev.yaml before allocating resources. Use the ordinary BReg and Casework activation paths on supplied TLS PostgreSQL, with run-local keys, database roles, loopback endpoints, and bounded journeys.
  • Add maintained licensing and native review examples. Run the native acceptance in the existing Linux Casework integration job.

Verification

  • Native macOS acceptance with source-built tools and TLS PostgreSQL, including concurrent runs, foreign-token refusal, a separate deployment key, review handoff, unchanged authored files, and stop, expiry, and startup-failure cleanup.
  • Rust tests, Clippy, formatting, launcher dependency policy, schema and CLI snapshots, identifier references, and workflow lint.
  • Independent staff review of the exact Stack and Studio candidates. The companion verifies that Publish and local Try it exercise the same generated nursing project and clean up the databases and roles.

Implements #2635.

@jeremi jeremi added the ci:full Run the heavy integration tier on this pull request label Nov 10, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 10, 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-11-11T00:51:54.651846Z c99f843 New commits
ℹ️ 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6a5534d850

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/registry-bregctl/Cargo.toml Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2476d26bc7

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1f9a24ee8a

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e7be3ad77d

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 50076deed9

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
@jeremi
jeremi force-pushed the feat/rstack-dev-2635 branch from 0990c08 to 9e397c0 Compare November 10, 2026 21:18
@jeremi

jeremi commented Nov 10, 2026

Copy link
Copy Markdown
Member Author

Review fixes on top of the original change, rebased onto main with no merge commits:

  • caseworkctl explain lists every Casework access profile, and rstack dev reads profiles from that list instead of the review-policy dependencies, so a profile no review policy uses still resolves.
  • BReg grants may name a profile that carries only proposal permissions. An unknown BReg or Casework profile, an undeclared binding ID and an encrypted BReg field are refused at their plan pointers by dev check and by start, before start provisions anything.
  • Product output goes to owner-only logs. A failed start keeps its logs under the state directory's failed/ folder, and errors quote a bounded tail.
  • The run records the process groups it starts. A lost supervisor is reported with the run directory, process groups, databases and roles to release, and status never sees a half-deleted run directory.
  • A least-privilege administrator role (CREATEDB, CREATEROLE) can run the databases. A spatial project gets the PostGIS prerequisites. The run refuses a server without a supported PostGIS, and an administrator that may not create the extension, with an error that names the missing right; the run releases what it created.
  • A failed journey step names the expectation that failed. A poll that times out reports the last response it saw, and an interrupted run is reported as interrupted rather than failed.
  • --json is honoured for launcher failures, and rstack dev requires only the components the plan selects.
  • The generated plan schema describes every field, and the guide documents the administrator rules, recovery and logs.

Checks on the final head: format and clippy for registry-bregctl, registry-rstack and registry-caseworkctl; the project_dev unit and integration tests; the tool schema tests; the rstack dev tests; the caseworkctl tests; and products/platform/scripts/test-rstack-dev.py against PostgreSQL 18 with PostGIS (offline checks, concurrent journeys, native review handoff, stop, TTL expiry and failed-start cleanup, lost-supervisor recovery, a blocked operation timing out, and the spatial refusal).

Deferred to follow-up issues: stop --recover with a process ID reuse guard and one JSON error envelope; local field-encryption key custody; offline scope checks; test realism; and a docs-site how-to page.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9e397c047e

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
…ants

Send product tool and runtime output to owner-only logs under the run
directory and append the log tail to startup failures. Record child
process groups in processes.json. Refuse unknown BReg grant profiles at
their pointer and encrypted fields before provisioning. Read Casework
access profiles from the top-level accessProfiles of caseworkctl explain.

Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
…ns distinctly

Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
…st supervisor with recovery facts

Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
…PostGIS and URL refusals

Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
@jeremi
jeremi force-pushed the feat/rstack-dev-2635 branch from 9e397c0 to 07cc405 Compare November 10, 2026 21:53
@jeremi

jeremi commented Nov 10, 2026 •

Copy link
Copy Markdown
Member Author

The "Registry Adapter product contracts" job failed on the config-conventions lint, and all of its findings came from the review commits. This push fixes them in those commits:

  • The plan schema's Product and Method are plain string enums again, and people.*.grants is closed to breg and casework. Doc comments on the enum variants had turned them into oneOf constants and opened the grants map.
  • caseworkctl explain types each access profile id as a LocalId in the report schema.
  • The dev.yaml editor mapping and its test are restored, because the conventions require every authored format to have one.
  • The identifier catalog records the new sha256 of both regenerated schemas.

Checks on this head: the config-conventions lint (0 unrecorded, 0 stale), the identifier catalog check, check-tool-schemas.sh, the editor tests, the Casework schema tests, workspace cargo fmt, the dev gates listed above, and test-rstack-dev.py against PostgreSQL 18 with PostGIS (all seven scenarios).

Also reports plan refusals under breg.project-dev.invalid-plan, the code bregctl already uses for the same class.

Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
…n's components

Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
…sor recovery in the dev acceptance run

Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
…sees it half-deleted

Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
…ehind

Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
…deletion in the dev guide

Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
…orkctl explain reports

Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
… declare

Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
…grant remedy to Casework

dev check now inspects the products, so an encrypted BReg field is refused at the product's plan pointer instead of as an unlocated plan error. The BReg grant remedy uses the same wording as the Casework one, and the guide says check refuses grants, bindings and encrypted fields as start does.

Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
…variables are set

Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
@jeremi
jeremi force-pushed the feat/rstack-dev-2635 branch from 07cc405 to 13a5ce5 Compare November 10, 2026 22:41

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 13a5ce5fe1

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

The local issuer caps each token at five minutes, but `rstack dev token`
reported the run's expiry as the tokens' own, so a client that refreshed
on that time kept sending expired tokens. The report and the issuer now
share one expiry rule.

Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
A step's captures are all read from its own response, so a `find`
capture whose `where` value used a sibling capture passed validation and
then failed at run time. Validation now makes a step's captures available
only to later steps.

Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
A binding requests tokens for the other product's audience as an OAuth
resource, and the products accept that resource only as an absolute URI.
A bare audience such as `review` passed `rstack dev check` and failed
when the product loaded its configuration. Validation now refuses it at
the audience's plan pointer.

Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Stop waited for every open token request to finish, so a client that
sent headers and never finished its body held `rstack dev stop` forever.
The server now gets two seconds to drain, then open requests are dropped.

Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
A journey run spends about 200 ms building its client before the first
request, and the poll tests allowed 300 ms per poll inside a 500 ms
server window, so an occasional stall failed them. The budgets are now
one second inside a two-second window; the late body still arrives after
the deadline.

Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
@jeremi

jeremi commented Nov 10, 2026

Copy link
Copy Markdown
Member Author

Review round on the four Codex findings: all four fixed, one commit each, threads answered and resolved.

One more change, not from a thread: test(bregctl): give the dev poll tests room on a busy machine. poll_refuses_a_matching_response_that_finishes_after_its_deadline failed about once in fifteen full --lib project_dev runs. Timing it showed that a run spends about 200 ms building its client before the first request. Inside a 500 ms server window and a 300 ms poll budget, that left little room for a stall. The budgets are now one second inside a two-second window, and the late body still arrives after the deadline. 40 full runs passed after the change; the cost is about four seconds of test time.

Local checks on the pushed head: the dev runner gates (fmt, clippy -D warnings, the project_dev unit and integration tests, tool_schema, rstack --test dev, registry-caseworkctl), the conventions lint, the tool schema check, the identifier catalog check, the editor tests and the test-rstack-dev.py acceptance journey.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 019563b493

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

BReg and Casework request a binding identity's grant scopes through the
shared OAuth client, which refuses quoted or backslashed scopes and lists
longer than 4096 bytes at startup. rstack dev check accepted both, so the
run failed after provisioning. The binding check now applies the same
shared predicate and reports the grant's scopes pointer.

Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:full Run the heavy integration tier on this pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants