Skip to content

Refs GRE-402: admit list_example_builds and get_print_stats resources - #1241

Merged
poitee merged 3 commits into
mainfrom
gre-402-next-admission-3
Oct 29, 2026
Merged

poitee merged 3 commits into
mainfrom
gre-402-next-admission-3

Conversation

@poitee

@poitee poitee commented Oct 26, 2026 •

Copy link
Copy Markdown
Owner

Summary

Next GRE-402 (T-7-ownership) slice after #1231. It admits reviewed resource unions for two Node-owned assistant reads that summarize plans. Both are traced through real dispatch under the trusted and isolated policies:

  • tool.list_example_builds: the tool.list_plans union plus kit-catalog. With useOtherBuildsAsExamples off it returns before any read. Otherwise it loads the kit catalog, reads the assistant_feedback setting to rank plans, and lists tenant plan headers (the same listProfileHeaders reads as list_plans). For each of up to five other plans, it repeats the ownership check, reads layers and their project rows, and reads the kit_manifest_<id> and role_filaments_<id> settings. Under the isolated policy it probes layer workspaces.
  • tool.get_print_stats: the tool.list_plans union, the accepted-progress tables (plan_revisions, plan_revision_parts, plan_revision_required_unit_sets, plan_revision_required_units, print_progress, required_units) and a new print_jobs table. With PP_DESKTOP_REBUILD, it reads the farm toggle in app_settings first; a disabled or invalid toggle returns before any other read, as does an invalid hours window. It does not contact printer hosts or Spoolman. tool.get_farm_status stays unresolved.

Rust adds TableId::PrintJobs. list_plans and both new entries share one plan_headers set. The rollback-format helper in the Rust test now takes the full format list, so the two interaction-graph tests pass their formats explicitly.

