Commit Graph

576 Commits

Author SHA1 Message Date
Fusion
aef0dd46ec feat(FN-4219): complete Steps 5-7 — docs, changeset, and verification fixes
Fusion-Task-Id: FN-4219
Fusion-Task-Lineage: 8d9a9ba6-6729-4376-b935-549e28a7fa35
2026-05-14 00:58:44 -07:00
Fusion
24bf18a233 feat(FN-4219): complete Step 4 — add experiment executor runtime
Fusion-Task-Id: FN-4219
Fusion-Task-Lineage: 8d9a9ba6-6729-4376-b935-549e28a7fa35
2026-05-14 00:58:44 -07:00
Fusion
a73cfc710b feat(FN-4219): complete Step 3 — add git policy and ops
Fusion-Task-Id: FN-4219
Fusion-Task-Lineage: 8d9a9ba6-6729-4376-b935-549e28a7fa35
2026-05-14 00:58:44 -07:00
Fusion
13789d6c88 feat(FN-4219): complete Step 2 — add benchmark runner
Fusion-Task-Id: FN-4219
Fusion-Task-Lineage: 8d9a9ba6-6729-4376-b935-549e28a7fa35
2026-05-14 00:58:44 -07:00
Fusion
629451ba7d feat(FN-4219): complete Step 1 — add METRIC parser
Fusion-Task-Id: FN-4219
Fusion-Task-Lineage: 8d9a9ba6-6729-4376-b935-549e28a7fa35
2026-05-14 00:58:44 -07:00
Fusion
ce21271e59 test(FN-4432): complete Step 3 — cover post-merge audit failure emission
Fusion-Task-Id: FN-4432
Fusion-Task-Lineage: ac5d5aa4-1c6e-4cd1-a779-c58f62ee0357
2026-05-13 23:59:19 -07:00
Fusion
b34fa13e3c test(FN-4393): add heartbeat memory mode integration coverage
Fusion-Task-Id: FN-4393
Fusion-Task-Lineage: 3615215d-9caa-4402-9258-a5a5de137dd6
2026-05-13 23:41:35 -07:00
Fusion
2e7f76b7a1 feat(FN-4393): complete Step 3 — branch memory inclusion by mode
Fusion-Task-Id: FN-4393
Fusion-Task-Lineage: 3615215d-9caa-4402-9258-a5a5de137dd6
2026-05-13 23:41:35 -07:00
Fusion
86381e4ad5 feat(FN-4393): complete Step 2 — add memory index builder
Fusion-Task-Id: FN-4393
Fusion-Task-Lineage: 3615215d-9caa-4402-9258-a5a5de137dd6
2026-05-13 23:41:35 -07:00
Fusion
0c8e233d40 test(FN-4434): complete Step 3 — cover recovery audit emission
Fusion-Task-Id: FN-4434
Fusion-Task-Lineage: 547a5663-114c-49c8-bd0c-dddfb280c4ef
2026-05-13 22:52:53 -07:00
Fusion
60c0a38ed3 test(FN-4313): complete Step 2 — add project engine id accessor
Fusion-Task-Id: FN-4313
Fusion-Task-Lineage: 36b8aad3-20f4-475b-9b0f-63e5458d1b91
2026-05-13 22:46:17 -07:00
Fusion
8539a3dec0 feat(FN-4388): complete remaining observability surfaces
Fusion-Task-Id: FN-4388
Fusion-Task-Lineage: 7497a0a1-5edb-4778-b339-118d1fd668f7
2026-05-13 22:41:29 -07:00
Fusion
48f18511d8 feat(FN-4388): complete Step 1 — engine cache metrics logs
Fusion-Task-Id: FN-4388
Fusion-Task-Lineage: 7497a0a1-5edb-4778-b339-118d1fd668f7
2026-05-13 22:41:29 -07:00
Fusion
c7f8d38210 test(FN-4361): add reliability interaction backstop suite
Fusion-Task-Id: FN-4361
Fusion-Task-Lineage: bdf2de3b-c9ce-4a29-9e60-9a029f913ae9
2026-05-13 22:08:41 -07:00
Fusion
7490c3bd0c fix(FN-4389): complete missing token usage parity and dashboard split
Fusion-Task-Id: FN-4389
Fusion-Task-Lineage: 366f9d57-c476-448f-96c0-6e753fc8b090
2026-05-13 22:03:38 -07:00
Fusion
4e6440a126 feat(FN-4389): complete Step 8 — run verification and fix regressions
Fusion-Task-Id: FN-4389
Fusion-Task-Lineage: 366f9d57-c476-448f-96c0-6e753fc8b090
2026-05-13 22:03:38 -07:00
Fusion
0d4ea23871 test(FN-4344): complete Step 2 — add HEAD-drift audit cache lookup tests
Fusion-Task-Id: FN-4344
Fusion-Task-Lineage: 5c3fc80e-619d-4daf-a224-580cea402b4c
2026-05-13 21:59:15 -07:00
Fusion
f4590ef90d feat(FN-4221): complete Step 3 — wire research dispatcher into engine
Fusion-Task-Id: FN-4221
Fusion-Task-Lineage: d710caa1-18b8-40d9-a70a-c5a4568484e3
2026-05-13 21:52:40 -07:00
Fusion
fa81832dd2 test(FN-4424): complete Step 5 — cover empty cherry-pick real-git cases
Fusion-Task-Id: FN-4424
Fusion-Task-Lineage: 0a3120bf-9f09-45de-bda7-a59c5842b2d9
2026-05-13 20:56:33 -07:00
Fusion
8ff216c822 feat(FN-4424): complete Step 2 — add empty cherry-pick detection
Fusion-Task-Id: FN-4424
Fusion-Task-Lineage: 0a3120bf-9f09-45de-bda7-a59c5842b2d9
2026-05-13 20:56:33 -07:00
Fusion
e246076a76 fix(FN-4343): isolate workflow-step scope checks to post-step delta
Fusion-Task-Id: FN-4343
Fusion-Task-Lineage: b880b71a-9250-4d9e-bdac-8298a73058f7
2026-05-13 20:03:31 -07:00
Fusion
a3b505e2cb feat(FN-4343): complete Step 3 — enforce workflow step scope invariants
Fusion-Task-Id: FN-4343
Fusion-Task-Lineage: b880b71a-9250-4d9e-bdac-8298a73058f7
2026-05-13 20:03:31 -07:00
Fusion
540c5e16d8 feat(FN-4343): complete Step 2 — dual-signal frontend ux auto-skip
Fusion-Task-Id: FN-4343
Fusion-Task-Lineage: b880b71a-9250-4d9e-bdac-8298a73058f7
2026-05-13 20:03:31 -07:00
Fusion
578b71e8df feat(FN-4315): add audit recovery pipeline documentation and changeset
Completes FN-4315 by adding a patch changeset for `@runfusion/fusion` and updating project documentation (AGENTS.md and settings reference) to cover the audit recovery pipeline feature.

