Repository navigation
Releases
v3.0.2
JUnit receipts count every test, including tests with a > in their name.
Fixed
- A
>inside a JUnit attribute no longer drops the test. XML allows a bare>in an attribute value, and node:test's JUnit reporter writes names such ascode span > boldthat way. The parser ended the tag at that>, so mcp-context-card's first receipt said 254 when 259 tests ran. With a failing test in the report, the cut could also count the failure against the wrong test. Suite and root tags had the same flaw.
First release published from GitHub Actions with npm Trusted Publishing (OIDC), with provenance.
v3.0.1
A first run with no .taf now starts one instead of stopping.
Fixed
- The command-line tool starts
.tafon its first run.npx taf-git --file test-output.txtin a project with no.tafstopped with "No .taf file found" and printed the command to make one; the README's steps didn't mention it. It now writes a new.taf(no receipts yet) and records the run. The action on the current branch (notarget-branch) does the same; ontaf-receiptsit already did. An existing.tafis never written over.
232 tests pass.
FAF defines. AGENTS.md instructs. AI codes.
v3.0.0 — Standalone Edition
faf-taf-git is now taf-git: the same receipts, under a name of its own.
Using receipt.yml? Change your uses: line to Wolfe-Jam/taf-git/.github/workflows/receipt.yml@v3.0.0. GitHub forwards the old repo name for actions, git and web links, but not for reusable workflows: under the old name the workflow fails before any job starts. Plain action lines (uses: Wolfe-Jam/faf-taf-git@v2.7.1) keep working.
Changed
- Renamed to
taf-git. TAF stands on its own: the npm package, the GitHub repo and the action aretaf-git(uses: Wolfe-Jam/taf-git@v…). Installingtaf-gitalso gives you afaf-taf-gitcommand; GitHub forwardsWolfe-Jam/faf-taf-git. The.tafformat, the receipt fields and thetaf-receiptsbranch are unchanged. - Receipt commits are authored by
taf-git[bot]; earlier receipts keepfaf-taf-git[bot]. - The Homebrew formula is
taf-git.
228 tests pass.
FAF defines. AGENTS.md instructs. AI codes.
v2.7.1
A test job that fails before its tests report now gets a FAILED receipt, with zero counts.
Fixed
- A red run with no test output is recorded too. When the test job fails before its tests report (the install or the build fails, a test does not compile under
cargo nextest, the upload step was skipped),receipt.ymlnow writes a placeholder and records the run asFAILEDwith zero counts, with a warning that names the likely cause. It was a warning and no receipt, a gap in the history. A test job that passed with no artifact still fails the receipt job (a wrongartifact-name); one that was cancelled or skipped gets no receipt. This repo's own CI does the same. - The zero-count warning has one full stop (it read "… Vitest.. test-outcome …").
228 tests pass.
FAF defines. AGENTS.md instructs. AI codes.
v2.7.0 — Red Runs Edition
A red CI run now gets a FAILED receipt, written by a separate job that is the only one with write access.
Added
- A reusable workflow,
.github/workflows/receipt.yml: call it from a job thatneedsyour test job. The test job uploads its output as an artifact; the receipt job downloads it and saves the receipt totaf-receipts. Withif: ${{ !cancelled() }}on the calling job a red run is recorded asFAILED, and only that job hascontents: write. Inputs:artifact-name,test-output-file,test-result,target-branch,skipped-names,runs-on,commit-message. The action's outputs are passed through.test-result: ${{ needs.<test job>.result }}is required: a failed test job is recorded asFAILEDeven when its output counts no failed test. No artifact after a failed test job: no receipt, and a warning that names the causes (the build failed first, an upload step withoutif: ${{ !cancelled() }}, a wrong name). No artifact after a test job that passed means a wrongartifact-name, and the job fails. The README now leads with this setup. - Action input
fail-on-failed-tests(defaultfalse): fail the step when the receipt isFAILED, after the receipt is written and pushed and the outputs are set. A single job whose test step hascontinue-on-error: truegets itsFAILEDreceipt and still goes red, with no extra failing step. - Action input
test-outcome(optional): the test step's outcome or the test job's result. Onlyfailurecounts. The receipt is thenFAILEDeven if the output counts no failed test (a test file that did not compile, a coverage threshold, a linter innpm test), and output that counts nothing at all gets aFAILEDreceipt with zero counts instead of no receipt. Left out, the result comes from the output alone, as before.
Fixed
- On the current branch (no
target-branch), a push another run beat is tried again. The receipt was lost with a warning. The action now fetches the branch into a temporary worktree, adds the receipt to the fresh.tafthere and pushes, up to 5 tries in all: the same retrytarget-branchhas. The worktree holds only.tafand runs no hooks; anything that goes wrong in it ends on the usual warning, not a failed step. The job's checkout is not moved: later steps run on the commit that was tested, which keeps its own receipt commit, unpushed, so its.taflacks the other runs' receipts. Commits that earlier steps made go out with the receipt only when the first push succeeds; a retry pushes the receipt alone. Changed or staged files in the checkout do not block the retry. As ontarget-branch, the retried receipt sits on top of the newer commit and has a new timestamp. Tries are spaced by a short random wait, on both paths. - A push that lost the race while it ran is tried again too (
cannot lock ref/failed to update ref), on both paths. It was treated as a refusal. - The push target on the current branch is the branch's configured upstream (
branch.<name>.remoteand.merge), pushed asHEAD:refs/heads/<branch>, not a baregit push. Setups that relied onpush.defaultorpushRemotepush to the upstream now. - The try count is exact when a retry stops early (a failed fetch): the message said the push failed 5 times.
- The lost-receipt warning follows the last failure: a retry the server refused, or a
.tafthat could not be written, no longer reads as a lost race. - The badge shows a
FAILEDreceipt with no failed test asrun failedin the fail colour, not "5/5 passing". - The warning for a receipt that can't be pushed says so plainly: the receipt was not saved, git's reason, and the fix (
permissions: contents: writeon the job, ortarget-branch: taf-receiptsfor a protected branch).fail-on-push-errorstill defaults tofalse.
Changed
- This repo's own CI uses the same two-job setup: the test job uploads its output and a separate receipt job, the only one with
contents: write, records the run, a failed one too, with this commit's action (uses: ./). Before, a failed test run wrote no receipt. - The reusable workflow pins the action to the release it ships in. A test fails when that pin and
package.json's version differ.
Tests: 227 passing.
Upgrade: uses: Wolfe-Jam/faf-taf-git@v2.7.0, or call the reusable workflow Wolfe-Jam/faf-taf-git/.github/workflows/receipt.yml@v2.7.0 (see the README, "Set it up").
FAF defines. AGENTS.md instructs. AI codes.
v2.6.0 — Safe Receipts Edition
Receipts are never lost, and your checkout is never touched.
Fixed
- No shell for the commit message (#39): the CLI ran
git commit -m "<message>"through a shell, so--message 'x$(touch INJECTED)y'ran a command. Every git call now takes an argument list. - Receipt commits hold
.tafonly (#39, and thetarget-branchpath in this release):git addandgit commitname-- .taf, so whatever else is staged stays out of the receipt. target-branchwith a stepworking-directory: the first run committed the repository's other tracked files onto the receipts branch (the orphan init kept the whole index, andgit rm -rf .only cleared the subfolder). The receipts branch now gets that.tafonly. A receipts branch created this way by 2.5.0 or earlier keeps the files it already has: delete it, or remove them by hand.- The Action never writes git config (#39): it used
git config --global user.name/user.email, which on a developer machine replaces their identity for every repo. The bot identity now goes to each git command asGIT_AUTHOR_*/GIT_COMMITTER_*. - A receipt write keeps the rest of the file: the file was rebuilt from parsed data, which dropped comments, blank lines and any later
---document. The receipts document is now edited as YAML (its comments and key order stay), and anything after it is kept byte for byte, even a document with a YAML error. As before, CRLF line ends become LF and history indentation becomes 2 spaces. - Runs that write the same
.tafat once each keep their receipt: 20 parallel runs kept as few as 1–6 receipts, depending on the machine. Each write now holds.taf.lock(host:pid:token) and renames a temp file over.taf; 20 parallel runs keep 20. A lock left by a killed run (its process gone, or older than a minute) is taken over by one waiter at a time, so a live lock is never removed. A symlinked.tafstays a symlink and keeps its mode. - CLI
--commit: a receipt that isn't pushed is an error. A rejected push exits 1 with git's reason (and the server's message), plus what to do:git pull --rebase && git pushwhen the remote moved on, a check of push access and branch protection when the server refused. A branch with no upstream keeps the receipt in a local commit and says so. target-branchfound a branch that only ends in the same name (ls-remotematchedarchive/taf-receiptsfortaf-receipts) and then failed. It now asks forrefs/heads/<branch>. A failing git command in the Action names git's own error.target-branchno longer touches the job's checkout. The Action switched the checkout to the receipts branch, stashed changes it never restored, and on the first run emptied the working tree withgit rm -rf .. On a developer machine that lost staged work. It now writes the receipt in a separate git worktree, in a temporary folder that is removed afterwards: the checkout keeps its branch, its staged work and its files.--name=valueworks for every CLI option:--message=…was ignored and the default message used.
Added
- Action output
receipt-pushed:truewhen the receipt reached the remote;falsewithauto-commit: false, with no upstream (a pull request checkout), or when the push failed. - Action input
fail-on-push-error(defaultfalse): fail the step when the receipt can't be pushed to the current branch.
Changed
- A receipt that the Action can't push is no longer quiet. On
target-branch, a push still rejected after 5 tries fails the step (it was a warning, and the receipt was lost). On the current branch it stays a warning, now saying the receipt is lost when the job ends and why (a read-only token, a protected branch, another run first), withreceipt-pushed: false; setfail-on-push-error: trueto fail the step instead. Many workflows push with a read-onlyGITHUB_TOKEN, so failing by default would turn them red. - After a
target-branchrun the job's checkout is still on its own branch. Before, later steps in the same job ran on the receipts branch. - During a merge, the CLI's
--commitnow fails (cannot do a partial commit during a merge) and leaves.tafstaged. Before, it silently committed your merge as the receipt. Finish the merge, then commit the receipt.
Upgrade: uses: Wolfe-Jam/faf-taf-git@v2.6.0 · npm i -g faf-taf-git@2.6.0
If you used target-branch with a step working-directory on 2.5.0 or earlier: the receipts branch may hold your repo's other tracked files from its first run. 2.6.0 writes .taf only; delete the branch, or remove those files by hand.
Tests: 197/197.
FAF defines. AGENTS.md instructs. AI codes.
v2.5.0 — Named Skips Edition
Receipts name the skipped tests, so a skipped count that stays the same can't hide a different set.
Added
skipped_testson each receipt with skips (RECEIPT-FORMAT.md v1.1): the names (sorted, up to 25,truncated: truepast that), asha256hash of the full set, andnewly_skipped/no_longer_skippedagainst the previous receipt. A return to zero writesnames: []withno_longer_skipped.- Names from JUnit XML (
<testcase>with<skipped/>, asclassname > name) and Bun ((skip)and(todo)lines, with their file). Names are cleaned so they compare across runs: colour codes, timings and absolute path prefixes removed, whitespace collapsed, at most 200 characters. - The block is written only when the output names every skipped test; otherwise the log says why (Jest and Vitest print names only in verbose mode).
- Action input
skipped-namesand CLI flag--skipped-names(default 25,0turns it off; anything but a whole number is an error). Action outputnewly-skipped. - On a push-race retry the diff is worked out again against the receipt that won.
Changed
- RECEIPT-FORMAT.md v1.1: readers ignore keys they don't know. The file's
format_versionstays"1.0.0". action.ymllistsSKIPPEDamong theresultvalues.
Tests: 172/172.
Upgrade: uses: Wolfe-Jam/faf-taf-git@v2.5.0 · npm i -g faf-taf-git@2.5.0
FAF defines. AGENTS.md instructs. AI codes.
v2.4.6
The package no longer carries build-machine paths, and a report with no tests says "no tests ran" instead of "could not parse".
Fixed
- A JUnit report that lists no tests (
node --testwith no test files) saysNo tests ran: the JUnit report lists 0 tests, so there is no receipt to print.instead ofCould not parse test output. Still no receipt, still exit 1. - The npm package no longer carries this machine's file paths: the
.d.ts.mapfiles (which pointed atfile:///Users/…/src, a folder the package doesn't ship) are gone, and so aredist/main.*, left over from a source file deleted long ago. 52 files → 37.
Changed
npm run check:no-hardcodefails whendist/holds a build-machine path. CI runs it after the build, andnpm publishruns it first.
v2.4.5
node:test receipts count every test: a failing top-level test beside a describe is no longer dropped, and nested describes are counted in full.
Fixed
- node:test JUnit reports (
--test-reporter=junit) are counted by their<testcase>s. node counts a nesteddescribeas one test in its parent, and puts top-level tests beside its suites, so a run with adescribewas miscounted: a failing top-level test was dropped and the receipt said PASSED. Now counted when suites are nested, or when there are more testcases than the suites count. Other reports are read as before.
v2.4.4
Receipts tell the truth about skips: a run where every test was skipped is recorded as SKIPPED, the badge counts only real passes, and each receipt says where it ran.
Fixed
- With no
.taf, the error said to runfaf taf init, a command that doesn't exist. It now gives the line that makes one:echo 'test_history: []' > .taf. - Every receipt said
trigger: github-actions, even a local run. It now saysgithub-actionson GitHub Actions,cion another CI, andlocalotherwise. - A run where every test was skipped was recorded as
PASSED. It is nowSKIPPED, a newresultvalue in the receipt format (RECEIPT-FORMAT.md), and its badge is gray. - The badge counted skipped tests as passing: 2332 passed and 1 skipped showed
2333/2333 passing (1 skipped). It now shows2332/2333 passing (1 skipped).