78 Commits
Author SHA1 Message Date
sorcnr 94fad0a0ba release: 0.5.6 — standalone offline HTML/Markdown export & table layout fix 2026-10-18 19:45:55 +03:00
sorcnr 8986c31fcc Merge Teamwork run 20261018-175024-6b31 (export command: offline HTML + Markdown run reporting) 2026-10-18 18:26:37 +03:00
sorcnr 517ce6907f Merge task final-acceptance (teamwork/20261018-175024-6b31-final-acceptance) 2026-10-18 18:17:42 +03:00
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 c89b2ce781 Merge task export-tests (teamwork/20261018-175024-6b31-export-tests) 2026-10-18 18:11:58 +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
sorcnr 860ee9292f Merge task export-docs (teamwork/20261018-175024-6b31-export-docs) 2026-10-18 18:05:45 +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 e7a00de074 docs: state all three inputs of the export overall-status rule 2026-10-18 18:02:47 +03:00
sorcnr b1f08a289f Merge task export-cli (teamwork/20261018-175024-6b31-export-cli) 2026-10-18 18:02:17 +03:00
sorcnr 8baa34c888 feat(cli): export command (HTML/Markdown run report) with id/output guards 2026-10-18 17:57:36 +03:00
teamwork-worker ae317ae926 docs: document export command and export report artifact (R5) 2026-10-18 17:57:10 +03:00
sorcnr 5904694585 Merge task export-core (teamwork/20261018-175024-6b31-export-core) 2026-10-18 17:56:15 +03:00
sorcnr b5627194fe feat(export): core run-report engine with escaping and path guards
Add lib/export.mjs: buildExportData(projectRoot, sessionId) reads a Teamwork
run directory into a structured object (never throws; invalid or missing runs
return an error string), and renderExport(data, {format}) renders one
self-contained offline HTML document (default) or GitHub-flavoured Markdown.

- sessionId allowlist; task ids validated as single path segments
- symlink refusal on run root, verify/ and every read (lstat + O_NOFOLLOW)
- bounded reads; events.jsonl drives per-task and run timing
- every dynamic string HTML-escaped; absolute URLs defanged in HTML output
- zero dependencies (node: builtins only)
2026-10-18 17:54:21 +03:00
sorcnr 9eeaed4e63 release: 0.5.5 — timeline CLI command, events log, per-task attribution & security hardening 2026-10-18 17:44:11 +03:00
sorcnr 3e55d5b5ae Merge Teamwork run 20261018-135620-8b41 (per-task attribution: actor identity, token/cost breakdown, security remediation) 2026-10-18 17:28:14 +03:00
sorcnr 8fd1b6a2b8 Merge task sec-fix-attrib (teamwork/20261018-135620-8b41-sec-fix-attrib) 2026-10-18 17:24:54 +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 cd8ae84bb7 Merge task attrib-tests (teamwork/20261018-135620-8b41-attrib-tests) 2026-10-18 17:14:21 +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
sorcnr 2a118f7d5a Merge task attrib-docs (teamwork/20261018-135620-8b41-attrib-docs) 2026-10-18 17:03:51 +03:00
sorcnr f9e31b2e7d Merge task attrib-timeline (teamwork/20261018-135620-8b41-attrib-timeline) 2026-10-18 17:03:51 +03:00
sorcnr c6107fe063 Merge task attrib-engine (teamwork/20261018-135620-8b41-attrib-engine) 2026-10-18 17:03:51 +03:00
teamwork-worker d6c5088078 feat(engine): record actual actor in events.jsonl; attribute spend to taskId; bucket byTaskTokens
- teamwork_task_update accepts optional agent; recorded agent resolves explicit ->
  calling session agent (ctx.session.get, then snapshots bySession) -> plan agent.
  Derivation is fail-open with a 2s bound; every value passes clean(value, 64).
- teamwork_cost: non-root spend buckets to input.taskId when given; without it the
  agent-name bucketing is unchanged.
- costs.json gains additive byTaskTokens (per-bucket token deltas) in the same
  locked section and the tree / single-session paths; manual addUsd adds no tokens.
- byTaskTokens initialised on new costs.json and tolerated when absent.
2026-10-18 13:59:42 +03:00
sorcnr 1f1280c5f8 docs: per-task attribution workflow and events.jsonl/byTaskTokens schema
- sentinel + /teamwork template: teamwork_cost({ taskId }) at each worker
  return and verifier report; agent team/worker | team/verifier on task_update
- ARTIFACTS.md: document events.jsonl (11 fields, 3 kinds, JSONL, fail-open),
  costs.json byTaskTokens, non-root bucketing rule, timeline per-task tokens