Fusion-Task-Id: FN-4315

Fusion-Task-Lineage: 2646fd86-e525-4b62-a041-616fa7789e84
2026-05-13 20:03:02 -07:00
gsxdsm
b78b6ae70e fix(FN-4417): prefer local main over origin/main in contamination base
Follow-up to a2b494ddc. The previous fix correctly stopped using
task.baseCommitSha for the contamination check, but the new
resolveContaminationBaseRef tried origin/main first and fell back to
local main only if the origin/main lookup failed. On dev machines that
have not pushed recently, origin/main is a tracking ref that can lag
local main by hundreds of commits. `git merge-base HEAD origin/main`
then resolves successfully and returns the last common ancestor between
the (force-reset-to-local-main) branch and the stale origin/main ref,
which is exactly the same stale SHA the prior bug surfaced. Every
commit on local main since that point is then flagged as foreign
contamination.

Observed: after restarting the engine with a2b494ddc, FN-4315/FN-4403
still failed with `since base e787036b80cc...`. Local main was 166
commits ahead of origin/main; e787036 was the last shared commit.

Fix: reorder the shell fallback to prefer `main` over `origin/main`.
Local main is the canonical integration target for Fusion's merger,
and origin/main is only useful as a fallback when local main does not
exist (rare in a worktree).

Test updated: `resolveContaminationBaseRef returns the current
merge-base...` now asserts local `main` appears before `origin/main` in
the issued command so the shell `||` resolves to local main first.

Fusion-Task-Id: FN-4417
2026-05-13 19:07:31 -07:00
gsxdsm
a2b494ddc0 fix(FN-4417): stop false-positive branch contamination from stale baseCommitSha
The contamination check at executor.ts was reusing task.baseCommitSha as
its reference SHA. That field is intentionally preserved across resumed
sessions for stable diff math, which means it can lag behind main by
many commits. Passing it to assertCleanBranchAtBase caused every
legitimately-merged commit on main since the stale SHA to be reported
as a foreign task-attributed contamination commit, pausing the task
with pausedReason=branch-cross-contamination.

