15 Commits
Author SHA1 Message Date
teamwork-worker 45f76c42a1 test(export): assert package.json export script and aggregate test wiring (R2/R4)
Adds four hermetic checks to scripts/test-export.mjs that read package.json with
node:fs (no npm shell-out): scripts.export exists and is non-empty; it invokes
bin/opencode-teamwork.mjs with the export subcommand; the aggregate test script
includes test:export; and it still runs the five pre-existing suites in order
with test:export last. No existing check is modified.
2026-10-18 18:15:01 +03:00
sorcnr 13e34ed620 test(export): give -o - no-file check a pristine root; --session check uses a distinguishable second run 2026-10-18 18:09:39 +03:00
sorcnr 8ddb068ef6 test(export): separate checks for --output, -m/--markdown, --session aliases
Each CLI alias is a separate case label in bin/opencode-teamwork.mjs, so each
gets its own named check; removing any one alias now fails the suite.
2026-10-18 18:06:38 +03:00
teamwork-worker 963b81b389 test(export): hermetic suite for export engine and CLI (HTML/Markdown, XSS escaping, exit codes, -o/-o -) 2026-10-18 18:03:41 +03:00
sorcnr b92d558579 fix(sec-fix-attrib): null-prototype maps + TASK_ID allowlist (SEC-1), output sanitising (SEC-3), docs honesty (SEC-2/4/5) 2026-10-18 17:22:05 +03:00
sorcnr 8aa5375052 test: byTaskTokens sums across tree (kills absolute-write mutant); loud skip when no sqlite backend
- 6c: root with nonzero tokens + second child session on the same taskId;
  asserts the SUMMED bucket so last-writer-wins/absolute writes fail.
- seedSessionDb: probe node:sqlite / sqlite3 CLI once; if neither exists,
  print '⊘ skipped attribution DB tests: no node:sqlite and no sqlite3 CLI'
  and skip 6a-6d. Seeding errors with a backend present still propagate.
2026-10-18 17:12:05 +03:00
sorcnr 4570b615d7 test: prove attribution behaviour (actor identity, taskId buckets, byTaskTokens)
- test-engine: drive real tools against a seeded session DB: taskId bucketing
  (byTask[team/worker] must not grow), legacy agent bucket without taskId,
  byTaskTokens delta accumulation + shape, legacy costs.json tolerance,
  explicit actor (team/worker, team/verifier), plan-declared fallback,
  newline/U+2028 agent cannot inject a JSONL line.
- test-timeline: populated byTaskTokens surfaces exact numbers, absent and
  malformed buckets yield null (no throw, no NaN), frozen key sets literal.
2026-10-18 17:07:06 +03:00
teamwork 366b5dff68 test(timeline): cover inside-project symlink roots, hostile worktree ids, default-lookup leak 2026-10-18 13:28:33 +03:00
teamwork c523f20a4e fix(timeline,cli,tests): R6.5 echo sanitise, R6.7 oversize honesty, R6.7b --json C1, R6.6 guardrail tests 2026-10-18 13:26:52 +03:00
sorcnr 51b9c58136 test: hermetic timeline suite (events/derived/no-fabrication/corrupt/cost/render/CLI/TZ) wired into npm test 2026-10-18 03:58:35 +03:00
sorcnr 359f75d5b1 test(doctor): add hermetic doctor test suite (R4) 2026-10-18 02:58:07 +03:00
sorcnr b023ec9e89 chore: checkpoint in-progress model-map and engine test edits before teamwork run 2026-10-18 02:49:02 +03:00
sorcnr 6787cd734f feat: release v0.5.2 - session tree cost tracking, DAG engine, pre-merge security gate, dynamic pitfalls, conflict healing & CLI tools 2026-10-18 02:14:00 +03:00
sorcnr a444b27835 fix(security): close traversal/symlink, injection and unsafe-install gaps
Audited by clean-context subagents across three rounds; every finding fixed and
re-verified.

- F1 path traversal: sessionId allowlist + lexical & realpath containment;
  refuse a symlinked run root, symlinked run dir, and any symlinked run file
  (lstat-based, dangling-safe)
- F2 command injection: no shell interpolation of session ids — server-derived
  $SESSION_ID, quoted; lint scans agent files AND command templates (incl.
  backslash line-continuations)
- F3 read-only guardrail: per-agent deny list (real permission actions),
  fail-closed when the permission API is unavailable
- F4 stored prompt injection: sanitised run-state injection (phase allowlist,
  validated dir name, no raw newlines/paths)
- F5 installer is non-destructive by default (refresh opt-in via --refresh)
- F6 refuse symlinked/JSONC configs; string-aware comment/trailing-comma strip
- F8 create-only reference copy on plugin load
- add team/security-auditor agent + docs/GUARDRAILS.md + guardrail lint rules
2026-10-12 02:53:25 +03:00
sorcnr 70a01a3ae7 test: add prompt linter + CI
- scripts/lint-prompts.mjs: guards canonical artifact root, topology enum
  (parsed from docs/ARTIFACTS.md), no duplicated/self-referential blocks, no
  stale references, no 'effect: ask' in parallel agents, $ARGUMENTS usage
- .github/workflows/lint-prompts.yml runs it on agent/doc changes
- package.json: lint:prompts script
2026-10-12 02:11:11 +03:00