Commit Graph
4 Commits
Author SHA1 Message Date
Willie ebab63a670 feat(runbook): add build lifecycle hook, verify all 17 runbooks
Add a build hook that runs once before all runbooks, enabling
automatic binary rebuild. Lifecycle is now:
  build (once) → [per runbook: setup → steps → teardown]

Build hook uses os/exec directly (not session executor), outputs
to stderr, and aborts immediately on failure.

Fix all 17 runbooks to pass in devcontainer:
- Adapt to session executor's set -eo pipefail (use cmd || EXIT=$?
  pattern for expected non-zero exits)
- Replace embedded ```bash in heredocs with printf to avoid
  confusing the runbook parser
- Fix negated assertion gotchas (Not FAIL, No such file)
- Remove fragile verify code blocks (multi-block merge issues)
- Fix step number collision (7b → 8, renumber subsequent)
- Use -s flag for batch installs instead of repeated --force
- Add (?m) flag for multi-line regex assertions
2026-03-11 04:53:08 +08:00
Willie ba4f7c9c4d docs(runbook): migrate all 16 runbooks to typed assertion syntax
Convert Expected blocks from natural language descriptions to
matchable assertions: exit_code: N, regex: <pattern>, jq: <expr>,
Not <text>, and plain substring matches. All runbooks now parse
correctly with the assertion engine.
2026-03-11 04:53:08 +08:00
Willie 1676d7d064 fix(audit): suppress pterm cursor codes leaking into structured stdout
pterm's cursor package writes hide/show ANSI codes (\x1b[?25l/h)
directly to os.Stdout, bypassing WithWriter(). The previous fix
(SetProgressWriter to stderr) was insufficient because pterm still
created progress bar objects that triggered cursor.Hide()/Show().

Add SuppressProgressToStderr() which both redirects ProgressWriter
and forces isProgressTTY() to return false, preventing pterm
components from being instantiated at all. Extract assertNoANSI
test helper and cover all three structured formats (JSON, SARIF,
Markdown).

Also update pre-commit E2E runbook with steps 10-11 (framework
integration tests) and add pre-commit-hook recipe to sidebar.
2026-03-03 16:08:11 +08:00
Willie ac20153948 docs: add pre-commit E2E runbook and update cli-e2e-test skill
- Add ai_docs/tests/precommit_audit_hook_runbook.md (9-step E2E test
  for skillshare audit -p as pre-commit hook)
- Fix cli-e2e-test SKILL.md: clarify init -p has separate flag set from
  global init; add audit rule ID vs pattern name guidance; add project
  mode init example to container templates; add two new checklist items
- Update CHANGELOG.md with pre-commit hook, audit TUI filter, O(N)
  cross-skill rewrite, and SARIF line-0 fix entries
2026-03-02 23:01:30 +08:00