FN-4403 was the trigger case: a pooled worktree was force-reset to
current main by WorktreePool.prepareForTask (correctly), then the
executor immediately ran assertCleanBranchAtBase(rootDir, branch,
staleBaseCommitSha, taskId) and flagged 157 commits across ~39
unrelated FN-* tasks as contamination. FN-4417 itself then hit the
same bug when it tried to start, blocking the board.

Two fixes, both in packages/engine/src/executor.ts:

1. New resolveContaminationBaseRef(worktreePath) computes a fresh
   merge-base against origin/main or main and is used in place of
   resolveDiffBaseRef for the contamination check. It never reads
   task.baseCommitSha and never falls back to HEAD~1 (which on a
   force-reset pooled branch would be a main commit and re-introduce
   the same false positive at smaller scale). Returns undefined on
   git failure so the caller treats it as check skipped.

2. captureBaseCommitSha gains an explicit { isResume: boolean }
   parameter and only preserves an existing baseCommitSha when
   isResume is true. On fresh/pool acquisitions the branch was just
   force-reset to current main, so the stored value is stale by
   definition. Always recapture in that case. Diff-base stability
   across resumed sessions (FN-4309/FN-4383) is preserved by passing
   isResume: true on resume; the existing executor call site is
   already gated on non-resume and passes false.

Tests:
- executor-base-commit-capture.test.ts: updated to thread isResume
  through assertions and added a FN-4417 regression case that verifies
  a stale-but-ancestor baseCommitSha is recaptured (not preserved) on
  non-resume.
- executor-base-commit-capture.real-git.test.ts: FN-4309/FN-4383
  multi-session test now explicitly passes isResume: true on the
  second capture, matching the real resume code path.
- executor-contamination-base.test.ts (new): three focused tests for
  resolveContaminationBaseRef covering fresh-merge-base resolution,
  graceful failure when neither origin/main nor main resolves, and a
  structural guard that the function arity is 1 (no baseCommitSha
  parameter, so the bug cannot regress through that surface).

Verified: 4265 engine tests pass; tsc clean.

