Commit d0162d6
committed
Harden agent: sandbox to workspace-write, ban shortcut patterns, add concrete examples
- Switch sandbox from danger-full-access to workspace-write with
approvalPolicy: never — agent can only access its workspace and
the explicitly listed additionalDirectories (TS source, existing
client). It can no longer browse river-python or other repos.
- Prompt overhaul:
- Quality bar framing: output will be discarded if not clean/readable
- BANNED patterns section: RootModel, make_schema_model,
__get_pydantic_json_schema__, SchemaAdapter, create_model, raw
JSON Schema dicts — all explicitly rejected
- 6 concrete TypeBox-to-Pydantic translation examples covering
Type.Object, $kind unions, error unions, Optional/Record/Array,
recursive types, and Type.Intersect flattening
- Directory scope section: only access workspace + TS source
- Stronger anti-shortcut language throughout
- Verification script improvements:
- Code quality pre-check: scans all .py files for banned patterns
before comparing schemas, fails with exit code 2 if found
- New normalizations: Uint8Array->string, strip type alongside
const, enum->anyOf+const, strip null variant from 2-element
anyOf (handles TypeBox Optional vs Pydantic Optional mismatch),
strip discriminator and additionalProperties metadata1 parent b76e151 commit d0162d6
3 files changed
+657
-182
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
| 57 | + | |
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
| |||
0 commit comments