Add write_envelope tool with verify_envelope for explicit envelope creation
- New crates/g3-core/src/tools/envelope.rs with execute_write_envelope()
and verify_envelope() (moved from shadow_datalog_verify in plan.rs)
- write_envelope accepts YAML facts, writes envelope.yaml to session dir,
then runs datalog verification against analysis/rulespec.yaml in shadow mode
- plan_verify() now only checks envelope existence (no longer runs datalog)
- Tool count: 13 -> 14
- Updated system prompt to instruct agents to call write_envelope before
marking last plan item done
- Updated integration tests to use write_envelope tool directly
Workflow: write_envelope -> verify_envelope -> datalog shadow artifacts
plan_write(done) -> plan_verify -> checks envelope exists
This commit is contained in:
@@ -78,7 +78,7 @@ When marking done, add `evidence` and `notes` to the item.
|
||||
|
||||
## Action Envelope
|
||||
|
||||
Before marking the last plan item done, write an `envelope.yaml` file with facts about completed work. The envelope captures what was actually built so it can be verified against invariants in `analysis/rulespec.yaml` if present.
|
||||
Before marking the last plan item done, call `write_envelope` with facts about completed work. The envelope captures what was actually built so it can be verified against invariants in `analysis/rulespec.yaml` if present. The tool writes the envelope and runs datalog verification automatically.
|
||||
|
||||
```yaml
|
||||
facts:
|
||||
@@ -96,7 +96,7 @@ facts:
|
||||
- Selectors in `analysis/rulespec.yaml` (e.g., `csv_importer.capabilities`) are evaluated against envelope facts
|
||||
- Use dot notation for nested access: `api_changes.breaking`
|
||||
- Use `null` to explicitly assert absence (for `not_exists` predicates)
|
||||
- The envelope is automatically verified against `analysis/rulespec.yaml` when the plan completes (if the file exists)
|
||||
- `write_envelope` verifies facts against `analysis/rulespec.yaml` (if present) and `plan_verify()` confirms the envelope was written
|
||||
|
||||
# Workspace Memory
|
||||
|
||||
|
||||
Reference in New Issue
Block a user