feat: plan 16-01

This commit is contained in:
thanhnv
2026-07-06 21:47:38 +09:00
parent 4419cd9eae
commit 8c3c5e8bff
30 changed files with 1646 additions and 66 deletions
@@ -223,11 +223,16 @@ bash "$SCRIPTS/sign-audit-head.sh" "$PROJECT_ROOT/.specify/logs/audit/audit.json
"$SCRIPTS/verify-tool-audit.sh" "$PROJECT_ROOT/.specify/logs/audit/tool-calls.jsonl" > "$LEVEL5_DIR/11c-tool-audit-verify.stdout"
assert_contains "$LEVEL5_DIR/11c-tool-audit-verify.stdout" "TOOL_AUDIT_VALID"
# L5: rollback transaction record and execute
# L5: rollback transaction — checkpoint a file and execute a genuine restore.
# SEC-03 (H-03): `execute` runs only whitelisted STRUCTURED ops (no `bash -c`), so
# rollback is exercised via `checkpoint` (the safe path) rather than a free-form
# recorded shell command. The marker starts at the state we expect restored.
ROLLBACK_MARKER="$LEVEL5_DIR/13-rollback-marker.txt"
ROLLBACK_RECORD="$("$SCRIPTS/rollback-manager.sh" record deploy "printf rolled_back > '$ROLLBACK_MARKER'")"
printf 'rolled_back' > "$ROLLBACK_MARKER"
ROLLBACK_RECORD="$("$SCRIPTS/rollback-manager.sh" checkpoint "$ROLLBACK_MARKER")"
printf '%s\n' "$ROLLBACK_RECORD" > "$LEVEL5_DIR/13-rollback-record.stdout"
TX_ID="$(printf '%s\n' "$ROLLBACK_RECORD" | sed -n 's/.*transaction_id=//p')"
TX_ID="$(printf '%s\n' "$ROLLBACK_RECORD" | sed -n 's/.*transaction_id=\([^ ]*\).*/\1/p')"
printf 'MODIFIED_AFTER_CHECKPOINT' > "$ROLLBACK_MARKER"
"$SCRIPTS/rollback-manager.sh" execute "$TX_ID" > "$LEVEL5_DIR/13-rollback-execute.stdout"
assert_contains "$ROLLBACK_MARKER" "rolled_back"