Reviewed goes from 61 to 63, unresolved from 381 to 379 (373 after merging main, which removed six unresolved operations in #1240). GRE-402-remaining-scope.md is updated. It also corrects stale totals: it said 443 resolved and 382 unresolved, but the Rust test pins 442 and 381.

This PR changes no runtime behavior. It adds declarations and the tests that check them. Nothing enforces them yet, and no operation moves to Rust.

Evidence

Fix round 1: merge origin/main (head abe152c6)

Merged origin/main at ce36a1cf with no rebase or force-push. One conflict, in the partition asserts of rust/crates/pp-gateway/tests/ticket_t_7_operation_resources.rs. Main moved unresolved from 381 to 375, and this branch moved reviewed from 61 to 63. The merged values are 63 reviewed and 373 unresolved. The totals in GRE-402-remaining-scope.md changed to match: 436 resolved, 373 unresolved. ownership-manifest.json merged cleanly. Ran with CARGO_TARGET_DIR=/persist/targets/GRE-402.

  • cargo check -p pp-gateway --tests: ok.
  • cargo test -p pp-gateway: every target passed (103 in ticket_t_7_operation_resources, 30 in ticket_t_3_drain_cutover), 0 failed.
  • cargo clippy --locked -p pp-gateway --all-targets -- -D warnings: clean. cargo fmt --check -p pp-gateway: clean.
  • npx vitest run src/assistant/operation-resources.test.ts (web/apps/server): 124 passed.
  • npm run typecheck (web root): exit 0.

Original slice (head aea13b458)

Head aea13b458, branched from main 74fc33327. Ran with umask 022 and CARGO_TARGET_DIR=/persist/targets/GRE-402. pp-compat used a freshly generated rust/bundle-manifest.json.

  • Red then green: with the new TS traces in place and no manifest entries, npx vitest run src/assistant/operation-resources.test.ts -t "list_example_builds|get_print_stats|example builds and print stats" failed 4 of 5 with Missing tool.list_example_builds declaration / Missing tool.get_print_stats declaration. Every trace assertion before the declaration check had already passed. After adding the declarations: 5 passed.
  • npx vitest run src/assistant/operation-resources.test.ts (web/apps/server): 124 passed. New tests:
    • list_example_builds, trusted and isolated: disabled branch with zero SQL and zero filesystem calls, feedback ranking, active-plan and explicit exclude_plan_id exclusion, kit selection and role filament summaries, tenant isolation, empty result. Every SQL statement is rejected under the other tenant's classifier.
    • get_print_stats, trusted and isolated: 8 h and 24 h window counts, rejected windows with zero reads, archived plans, accepted progress, farm disabled and invalid toggles (only app_settings read), tenant isolation.
    • A classifier test that rejects foreign-tenant print_jobs, source_docs, writes and undeclared files.
  • npx vitest run src/assistant (web/apps/server): 27 files, 397 passed.
  • cargo nextest run --locked -p pp-gateway --no-tests=fail: 231 passed, 0 failed. This includes ticket_t_7_operation_resources with the new list_example_builds and get_print_stats tests and the 63/379 partition.
  • cargo clippy --locked -p pp-gateway --all-targets -- -D warnings: clean. cargo fmt --check -p pp-gateway: clean.
  • python3 rust/scripts/check-ast-grep.py: counts match the baseline.
  • npm run typecheck (web root): exit 0. npx eslint src/assistant/operation-resources.test.ts: clean.
  • Full server npm run test:ci: 4692 passed, 3 failed, 1 skipped (344 files). All three failures were timeouts under full parallel load (15 s and 30 s), in ownership-migration, accepted-plan-progress-summary (the 10,001-unit PostgreSQL page test) and source-sync-admission.runtime (stdio MCP refusal). Refs GRE-402: admit get_interaction_graph and check_stack_compatibility resources #1231 recorded the same timeouts. This diff touches none of those files. Rerun serially (--maxWorkers=1 --no-file-parallelism), the three files passed 151/151.

Merge Danger

Two-way door. The diff adds only manifest declarations, one table enum variant, two admission entries, and tests. No runtime path calls the resource index yet. Blast radius: bundled manifest admission in pp-gateway. A wrong declaration fails admission or tests, and cannot touch user data.

Refs GRE-402

🤖 Generated with Claude Code

Author-Vendor: anthropic
(Author per owner-lock comment: VM134 author claude-opus-5-5.)

Declare reviewed resource unions for two Node-owned plan summary reads,
traced through real dispatch under trusted and isolated policies:

- tool.list_example_builds: the tool.list_plans union plus kit-catalog.
- tool.get_print_stats: the tool.list_plans union, the accepted-progress
  tables and the new print_jobs table.

list_plans and both new entries share one plan_headers set in Rust.
Reviewed 61 -> 63, unresolved 381 -> 379. The scope doc also corrects
its stale 443/382 totals to the pinned 442/379.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@poitee
poitee marked this pull request as ready for review October 26, 2026 19:08
@poitee

poitee commented Oct 26, 2026

Copy link
Copy Markdown
Owner Author

seat exhausted: opencode/glm-5.3-flash-free (head aea13b4)

@poitee

poitee commented Oct 26, 2026

Copy link
Copy Markdown
Owner Author

seat exhausted: opencode/deepseek-v4.1-flash-free (head aea13b4)

@poitee

poitee commented Oct 26, 2026

Copy link
Copy Markdown
Owner Author

owner-lock: VM134 scorer claude-sonnet-5-5 (halo seat 429)

@poitee

poitee commented Oct 26, 2026

Copy link
Copy Markdown
Owner Author

score 9/10 claude-sonnet-5-5 head aea13b4

I read the diff and checked the declared resource sets against summarizeOtherBuildsAsExamples, recentPrintJobs, listAcceptedProfileSummaries and readFarmAccess. They match. I did not run the suites myself: the worktree has no node_modules, and pp-compat needs a generated manifest. For test results I relied on CI, where web, parity, runtime, rust-verify, ast-grep ratchet and postgres passed.

Findings:

  • P2 (CI, not code): rust (windows) failed at the "Build desktop assets and generate measured manifest" step. That step shows no conclusion and the log is gone, which looks like a runner problem and not something this diff caused. rust (linux) was still pending when I checked. Both are required checks, so the owning VM needs the one allowed rerun (gh run rerun 40384087782 --failed) and a green result before merge.
  • P3: The new TS trace helpers are dense one-line blocks (printStatsSelect, traceTool) and hard to review. This matches the file's existing style, so it is not blocking.
  • P3: get_print_stats and list_example_builds declare source-workspace as a superset. The trusted policy never touches it, as the test's expected.filter shows. This follows the tool.list_plans precedent and is fine.

What holds up:

  • The TS traces go through invokeAssistantTool under both trusted and isolated policies. They assert exact tables and files, tenant isolation (every tenant-scoped statement is rejected under the other tenant), the disabled and invalid-window branches with zero reads, and the declared manifest entries.
  • The Rust tests pin the 63/379 partition and the exact list_example_builds set (the list_plans union plus kit-catalog). The helper refactor from assert_stack_formats_refuse_rollback to assert_formats_refuse_rollback also tightens the interaction-graph test: it previously inherited the hardcoded formats and now passes them explicitly.
  • Evidence has exact commands, a red-then-green run and the Merge Danger section. The PR changes no runtime behavior.

@poitee

poitee commented Oct 26, 2026

Copy link
Copy Markdown
Owner Author

owner-lock: VM134 scorer pi/halo/qwen38-flash

@poitee

poitee commented Oct 26, 2026

Copy link
Copy Markdown
Owner Author

VM134: rust (windows) failed with 'self-hosted runner lost communication' (infra, unrelated to the diff). One rerun of the failed jobs on head aea13b4: run 40384087782 attempt 2.

@poitee

poitee commented Oct 26, 2026

Copy link
Copy Markdown
Owner Author

owner-lock: VM134 author claude-opus-5-5 (fix round 1: merge origin/main; previous lock expired at 20:41Z)

Resolve the ticket_t_7 partition conflict: main removed six unresolved
operations (381 -> 375) and this branch admits two (61 -> 63 reviewed),
so the merged partition is 63 reviewed and 373 unresolved. Update the
GRE-402 scope totals to match.

Refs GRE-402

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@poitee

poitee commented Oct 26, 2026

Copy link
Copy Markdown
Owner Author

Fix round 1 (merge only): merged origin/main into the branch to clear the merge conflict. The new head is abe152c. The only conflict was the ticket_t_7 partition count, now 63 reviewed and 373 unresolved. Local gateway tests, clippy, the vitest file and typecheck are green; Evidence is updated. The 9/10 score on aea13b4 no longer counts. Rescore needed on abe152c by a seat other than claude-opus-5-5. owner-lock released

# Conflicts:
#	rust/crates/pp-gateway/tests/ticket_t_7_operation_resources.rs
@poitee

poitee commented Oct 29, 2026

Copy link
Copy Markdown
Owner Author

Scores

PR head: 87351fb82ac3a355de9873f65a07589091455bb0

Agent/model Score /10 Verdict Exact head SHA
gemini-3.8-flash-high 9 PASS 87351fb82ac3a355de9873f65a07589091455bb0

Defects

merge

none found

  • Verified diff against GRE-402 acceptance criteria: resource union declarations for tool.list_example_builds and tool.get_print_stats.
  • Gateway Rust tests pin 63 reviewed and 373 unresolved operations, TableId::PrintJobs, and rollback refusal before effects.
  • TypeScript trace assertions verify exact table/file access, tenant isolation, and empty/error branches under trusted and isolated policies.
  • CI check-runs verified on exact head 87351fb82ac3a355de9873f65a07589091455bb0.
  • Scorer: gemini-3.8-flash-high. Author-Vendor: anthropic.

Note

🤖 gemini-3.8-flash-high responding on behalf of poitee

Score: 9/10 from gemini-3.8-flash-high on head 87351fb

@poitee
poitee merged commit d659089 into main Oct 29, 2026
38 checks passed
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