Commit Graph
4 Commits
Author SHA1 Message Date
Willie 19d88ce905 chore: update schema and red team scripts for centralized metadata
- registry.schema.json: describe .metadata.json store format (version,
  entries map with full field set) instead of old registry.yaml format
- Red team scripts: add write_store_meta helper, replace sidecar writes
  with centralized store writes in phase3 (integrity) and phase5 (advanced)
2026-04-08 17:43:39 +08:00
Willie 23206306d8 fix(audit): prevent stdout pollution in structured output formats
Two issues caused red team test failures after --format flag introduction:

1. ss_capture helper merged stderr into stdout (2>&1), so the --json
   deprecation warning poisoned JSON parsing by jq. Fix: capture stderr
   to a temp file separately from stdout.

2. Two unguarded fmt.Println() calls in auditInstalled() printed blank
   lines to stdout even in JSON/SARIF/markdown mode. Fix: wrap in
   if !jsonOutput guard.

Also migrate all 39 --json invocations in red team tests to --format json
since --json is deprecated.
2026-03-02 23:01:30 +08:00
Willie f8205a27a8 refactor(install): prefer sparse checkout over GitHub API for subdir install
Swap fast path order: sparse checkout is now fast path 1 (works for all
hosts including file://), GitHub Contents API is fast path 2 (fallback
when sparse is unavailable or fails). Also reset subdirPath on sparse
failure to ensure proper fallback chain.

Fix red team helpers to inject -g flag after subcommand, preventing
.skillshare/ auto-detection from hijacking global-mode tests.

Add blocked section assertions to TestUpdate_BatchAll_FailsOnMalicious.
2026-02-25 07:02:54 +08:00
Willie 5c44acd7d1 test: add red team E2E script for supply-chain security validation
Repeatable bash-based test exercising all audit patterns (CRITICAL→INFO),
update gate rollback, content hash integrity, and batch blast radius.

- scripts/red_team_test.sh: main entry (setup + 4 phases + summary)
- scripts/red_team/: split phases + shared helpers
- Makefile/mise.toml: add `test-redteam` target
- docker/sandbox/Dockerfile: add jq for JSON assertions
2026-02-23 04:18:01 +08:00