Software factory change - #448
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Review swarm: maintainabilityNo fresh transcript was produced for run |
Review swarm: historyNo fresh transcript was produced for run |
Review swarm: structureNo fresh transcript was produced for run |
Review swarm: FAILED
Cloud run: |
`summary.md` landed on main via #448. It is the run's own PR-description draft -- its first line is "# PR: Expose per-agent permissions in TypeScript flows" -- not a deliverable, and nothing in the tree references it (0 references, verified against a positive control). The software factory run that produced #448 committed its working notes alongside the change. Worth tracking separately as a run-output hygiene issue; this commit just removes the artifact. Co-authored-by: kjgbot <kjgbot@users.noreply.github.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
PR: Expose per-agent permissions in TypeScript flows
f.agent(name, options)now acceptspermissionswithfileGlobs,networkAllowlist, andaccessPreset, matching the declarative SDK contract.The surface exports
PermissionsSpec; SDK type assertions pin parity. Loweringreads the new option once, snapshots it as JSON data, and passes it through the
existing validator and compiler without supplying defaults.
Workspace suffix refusals now point to the new option and explicitly state that
these declarations are not currently enforced. Surface documentation includes
the writer/reviewer example and corrects the chief example's misleading scope
comment. Enforcement remains gate 8 / #442; flow-wide scope compilation is
unchanged.
Regression coverage includes surface type errors, exact submitted kernel fields,
absent/partial declarations, local-stream calls without workspace, malformed
runtime declarations, closed-key suggestions, and nested accessor refusal.
Loopback captures demonstrate submission, not kernel persistence or enforcement.
Verification below passed with CI's Bun 1.4.0 after the environment's older Bun
versions failed to read the lockfile. This is targeted verification, not a full
SDK suite or mutation verification. No gates, manifests, lockfiles, release
versions, kernel code, or enforcement paths changed. Release via the existing
surface-before-SDK process; a local packed install does not establish registry
availability.
Pre-existing documentation debt: SDK
PermissionsSpecJSDoc says “readonlyprovably cannot write.” It is unchanged because correcting it also affects
generated schema descriptions and belongs in an explicit documentation/schema
change.
plan.mdandreviewed-plan.mdwere existing untracked inputs and areleft uncommitted.
Captured verification
All commands ran from the repository root unless their command explicitly
changes directory. The status capture precedes creation of this report.
Command:
Captured output:
Exit status: 1.
Command:
npm exec --yes --package=bun@1.3.9 -- bash scripts/surface-package-gate.shCaptured output:
Exit status: 1.
Command:
npm exec --yes --package=bun@1.4.0 -- bash scripts/surface-package-gate.shCaptured output:
Exit status: 0.
Command:
Captured output:
Exit status: 0.
Command:
Captured output:
Exit status: 0.
Command:
(cd packages/sdk && ./node_modules/.bin/vitest run tests/authored-agent-permissions.test.ts tests/authored-flow.test.ts tests/validate.test.ts tests/verb-field-lint.test.ts tests/deterministic-llm.test.ts)Captured output:
Exit status: 0.
Command:
(cd packages/sdk && ./node_modules/.bin/vitest run tests/authored-agent-permissions.test.ts)Captured output:
Exit status: 0.
Command:
Captured output:
Exit status: 0.
Command:
Captured output:
Exit status: 0.
Note
Low Risk
Authoring-surface and SDK lowering only; permissions are validated and recorded but not enforced, and kernel enforcement paths are unchanged.
Overview
Adds an optional
permissionsdeclaration onf.agentin TypeScript flows, aligned with the declarative spec:fileGlobs,networkAllowlist, andaccessPreset(readonly|readwrite).@relayflows/surfaceexportsPermissionsSpecand types onAgentOptions; the authored executor snapshots the object once, validates it via the existing JSON snapshot/compile path, and lowers camelCase fields to kernelfile_globs/network_allowlist/access_preseton the agent step—without defaults and without enforcement (still gate 8 / #442).Workspace strings with
: readonly/: readwritesuffixes remain rejected; errors now direct authors to bare workspace names pluspermissions.docs/SURFACE.mddocuments the API and updates the chief example away from misleading workspace suffixes.New regression tests cover type parity, loopback-submitted step shapes, invalid declarations, and stricter whitespace variants on workspace suffix refusal.
Reviewed by Cursor Bugbot for commit d27973e. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by cubic
Exposes per-agent permissions in TypeScript flows via a new
permissionsoption onf.agent, matching the declarative SDK contract. The declarations are validated and recorded but not enforced yet (gate 8 / #442).New Features
f.agentnow acceptspermissionswithfileGlobs,networkAllowlist, andaccessPreset.PermissionsSpecfrom the surface package.SURFACE.mdwith writer/reviewer examples and corrects the chief example's misleading scope comment.Bug Fixes
permissionsoption and state that declarations are not enforced.Written for commit d27973e. Summary will update on new commits.
Fixes #445