Fusion-Task-Id: FN-4417
2026-05-13 18:44:41 -07:00
Fusion
d39430b344 feat(FN-4409): add branch contamination assertions in worktree flows
Fusion-Task-Id: FN-4409
Fusion-Task-Lineage: c608c942-fec7-4489-9970-b8dc314f8be2
2026-05-13 17:44:46 -07:00
Fusion
e1c2cd564e test(FN-4397): align worktree conflict tests with stale-resolved + tripwire assertions
Fusion-Task-Id: FN-4397
Fusion-Task-Lineage: 1ffac4f7-adf5-4115-b588-108d75eadde7
2026-05-13 16:58:35 -07:00
Fusion
ac2f779e1e fix(FN-4397): add branch-conflict tripwire and tighten stale detection
Fusion-Task-Id: FN-4397
Fusion-Task-Lineage: 1ffac4f7-adf5-4115-b588-108d75eadde7
2026-05-13 16:58:35 -07:00
Fusion
de7de9526a test(FN-4397): add loop reproduction for repeated branch-conflict emissions
Fusion-Task-Id: FN-4397
Fusion-Task-Lineage: 1ffac4f7-adf5-4115-b588-108d75eadde7
2026-05-13 16:58:35 -07:00
Fusion
b0f01451d7 test(FN-4397): annotate regression coverage for stale/live branch conflict
Fusion-Task-Id: FN-4397
Fusion-Task-Lineage: 1ffac4f7-adf5-4115-b588-108d75eadde7
2026-05-13 16:58:34 -07:00
Fusion
0c729718d6 test(FN-4397): complete Step 2 — reproduce stale/live misclassification
Fusion-Task-Id: FN-4397
Fusion-Task-Lineage: 1ffac4f7-adf5-4115-b588-108d75eadde7
2026-05-13 16:58:34 -07:00
Fusion
20de80303e test(FN-4386): complete Step 3 — cover idle heartbeat timer gate
Fusion-Task-Id: FN-4386
Fusion-Task-Lineage: 82c1c281-8d69-42c1-8705-90e811b6df93
2026-05-13 16:38:00 -07:00
Fusion
b752307122 test(FN-4307): fix notification tests for strict task status typing
Fusion-Task-Id: FN-4307
Fusion-Task-Lineage: 00140a5a-af93-4905-8570-32d7ecb8a874
2026-05-13 15:58:49 -07:00
Fusion
ffb31a4af6 test(FN-4307): add recovery-notification integration coverage
Fusion-Task-Id: FN-4307
Fusion-Task-Lineage: 00140a5a-af93-4905-8570-32d7ecb8a874
2026-05-13 15:58:48 -07:00
Fusion
e236712d9b test(FN-4307): cover suppression signals and timer cleanup
Fusion-Task-Id: FN-4307
Fusion-Task-Lineage: 00140a5a-af93-4905-8570-32d7ecb8a874
2026-05-13 15:58:48 -07:00
Fusion
8fb7306e5f test(FN-4307): add failed-notification grace window coverage
Fusion-Task-Id: FN-4307
Fusion-Task-Lineage: 00140a5a-af93-4905-8570-32d7ecb8a874
2026-05-13 15:58:48 -07:00
Fusion
74f069b57f feat(FN-4307): complete Step 1 — defer failed notifications
Fusion-Task-Id: FN-4307
Fusion-Task-Lineage: 00140a5a-af93-4905-8570-32d7ecb8a874
2026-05-13 15:58:48 -07:00
Fusion
ff4f6b22d0 fix(FN-4383): satisfy tsc signatures in exec mock implementations
Fusion-Task-Id: FN-4383
Fusion-Task-Lineage: 69516bdf-34d1-405c-8bc9-b558c4780863
2026-05-13 15:28:34 -07:00
Fusion
fab7de4147 fix(FN-4383): align pooled worktree baseline tests with merge-base capture
Fusion-Task-Id: FN-4383
Fusion-Task-Lineage: 69516bdf-34d1-405c-8bc9-b558c4780863
2026-05-13 15:28:34 -07:00
Fusion
0d966aecf8 test(FN-4383): complete Step 3 — add real-git base commit capture regression
Fusion-Task-Id: FN-4383
Fusion-Task-Lineage: 69516bdf-34d1-405c-8bc9-b558c4780863
2026-05-13 15:28:34 -07:00
Fusion
82c52473e6 test(FN-4383): complete Step 2 — add base commit capture unit tests
Fusion-Task-Id: FN-4383
Fusion-Task-Lineage: 69516bdf-34d1-405c-8bc9-b558c4780863
2026-05-13 15:28:34 -07:00
Fusion
6130a95fe2 test(FN-4332): align notifier defaults with legacy failure behavior
Fusion-Task-Id: FN-4332
Fusion-Task-Lineage: c920ac71-906b-458d-b496-1b60540b58f3
2026-05-13 15:15:41 -07:00
Fusion
0ee31db9e1 feat(FN-4332): complete Step 2 — defer failed notifications
Fusion-Task-Id: FN-4332
Fusion-Task-Lineage: c920ac71-906b-458d-b496-1b60540b58f3
2026-05-13 15:15:41 -07:00
Fusion
e0ab5efdf5 test(FN-4379): complete Step 5 — real-git orphan-only recovery test
Fusion-Task-Id: FN-4379
Fusion-Task-Lineage: 88ee0f49-1db2-40e6-8781-7ecbc4dcbdc8
2026-05-13 14:22:23 -07:00
Fusion
d0a748b680 test(FN-4379): complete Step 4 — orphan-only scope unit coverage
Fusion-Task-Id: FN-4379
Fusion-Task-Lineage: 88ee0f49-1db2-40e6-8781-7ecbc4dcbdc8
2026-05-13 14:22:23 -07:00
Fusion
b7b0ba6460 feat(FN-4309): guard squash commits against gitignored files
- Unstage gitignored paths before squash merge commit creation using git check-ignore
- Re-run the guard on the verification-fix squash restore path to keep ignored artifacts out of final merges
- Add merger tests covering forced .fusion artifacts, spaced ignored paths, and ignored-only squash results
- Document the gitignored-path merge guard and add a published package changeset

Fusion-Task-Id: FN-4309
2026-05-13 13:18:12 -07:00
Fusion
7fc5bda3e2 test(FN-4293): add tree-equality recovery tests
Fusion-Task-Id: FN-4293
Fusion-Task-Lineage: 5b7b5a50-d4f5-487c-b420-0ae2ea49b21f
2026-05-13 13:07:06 -07:00
gsxdsm
22fee60aee chore(FN-4350): import dependency content from fusion/fn-4326
Squash-imported the working tree of fusion/fn-4326 as a single commit so this branch carries the dep's content without inheriting its individual commits. If the dep is later squash-merged to main, this commit's patch-id should match the merge and rebase cleanly.

Fusion-Task-Id: FN-4350
Fusion-Task-Lineage: 11fff2c2-1cd1-4562-9b01-032a15217479
2026-05-13 12:30:45 -07:00
Fusion
010467f557 test(FN-4349): complete Step 6 — align block-path tests with new default
Fusion-Task-Id: FN-4349
Fusion-Task-Lineage: 7fa7b0ee-7705-4728-b425-1a3ac45e75a2
2026-05-13 12:16:51 -07:00