Repository navigation
feat(api): add Hosted fleet control endpoints - #1714
Conversation
|
Hosted fleet routes should only be enabled if fleet control is enabled via env |
|
✅ Applied the requested follow-up changes in commit 8db5de0 Summary of ChangesImplemented the PR follow-up without committing.
Validation passed:
🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
Implemented the PR follow-up without committing. - Hosted fleet routes are mounted only when `PROPR_FLEET_CONTROL_SECRET` is at least 32 characters. - Reused the same enablement check for authentication. - Updated `.env.example` documentation and added regression coverage. Validation passed: - API typecheck - API lint - Hosted fleet route tests: 6/6 - `git diff --check` PR: #1714 Comment by: @integry (ID: 5155392232) Model: gpt-5.6-sol
|
/ultrafix |
|
🔄 Ultrafix loop started (goal: 8/10, max cycles: 10) First action:
|
|
✅ AI Code Review Complete requested by @integry Posted 1 review: |
🔍 AI Code Review — codex:gpt-5.6-solOverall EvaluationThis PR adds secret-gated, instance-local Fleet endpoints for bootstrap verification, operational health, and queue health. The implementation is focused and uses immutable GitHub IDs, defensive route gating, dependency injection, and no-store responses. It needs minor changes before merge, primarily to enforce the promised bounded response contract and make bootstrap-cleanup signals unambiguous. Findings🟡 Delegated handlers do not enforce a bounded Fleet response — 🟡 Bootstrap cleanup state is ambiguous when additional bootstrap administrators exist — 🟡 The supposedly timing-safe comparison leaks length — 🟡 Normalized whitelist entries are not deduplicated — 🟡 Security-critical server wiring is not integration-tested — 🟢 Canonicalize the configured GitHub ID — 🟢 Cover the remaining response branches — Tests should exercise invalid or missing initial-admin IDs ( 🟢 Document secure secret generation — 🟢 Reduce ambient environment dependence in tests and construction — ✅ Hosted routes are genuinely disabled without Fleet control — ✅ Route ordering correctly supports machine-to-machine access — The Fleet routes are registered before ✅ Durable verification uses the immutable identity and required role — ✅ Sensitive login data is not returned — The bootstrap response exposes only the configured immutable ID and boolean state, and the test explicitly verifies that the login is absent. ✅ Operational safeguards are appropriate — Generic ScoreThe core design is sound and the requested environment gate is correctly implemented, but the response allowlisting and bootstrap-cleanup semantics should be tightened before relying on these endpoints operationally. Score: 7/10 🤖 Review Details
🤖 Review by ProPR |
|
✅ Applied the requested follow-up changes in commit 4b4a088
Summary of ChangesImplemented all review follow-ups for PR #1714.
Key files: hostedFleetRoutes.ts, server.ts, hostedFleetRoutes.test.ts. Verification passed:
No commit created. 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
Implemented all review follow-ups for PR #1714. - Fleet status/queue responses are explicitly validated and allowlisted. - Added `bootstrapOnlyInitialOwner`, username deduplication, injected bootstrap configuration, and GitHub ID canonicalization. - Fleet-secret comparison now uses fixed-length SHA-256 digests. - Added gated route-registration wiring before OAuth middleware. - Expanded unit and Express integration coverage. - Documented `openssl rand -hex 32` secret generation. Key files: [hostedFleetRoutes.ts](/tmp/git-processor/worktrees/integry/propr/pr-1714-followup-2026-08-02T05-01-52/packages/api/routes/hostedFleetRoutes.ts:44), [server.ts](/tmp/git-processor/worktrees/integry/propr/pr-1714-followup-2026-08-02T05-01-52/packages/api/server.ts:217), [hostedFleetRoutes.test.ts](/tmp/git-processor/worktrees/integry/propr/pr-1714-followup-2026-08-02T05-01-52/packages/api/test/hostedFleetRoutes.test.ts:1). Verification passed: - Repository-wide TypeScript check - API lint - 12 Fleet route tests - 32 combined Fleet/status tests - `git diff --check` No commit created. PR: #1714 Comment by: @propr-ultrafix (ID: 0) Model: gpt-5.6-sol
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
🔍 AI Code Review — codex:gpt-5.6-solOverall EvaluationThis PR adds secret-protected, instance-local Fleet endpoints for bootstrap verification and bounded operational health reporting. The environment-controlled registration gate, durable numeric GitHub-ID lookup, response field filtering, and pre-OAuth routing are thoughtfully implemented and well tested. It needs minor changes before merging, primarily to make failure handling and delegated status collection robust. Findings🟡 Bootstrap database failures are not handled — 🟡 Operational string values are not actually bounded — 🟡 Delegating through a fabricated Express response is fragile — 🟡 Tests do not verify compatibility with the real delegated handlers — 🟡 Invalid numeric GitHub IDs can be treated as configured — 🟢 Delegated failures should use a stable outward status contract — 🟢 Route exports are inconsistent — 🟢 Additional malformed-output tests would strengthen the boundary — Tests should cover non-string operational fields, negative/fractional queue counts, excessively long status strings, zero GitHub IDs, and database-query failures. ✅ Fleet routes are now genuinely gated by environment configuration — ✅ Authentication handling is careful — The implementation uses a dedicated header, digest-based constant-time comparison, and ✅ Responses expose a deliberately small surface — Queue output is reduced to waiting/active counts, operational output is restricted to four fields, and the configured GitHub login is never returned. ✅ Bootstrap verification uses the durable identity correctly — The lookup matches the configured canonical numeric GitHub ID and the ✅ The test suite covers the principal security and registration paths well — It checks missing and incorrect credentials, route omission when disabled, placement before the OAuth boundary, response sanitization, numeric-ID canonicalization, and removal-state calculations. ScoreStrong security-conscious implementation with good coverage, held back by an avoidable handler-adaptation abstraction and incomplete error/value-boundary handling. Score: 7/10 🤖 Review Details
🤖 Review by ProPR |
|
✅ Applied the requested follow-up changes in commit e2f58c0
Summary of ChangesImplemented all requested review fixes without committing:
Verification passed:
The standalone demo-mode suite still has two unrelated pre-existing expectation mismatches; no demo-mode code was changed. 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
Implemented all requested review fixes without committing: - Added sanitized bootstrap DB-error handling, positive bounded GitHub IDs, strict operational enums, and stable `503` health failures in [hostedFleetRoutes.ts](/tmp/git-processor/worktrees/integry/propr/pr-1714-followup-2026-08-02T05-21-25/packages/api/routes/hostedFleetRoutes.ts:30). - Replaced fabricated Express responses with shared pure collectors in [statusRoutes.ts](/tmp/git-processor/worktrees/integry/propr/pr-1714-followup-2026-08-02T05-21-25/packages/api/routes/statusRoutes.ts:68) and [queueRoutes.ts](/tmp/git-processor/worktrees/integry/propr/pr-1714-followup-2026-08-02T05-21-25/packages/api/routes/queueRoutes.ts:13). - Updated server/barrel wiring and added real-collector, malformed-output, database-failure, and ID-boundary tests. Verification passed: - 36 focused Fleet/status tests - 155 repository unit tests - Root and API TypeScript checks - Targeted ESLint - `git diff --check` The standalone demo-mode suite still has two unrelated pre-existing expectation mismatches; no demo-mode code was changed. PR: #1714 Comment by: @propr-ultrafix (ID: 0) Model: gpt-5.6-sol
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
🔍 AI Code Review — codex:gpt-5.6-solOverall EvaluationThis PR adds narrowly scoped, secret-protected Fleet bootstrap and health endpoints, correctly gated by Findings🟡 Fleet status collection performs substantially more work than the endpoint needs — 🟡 Collectors have no overall response deadline — Database, Redis, BullMQ, agent, or indexing operations that never settle can leave 🟡 A missing initial-admin login produces ambiguous bootstrap results — Only the numeric ID is required by 🟢 Queue heartbeats collect unused historical counts — Fleet only returns 🟢 Authentication logic is duplicated across all three handlers — 🟢 Document the hosted configuration contract more explicitly — 🟢 Consider a standard bearer credential or explicit header-redaction guidance — A custom 🟢 Avoid process-global console mutation in tests — Tests temporarily replace ✅ Hosted routes are genuinely disabled by default — ✅ Credential checking and response handling are defensive — The implementation compares fixed-size SHA-256 digests with ✅ Returned health data is tightly allowlisted — The parsers validate both types and bounded enum values and construct fresh response objects, preventing unrelated status fields, routing URLs, credentials, or backend error details from leaking. ✅ Bootstrap verification uses durable immutable identity correctly — GitHub IDs remain strings, are canonicalized without unsafe numeric conversion, and are matched against the exact administrator role. Tests cover renamed users, leading zeroes, IDs above JavaScript’s safe-integer range, and unrelated administrators. ✅ Test coverage is strong overall — The suite covers route gating, incorrect credentials, malformed configuration, database and collector failures, output allowlisting, administrator-state distinctions, and actual Express middleware ordering. ScoreThe core design and security boundaries are solid, with the main remaining concern being excessive and potentially unbounded work on a recurring operational endpoint. Score: 8/10 🤖 Review Details
🤖 Review by ProPR |
|
/merge |
|
🔀 Resolved merge conflicts from Conflicting Files
Resolution SummaryResolved all eight conflict blocks in the four requested files.
Verification passed: TypeScript syntax checks, API typecheck, all 67 focused tests, and 🤖 Resolution Details
System-triggered merge conflict resolution |
Automatically resolved merge conflicts after merging target branch into PR branch. Resolved conflicts in: - packages/api/routes/index.ts - packages/api/routes/queueRoutes.ts - packages/api/routes/statusRoutes.ts - packages/api/server.ts PR: #1714 Model: gpt-6-astra
|
CI failed: CodeQL Please investigate and fix this CI failure.
Failure evidence
|
|
✅ Applied the requested follow-up changes in commit c919784 Processed 2 comments:
Summary of ChangesUpdated Validation: 27 tests passed, typecheck passed, and 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
|
✅ AI Code Review Complete requested by @integry Posted 2 reviews: |
🔍 AI Code Review — fableOverall EvaluationThis PR adds three machine-to-machine ✅ Credential comparison is length-independent and constant-time — ✅ Responses are strictly allowlisted — ✅ Disabled-state behavior is verified end-to-end — Merge blockersNo merge blockers. SuggestionsThese are optional follow-ups and are not sent to S1: 🟢 Confirm the general API limiter precedes hosted routes in
|
🔍 AI Code Review — astraOverall EvaluationReady to merge within the reviewed scope. The PR adds narrowly scoped Fleet endpoints with dedicated authentication and explicit response filtering. The authoritative current-head checks report 30 passed and no failures or pending checks. This assessment is based on static review; no commands were run. ✅ Controlled activation — Route registration is skipped unless the Fleet secret meets the minimum length, and enabled handlers authenticate before accessing collectors or the database. ✅ Restricted disclosure — Responses explicitly allowlist fields, exclude login snapshots and sensitive operational details, and set ✅ Durable identity verification — Bootstrap verification queries the configured GitHub ID and administrator role, with tests covering renamed owners, different administrators, and database failures. Merge blockersNo merge blockers. SuggestionsThese are optional follow-ups and are not sent to S6: 🟢 Collect only necessary queue counts
S7: 🟢 Reconcile the identity range contract
ScoreThe implementation provides focused authentication, disclosure controls, and substantial coverage of success and refusal paths. Static review found no demonstrated merge blocker, and all current-head checks are passing or skipped. Score: 9/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
/fix all |
|
✅ Applied the requested follow-up changes in commit 2a76c40
Summary of ChangesI've applied S1–S7. All 19 hosted Fleet route tests pass,
Other things I noticed: none. 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
…statusRoutes` and `requestRateLimits` pass (54/54), and `npm run typecheck` and `git diff --check` are clean.
I've applied S1–S7. All 19 hosted Fleet route tests pass, `statusRoutes` and `requestRateLimits` pass (54/54), and `npm run typecheck` and `git diff --check` are clean.
- **S1 (rate limiter order):** The general limiter is already in place. `server.ts:244` mounts `app.use('/api', createApiRequestRateLimiter())` when the module loads, and `setupRoutes()` (which registers the hosted routes) only runs later inside `start()`. So I didn't add a second limiter. I added a comment at the registration saying this, and a test that reads `server.ts` and fails if the limiter ever moves after the `setupRoutes()` call.
- **S2 (demo-mode guard):** History shows the `isDemoMode()` guard in `getStatus` came in through an automated merge-conflict resolution (`c097f8278`), not from this PR's own work. I took it out of this PR rather than editing the PR description, so `statusRoutes.ts` now only differs from `main` by what Fleet needs. If you want the demo guard, it should go in its own change.
- **S3 (duplicate alias):** Removed the `collectStatus` alias. `server.ts` and the wiring test now use the existing `statusRoutes.readStatusSnapshot`.
- **S4 (startup warnings):** `registerHostedFleetRoutes` now logs a `console.warn` at startup, naming the variable but never its value, when:
- `PROPR_FLEET_CONTROL_SECRET` is set but shorter than 32 characters (the routes stay off).
- the secret has leading or trailing whitespace. HTTP header values are trimmed in transit, so a padded secret could never match and every request would get a 401.
- `PROPR_HOSTED_INITIAL_ADMIN_GITHUB_USER_ID` is unset or invalid.
A new test covers each case, checks that an unset secret and a valid configuration log nothing, and checks that no logged message contains a configured value.
- **S5 (`.env.example`):** The three variables are now commented out, the same way the relay and tunnel tokens are.
- **S6 (queue counts):** `collectQueueStats` now fetches only the waiting and active counts. In the wiring test, the completed, failed and delayed counters now throw if called, so the test fails if they're read again.
- **S7 (ID range):** Added a doc comment on `canonicalizeGithubUserId` explaining that IDs are handled as decimal strings: the durable column is text and is never converted to a number, so IDs larger than JavaScript's safe-integer limit are kept intact. No runtime change.
`node_modules` was missing in the container, so I ran the repo's own `npm ci && npm run test:prepare` before testing; no setup files changed. These changes aren't visible in the UI, so there are no previews.
**Other things I noticed:** none.
PR: #1714
Comment by: @integry (ID: 5991938265)
Model: claude-opus-5-5
|
/review fable astra |
|
✅ AI Code Review Complete requested by @integry Posted 2 reviews: |
🔍 AI Code Review — fableOverall EvaluationThis PR adds three machine-to-machine I traced the registration order in ✅ Fail-closed activation and credential handling — ✅ Strict response allowlisting with matching value spaces — ✅ Meaningful wiring tests — Merge blockersNo merge blockers. SuggestionsThese are optional follow-ups and are not sent to S8: 🟢 Replace source-text ordering test with a behavioral check
S9: 🟢 Decide between trimming or refusing a whitespace-padded secret
S10: 🟢 Document the startup snapshot of bootstrap/whitelist inputs
S11: 🟢 Align the PR description with the ID validation actually implementedThe description says the initial admin ID is validated "as a positive safe integer", but S12: 🟢 Consider a dedicated limiter or peer restriction for the Fleet surfaceThe handlers rely on the shared ScoreNo verified blockers; the changed behavior is correct, fail-closed, well-tested at both unit and Express-wiring levels, and consistent with the stated objective. Merge readiness is conditional only on the pending Validate Changes and test-shard checks finishing green. Score: 8/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
🔍 AI Code Review — astraOverall EvaluationThe PR adds narrowly scoped Fleet endpoints with dedicated authentication, durable administrator verification, and bounded health responses. It is merge-ready within the reviewed scope, conditional on the seven pending checks completing successfully. Review was static; no commands or tests were run. ✅ Protected registration — Routes require a sufficiently long configured secret, run behind the general API limiter, and authenticate before invoking collectors. ✅ Minimal disclosure — Responses explicitly allowlist fields, omit the login snapshot and backend error details, and disable caching. ✅ Durable identity verification — Bootstrap verification queries the configured GitHub ID and administrator role rather than trusting a mutable username. Merge blockersNo merge blockers. SuggestionsThese are optional follow-ups and are not sent to S13: 🟢 Document the final identity contract
S14: 🟢 Consider a narrower health collectorThe Fleet status endpoint uses ScoreThe changed implementation provides strong authentication boundaries, conservative response validation, and substantial targeted coverage. No verified blocker or current-head check failure remains; seven checks are pending. Score: 9/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
Checks FailedValidation failed during setup, tests, CLI packaging, linting, or build checks. View Logs |
|
CI failed: Validate Changes Please investigate and fix this CI failure.
Failure evidence
|
|
✅ Applied the requested follow-up changes in commit 4171b6c Processed 2 comments:
Summary of ChangesI fixed the failing API lint check.
Checks run locally:
Neither file is named in a 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
…edFleetRoutes.test.ts` was 447 lines once blank lines and comments are left out, over the 400-line `max-lines` limit, so I split it into two files. No tests changed; they only moved. I fixed the failing API lint check. `packages/api/test/hostedFleetRoutes.test.ts` was 447 lines once blank lines and comments are left out, over the 400-line `max-lines` limit, so I split it into two files. No tests changed; they only moved. - **`packages/api/test/hostedFleetRoutes.test.ts`** keeps the bootstrap-status and health-status tests and their helpers. - **`packages/api/test/hostedFleetRoutesWiring.test.ts`** (new) holds the "hosted fleet Express wiring" tests, with the helpers only they use (`fetchFromApp`, `wiredApp`). It has its own copy of the in-memory database setup and teardown. **Checks run locally:** - All 19 hosted Fleet route tests pass across the two files. - `eslint --max-warnings 0` is clean on both files, and the full `@propr/api` lint passes. - `npm run typecheck` and `git diff --check` are clean. Neither file is named in a `package.json` test script, so the suite should pick up the new file the same way it found the original. I didn't confirm that against the CI runner. There's nothing visual in this change, so no previews were created. PR: #1714 Comment by: @github-actions[bot] (ID: 5992179463) Comment by: @propr-dev[bot] (ID: 5992179753) Model: claude-opus-5-5
|
/review fable astra |
|
✅ AI Code Review Complete requested by @integry Posted 2 reviews: |
🔍 AI Code Review — fableOverall EvaluationThis PR adds three GET endpoints under I traced the Express ordering in ✅ Fail-closed activation gate — ✅ Strict output allowlisting — ✅ ID handling matches the durable schema — The PR is ready to merge within scope. Merge blockersNo merge blockers. SuggestionsThese are optional follow-ups and are not sent to S15: 🟢 Reject whitespace-padded secrets instead of warning
S16: 🟢 Log an explicit "enabled" notice at startupRegistration logs only misconfiguration cases. When the secret is valid there is no startup line indicating that S17: 🟢 Source-text ordering test is brittle
S18: 🟢 Heavy snapshot for a heartbeat endpoint
S19: 🟢 Whitelist flag reflects env only
ScoreWell-scoped, fail-closed, thoroughly tested addition that resolves both earlier review concerns (env gating and rate limiting) with all current-head checks passing; only minor hardening and test-brittleness notes remain. Score: 9/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
🔍 AI Code Review — astraOverall EvaluationReady to merge within the reviewed scope. The PR adds narrowly scoped Fleet endpoints with explicit environment activation, dedicated authentication, and bounded responses. The authoritative current-head checks report 30 passed and no failures or pending checks. ✅ Protected registration — Routes register only with a sufficiently long Fleet secret, precede the shared OAuth guard, and remain behind the general API rate limiter. ✅ Immutable administrator verification — Bootstrap verification queries the configured GitHub ID and durable ✅ Bounded responses — Operational fields and queue counts are explicitly validated and allowlisted; collector failures return sanitized errors. This review used static tracing of the supplied diff and surrounding context. No commands or tests were run. Merge blockersNo merge blockers. SuggestionsThese are optional follow-ups and are not sent to S20: 🟢 Test loss of administrator authorityAdd a regression test that verifies the configured owner, demotes or removes their durable role, then repeats the request using the same route instance. The fresh database lookup in ScoreThe implementation satisfies the reviewed bootstrap, authentication, and response-minimization requirements, with substantial unit and wiring coverage and passing current-head checks. No merge-blocking defect was demonstrated. Score: 9/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
…w passes locally. The failure wasn't caused by this PR's Planner change. It came from the hosted Fleet API that was merged into `main` (#1714, `dc049dcdf`). `main` has the same problem and nothing on it has fixed it yet. I fixed the Shard 1/4 failure, and the failing test file now passes locally. The failure wasn't caused by this PR's Planner change. It came from the hosted Fleet API that was merged into `main` (#1714, `dc049dcdf`). `main` has the same problem and nothing on it has fixed it yet. **Cause:** `packages/api/test/openapiRouteCoverage.test.ts` was the only failing file in the shard. It requires every route registered directly on the app to be listed in `packages/api/openapi/directRoutes.ts`. #1714 added three such routes in `routes/hostedFleetRoutes.ts` and didn't list them: - `GET /api/internal/hosted/bootstrap` - `GET /api/internal/hosted/status` - `GET /api/internal/hosted/queue` **Fix:** - **`packages/api/openapi/directRoutes.ts`:** listed the three routes as `auth: 'public'`, the same way the other secret-protected internal routes (`/api/internal/agent-runs/...`) are listed. A comment notes they check the `X-ProPR-Fleet-Secret` header and only exist when `PROPR_FLEET_CONTROL_SECRET` is set. - **`packages/api/openapi/buildSpec.ts`:** added `/api/internal/hosted` to the `System` group of the API spec. With the routes listed, the spec builder needs a group for them or it throws an error. - **`docs/static/openapi/propr-api.yaml`:** regenerated with `npm run gen:openapi`. It now has the three routes, marked as not yet documented, and the route count goes from 258 to 261. The generated client types didn't change. **Checks run locally:** - The route-coverage, response-conformance, hosted Fleet wiring and API reference page tests: 30 passed, 0 failed. - `npm run gen:openapi:check` and `npm run check:client-contract` both pass. - `tsc --noEmit` on `packages/api` reports no errors. I didn't run the rest of the full suite locally. Only this one file failed in the CI shard. There's nothing visible to preview, so I didn't create one. PR: #2949 Comment by: @propr-dev[bot] (ID: 6102275771) Model: Claude Opus 5.5
…ckages/api/test/openapiRouteCoverage.test.ts`, which isn't related to the badge change. I fixed the Shard 1/4 failure. The test that failed was `packages/api/test/openapiRouteCoverage.test.ts`, which isn't related to the badge change. **Cause:** the hosted-fleet API merge (#1714) added three routes in `packages/api/routes/hostedFleetRoutes.ts`: `GET /api/internal/hosted/bootstrap`, `/status` and `/queue`. They aren't in `packages/api/openapi/directRoutes.ts`, and the test requires every route registered directly on the app to be listed there. CI only named `bootstrap` because the test stops at the first missing route, but all three were missing. `main` has the same gap and no open PR fixes it, so other branches will fail this test too until it's fixed there. **Fix:** - **`packages/api/openapi/directRoutes.ts`:** listed the three routes. They're marked `public` with a comment saying Fleet authenticates with the `X-ProPR-Fleet-Secret` header, the same way the existing internal agent-run routes are listed. - **`packages/api/openapi/buildSpec.ts`:** once the routes were listed, the spec generator stopped because no API section covered them. I added `/api/internal/hosted` to the "System" section (health, compatibility and status). - **`docs/static/openapi/propr-api.yaml`:** regenerated with `npm run gen:openapi`. This adds the three routes, marked undocumented, and the route count goes from 258 to 261. The changes only add lines, so they should merge cleanly with `main`. **Verification:** - `openapiRouteCoverage.test.ts` now passes (14 of 14). - `npm run gen:openapi:check` reports the committed spec is up to date. - Shard 1 had no other failures. - `hostedFleetRoutesWiring.test.ts` fails 2 of 5 here, but it passed in CI on Shard 4. My changes are to the spec files and data lists, not the route wiring, so I put it down to this container's setup. This only changes the API spec, so there's nothing visible to preview. PR: #2951 Comment by: @propr-dev[bot] (ID: 6102296581) Model: Claude Opus 5.5
…hanges: it came from main, from the hosted fleet merge (#1714) that this branch's commit sits on top of. I fixed the shard 1/4 failure. The cause wasn't this PR's changes: it came from main, from the hosted fleet merge (#1714) that this branch's commit sits on top of. **What failed:** one test in `packages/api/test/openapiRouteCoverage.test.ts` checks that every route registered directly on the app is listed in the OpenAPI route table. The hosted fleet merge added three routes without listing them, and the test stopped at the first one: `GET /api/internal/hosted/bootstrap is registered directly; list it in openapi/directRoutes.ts`. **Fix:** - **`packages/api/openapi/directRoutes.ts`:** listed `/api/internal/hosted/bootstrap`, `/status` and `/queue` as `public`, with a comment explaining why. They are checked against `PROPR_FLEET_CONTROL_SECRET` rather than a user login, and they only exist when that secret is set. The two existing `/api/internal/agent-runs` routes are listed the same way. - **`packages/api/openapi/buildSpec.ts`:** the spec generator then refused to run because no group in the API docs covered `/api/internal/hosted`. I put it in the System group ("Health, compatibility and status"). - **Regenerated `docs/static/openapi/propr-api.yaml`:** three new entries, total route count 258 → 261. **Checked locally:** the route coverage test and the response conformance test both pass (22 pass, 0 fail) when run with the same flags the CI unit-test command uses, and `npm run gen:openapi:check` reports the spec and client types are up to date. Run without those flags, the conformance test fails, so a bare `npx tsx --test` run will show a failure. I did not re-run the full shard. There are no visual changes, so I didn't make previews. PR: #2953 Comment by: @propr-dev[bot] (ID: 6102411979) Model: Claude Opus 5.5
…in`, not by this PR. I fixed the shard 1/4 failure. It was caused by code on `main`, not by this PR. **Cause:** the failing test was `packages/api/test/openapiRouteCoverage.test.ts`: > `GET /api/internal/hosted/bootstrap is registered directly; list it in openapi/directRoutes.ts` The hosted-fleet merge (#1714, `dc049dcdf`) added three routes in `packages/api/routes/hostedFleetRoutes.ts:232-234` but didn't list them in the OpenAPI route list. This branch is based on that merge, and `main` still doesn't have the fix, so any PR built on it fails the same way. Open PR #2951 already carries the fix, and I copied it exactly so the two PRs won't conflict when they merge. **Changes:** - **`packages/api/openapi/directRoutes.ts`**: lists the `bootstrap`, `status` and `queue` routes under `/api/internal/hosted/`. - **`packages/api/openapi/buildSpec.ts`**: adds `/api/internal/hosted` to the `System` tag's prefixes. - **`docs/static/openapi/propr-api.yaml`**: the updated spec. I ran `npm run gen:openapi` and it produced the same file. **Tests:** `openapiRouteCoverage.test.ts`, `openapiResponseConformance.test.ts` and `test/openapiReferencePage.test.mjs` pass (25 passed, 0 failed) when run from the repo root with the `test:unit` flags. I didn't run the rest of shard 1/4. I made no visual changes, so there are no previews. PR: #2950 Comment by: @propr-dev[bot] (ID: 6102456989) Model: Claude Opus 5.5
…es to the OpenAPI route list. The cause is a defect on `main`, not anything in this PR's docs changes. I fixed the Shard 1/4 failure by adding three internal routes to the OpenAPI route list. The cause is a defect on `main`, not anything in this PR's docs changes. **Cause:** CI tests this branch merged with current `main`. On `main`, merge #1714 (hosted fleet API, `dc049dcdf`) added three routes in `routes/hostedFleetRoutes.ts` but didn't list them in `packages/api/openapi/directRoutes.ts`: - `GET /api/internal/hosted/bootstrap` - `GET /api/internal/hosted/status` - `GET /api/internal/hosted/queue` So `test/openapiRouteCoverage.test.ts` failed with: > `GET /api/internal/hosted/bootstrap is registered directly; list it in openapi/directRoutes.ts` `main` still has the gap. The PR that fixes it (#2951) is open and not merged. **Fix:** I applied the same route-listing changes #2951 makes, and nothing else from it: - `packages/api/openapi/directRoutes.ts`: lists the three routes. - `packages/api/openapi/buildSpec.ts`: files `/api/internal/hosted` under the System tag. - `docs/static/openapi/propr-api.yaml`: the generated spec with the three new entries. **Verification:** - **Merge with `main`:** I simulated it for each of the three files and none conflict. - **Tests:** `openapiRouteCoverage` and the OpenAPI spec tests pass, 14 of 14. That holds both on the branch alone and with `main`'s `server.ts` and `hostedFleetRoutes.ts` copied in to match what CI builds. I then removed those copied files. Because these hunks are identical to #2951's, the two PRs won't conflict whichever merges first. PR: #2870 Comment by: @propr-dev[bot] (ID: 6102559369) Model: Claude Opus 5.5
Summary
Adds the protected, instance-local API surface that ProPR Fleet uses to complete
Hosted bootstrap verification and collect operational health. These endpoints
expose only the minimum state Fleet needs and never expose OAuth tokens,
credentials, customer data, or the configured login snapshot.
Dependency / PR structure
This is a stacked PR based on
feat/instance-admin-roles/ #1713. It relies onthat PR's durable numeric-GitHub-ID role model and administrator claim state.
After #1713 merges, this PR can be retargeted to
mainwithout changing itsscope.
Endpoints
GET /api/internal/hosted/bootstrapreports whether the configured immutableGitHub user ID has claimed the durable administrator role and whether the
temporary bootstrap controls can be removed.
GET /api/internal/hosted/statusreturns bounded API/RoutingHub operationalstate for Fleet verification and heartbeat collection.
GET /api/internal/hosted/queuereturns bounded waiting/active queue countsfor health and drain decisions.
The routes are registered before normal OAuth middleware because they use a
dedicated service credential and are not customer-browser endpoints.
Security and identity
PROPR_FLEET_CONTROL_SECRETwith at least 32 characters.X-ProPR-Fleet-Secretand compares it withtimingSafeEqualafter equal-length validation.PROPR_HOSTED_INITIAL_ADMIN_GITHUB_USER_IDas a positive safeinteger and uses it—not the mutable login—to verify administrator ownership.
PROPR_HOSTED_INITIAL_ADMIN_GITHUB_LOGINas an operational snapshotonly and does not return it from the API.
administrator/member authorization.
Configuration
Adds the following documented environment values:
PROPR_FLEET_CONTROL_SECRETPROPR_HOSTED_INITIAL_ADMIN_GITHUB_USER_IDPROPR_HOSTED_INITIAL_ADMIN_GITHUB_LOGINFleet/Ansible supplies these per tenant through the protected Hosted
environment; they must not be baked into images or shared between tenants.
Cross-repository dependencies
Validation
npm run typecheckverified immutable administrator identity, rejection of a different admin,
and protected operational status.
git diff --checkpasses.Rollout and rollback
Deploy only after #1713 and configure the per-tenant secret/owner identity
through Ansible. Fleet treats an unavailable or inconclusive endpoint as failed
verification and does not report the instance
ACTIVE.Rollback removes the internal routes and environment values. Existing durable
role state is unchanged; Fleet must remain paused or in pre-active state until a
compatible ProPR version is restored.