Operate the PWDEV Flow Audit Trail
Read audit, safety, and artifacts. Resolve flow_audit.py from this installed plugin and pass its absolute path to python3 with the active repository root.
Route
enable updates only .planning/flow/config.json after an explicit request and preserves unknown configuration fields.
summary reports counts by action, skill, and phase.
events returns the latest valid semantic events, optionally filtered by an allowed action.
verify checks every non-empty JSONL line and returns integrity errors without repairing them.
record appends one event only after the described semantic action actually occurred.
Use the helper rather than parsing or appending JSONL with ad hoc shell commands.
Procedure
- Confirm the repository root and inspect
.planning/flow/config.json without reading secrets.
- For
enable, require explicit intent, set audit to true, preserve unknown fields, and run verify. Do not create a synthetic historical trail.
- For queries, run the matching helper command and report invalid-trail failures before any counts.
- For
record, choose one allowed action from the audit contract, a canonical flow-* skill, and only the smallest non-sensitive structured detail needed. Record after the gate, write, decision, archive, migration, or phase outcome succeeds.
- Report helper exit status and whether a write occurred. Recording while disabled is a successful no-op, not an audit event.
Constraints
- Never include prompts, environment variables, file contents, secrets, credentials, tokens, or private-key paths.
- Do not promise complete runtime telemetry: this trail records semantic Flow events only and uses no hooks.
- Do not repair, truncate, reorder, or replace an invalid trail without a separate explicit instruction.
- Audit failure must be visible but does not retroactively invalidate the workflow event it attempted to record.
Output
Return MODE, AUDIT_ENABLED, command result, integrity status, event count when applicable, limitations, and NEXT.
1---2name: flow-audit3description: Operates the PWDEV Flow semantic audit trail: enable, record, query, summarize, or verify JSONL workflow events with integrity checks.4---56# Operate the PWDEV Flow Audit Trail78Read [audit](../../references/audit.md), [safety](../../references/safety.md), and [artifacts](../../references/artifacts.md). Resolve [flow_audit.py](../../scripts/flow_audit.py) from this installed plugin and pass its absolute path to `python3` with the active repository root.910## Route1112- `enable` updates only `.planning/flow/config.json` after an explicit request and preserves unknown configuration fields.13- `summary` reports counts by action, skill, and phase.14- `events` returns the latest valid semantic events, optionally filtered by an allowed action.15- `verify` checks every non-empty JSONL line and returns integrity errors without repairing them.16- `record` appends one event only after the described semantic action actually occurred.1718Use the helper rather than parsing or appending JSONL with ad hoc shell commands.1920## Procedure21221. Confirm the repository root and inspect `.planning/flow/config.json` without reading secrets.232. For `enable`, require explicit intent, set `audit` to `true`, preserve unknown fields, and run `verify`. Do not create a synthetic historical trail.243. For queries, run the matching helper command and report invalid-trail failures before any counts.254. For `record`, choose one allowed action from the audit contract, a canonical `flow-*` skill, and only the smallest non-sensitive structured detail needed. Record after the gate, write, decision, archive, migration, or phase outcome succeeds.265. Report helper exit status and whether a write occurred. Recording while disabled is a successful no-op, not an audit event.2728## Constraints2930- Never include prompts, environment variables, file contents, secrets, credentials, tokens, or private-key paths.31- Do not promise complete runtime telemetry: this trail records semantic Flow events only and uses no hooks.32- Do not repair, truncate, reorder, or replace an invalid trail without a separate explicit instruction.33- Audit failure must be visible but does not retroactively invalidate the workflow event it attempted to record.3435## Output3637Return `MODE`, `AUDIT_ENABLED`, command result, integrity status, event count when applicable, limitations, and `NEXT`.