2026-10-18 13:58:23 +03:00
sorcnr 6a089723d8 feat(timeline): surface per-task tokens from costs.byTaskTokens (R3) 2026-10-18 13:57:44 +03:00
sorcnr 1dae005218 fix(.gitignore): add .vscode/ to ignore list 2026-10-18 13:52:40 +03:00
sorcnr cbfa82f29b Merge Teamwork run 20261018-034929-5de2 (timeline command + security remediation) 2026-10-18 13:40:44 +03:00
sorcnr 1736f27a33 Merge task sec-fix-guards (teamwork/20261018-034929-5de2-sec-fix-guards) 2026-10-18 13:36:27 +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 f89b9f78c9 Merge task sec-fix-timeline (teamwork/20261018-034929-5de2-sec-fix-timeline) 2026-10-18 13:20:44 +03:00
sorcnr 30b193eaf7 Merge task sec-fix-engine (teamwork/20261018-034929-5de2-sec-fix-engine) 2026-10-18 13:20:44 +03:00
teamwork-worker d26664d76b fix(timeline): R6.2-6.4 — validate task ids, strip control chars, bound events read
- SEC-2: task ids must match a single safe segment; report path must stay
  inside the run dir; invalid ids are reported in the task note, never read.
- SEC-3: renderTimeline strips C0/C1 control chars from every data-derived
  string before rendering (applies with and without colour).
- SEC-4: file reads are capped at 8 MiB (fstat + bounded read); an oversized
  events.jsonl is treated as unreadable (derived mode) instead of loaded.
Output shape, derived-mode semantics and the read-only invariant are unchanged.
2026-10-18 13:17:31 +03:00
sorcnr d8708521d7 fix(security): SEC-1 validate task ids as single path segment; assert containment before mkdir/rmSync/worktree add
- isSafeTaskId: ^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$, rejects . and ..
- validated at worktree entry point (all actions) before any path/branch is built
- containmentError: relative(runWorktreesDir, targetDir) must be non-empty, non-absolute, not '..'
- containment asserted before mkdirSync/rmSync/worktree add for sentinel and worker/verifier setup;
  rmSync re-proves containment immediately before deletion
2026-10-18 13:17:04 +03:00
sorcnr b671bb0e94 Merge task timeline-tests (teamwork/20261018-034929-5de2-timeline-tests) 2026-10-18 04:00:32 +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 63ae49ddfd Merge task timeline-cli (teamwork/20261018-034929-5de2-timeline-cli) 2026-10-18 03:55:40 +03:00
sorcnr 703243aca2 cli: add timeline command (positional/--session id, --json, --no-color, TTY-gated colour) 2026-10-18 03:54:11 +03:00
sorcnr 0a3e1748fe Merge task timeline-lib (teamwork/20261018-034929-5de2-timeline-lib) 2026-10-18 03:53:27 +03:00
sorcnr b4c3201aea Merge task timeline-events (teamwork/20261018-034929-5de2-timeline-events) 2026-10-18 03:53:27 +03:00
sorcnr 4c9249061e lib/timeline: read-only lifecycle timeline (events mode + honest derived fallback) and renderer 2026-10-18 03:51:28 +03:00
sorcnr 34d166551b feat(engine): append-only events.jsonl lifecycle log (R1)
Add appendEvent() helper: appendFileSync to <run>/events.jsonl inside
withFileLock(eventsFile), after resolveRun, with refuseSymlink first.
All string fields pass clean(); wrapped in try/catch (fail-open).

Write sites:
- teamwork_plan -> run_created (to: pending, phase: DAG_BUILD)
- teamwork_task_update -> task_transition (from = prior status, to =
  resolved status after pass/fail/running normalisation and maxRounds
  coercion; agent/branch/worktree/phase included)
- teamwork_security_audit -> security_audit (to = PASS/FAIL)

No tool signature, return value, or state.json/costs.json change.
2026-10-18 03:50:55 +03:00
sorcnr cc96827b6e release: 0.5.4 — set mode: all on subagents for OpenCode UI visibility 2026-10-18 03:31:38 +03:00
sorcnr 01607b7ef9 release: 0.5.3 — doctor command, model map sync & subagent dispatch visibility 2026-10-18 03:24:36 +03:00
sorcnr 3e34106642 chore(.gitignore): add .opencode/ to ignore list for teamwork backup files 2026-10-18 03:15:50 +03:00
sorcnr 5672d7fd1d feat(doctor): add zero-dependency diagnostic engine + CLI doctor command
Merges Teamwork run 20261018-024914-8e35 (distributed-coding).

- lib/doctor.mjs: runDoctor() returning 7 fixed checks (config_file,
  plugin_registration, agents_installed, model_sync, git_installed,
  git_repository, worktrees_dir); execFileSync fixed-argv git probes;
  path containment via relative() + realpathSync.
- bin/opencode-teamwork.mjs: doctor command with [✓]/[!]/[✗] output,
  --json flag, exit 0/1 from report.ok.
- scripts/test-doctor.mjs + package.json: hermetic 6-scenario suite,
  mutation-tested, wired into npm test.

All 3 tasks passed adversarial verification; pre-merge security audit
PASSED (0 Critical/High, 3 Low).
2026-10-18 03:03:31 +03:00
sorcnr b76bc4632f Merge task doctor-tests (teamwork/20261018-024914-8e35-doctor-tests) 2026-10-18 03:00:20 +03:00