Skip to content

Commit 0753a45

Browse files
committed
feat(audit): A3 witness MVP — RetentionPath extracted from PR #280, minus the dominator tree
The runtime-witness half of the flagship demo, resurrected as the minimal core rather than a rebase of the geological layer: Heap.cs (mark-from-roots census, sampled ranked retainers with the field named at every hop, stack/finalizer vs real retention) + Program.cs (census / roots, --pid|--dump, --type, --sample/--max-hops limits, --out runtime.json) + the csproj. Deliberately NOT taken: Dominators.cs (444 lines of separate proof surface the hero demo does not need), the pre-#278/#305/#306 corpus slice, and the old runtime-contract docs. Adapted to the A3 contract: - verdict vocabulary — RETAINED (a root path was established, exit 1) | OBSERVED_ONLY (instances exist, no path established — never called a proven leak, exit 0) | ABSENT; usage documents it; - the JSON artifact carries verdict + collector identity (mode attach/dump, target, runtime, OS — no timestamps: identical heaps must yield identical artifacts); - a failed read stays exit 2, distinct from clean(0)/retained(1); - net8.0 cross-platform (ClrMD 3.x live-attach works on Linux and Windows; legacy net472 heaps are dump-only from here — the PR #280 live-attach build can be resurrected the day a live legacy target matters). Gate A builds the project and smokes the honest-failure surface on both platforms: bare usage exits 2 with the verdict vocabulary documented, and a failed attach exits 2 — never a clean scan. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015de4MezSeUnZBoWq1fFU5M
1 parent a9a6e86 commit 0753a45

4 files changed

Lines changed: 706 additions & 0 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2427,6 +2427,22 @@ jobs:
24272427
echo "$out"
24282428
[ "$rc" -eq 5 ] || { echo "FAIL: expected exit 5 in debug mode too, got $rc"; exit 1; }
24292429
echo "$out" | grep -q "Traceback (most recent call last)" || { echo "FAIL: --debug must surface the full cause"; exit 1; }
2430+
- name: "retention-path witness MVP builds and its usage surface is honest (A3)"
2431+
run: |
2432+
dotnet build "$GITHUB_WORKSPACE/audit/runtime/RetentionPath" -c Release -v quiet
2433+
set +e
2434+
out=$(dotnet "$GITHUB_WORKSPACE"/audit/runtime/RetentionPath/bin/Release/net8.0/RetentionPath.dll 2>&1)
2435+
rc=$?
2436+
set -e
2437+
echo "$out"
2438+
[ "$rc" -eq 2 ] || { echo "FAIL: bare usage must exit 2 (never clean), got $rc"; exit 1; }
2439+
echo "$out" | grep -q "RETAINED (root path shown) | OBSERVED_ONLY" || { echo "FAIL: usage must document the verdict vocabulary"; exit 1; }
2440+
set +e
2441+
out=$(dotnet "$GITHUB_WORKSPACE"/audit/runtime/RetentionPath/bin/Release/net8.0/RetentionPath.dll roots --pid 999999 --type X 2>&1)
2442+
rc=$?
2443+
set -e
2444+
echo "$out"
2445+
[ "$rc" -eq 2 ] || { echo "FAIL: a failed attach must exit 2, never read as clean, got $rc"; exit 1; }
24302446
- name: "a top-level .NET exception exits 5 in BOTH modes — debug changes volume, not semantics (A1 P2)"
24312447
if: runner.os == 'Linux'
24322448
run: |

0 commit comments

Comments
 (0)