fix(post-merge): F# ZetaId Pack-time revalidation + fsharp-output.json rename + Crdt path + Aaron→human-maintainer per Copilot+Codex on PR #4548+#4549#4551
Merged
AceHack merged 1 commit intoMay 21, 2026
Conversation
There was a problem hiding this comment.
Pull request overview
Post-merge cleanup to keep the ZetaId cross-verification harness aligned across TypeScript/C#/F# and to harden F# packing against public DU-case construction bypasses, plus small doc/reference corrections.
Changes:
- Renames F# cross-verification output target to
fsharp-output.jsonto matchcompare.ts. - Adds Pack-time revalidation for
Authority.Raw/Momentum.Rawto prevent bypassing smart-constructor validation. - Replaces a personal-name attribution in F# comments with a role-ref, and corrects CRDT file-path references in a preserved memory archive.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Tests.FSharp/ZetaId/CrossVerifyTests.fs | Write cross-verify output to fsharp-output.json (matches TS comparer expectations). |
| tests/cross-verification/zeta-id/fsharp-output.json | Renamed/updated canonical F# output JSON for the cross-verify directory. |
| src/Core.FSharp.ZetaId/Types.fs | Adjusts a comment to use a role-ref instead of a personal name. |
| src/Core.FSharp.ZetaId/Codec.fs | Adds Pack-time revalidation for Authority.Raw / Momentum.Raw to defend against DU-case bypass. |
| memory/persona/amara/conversations/2026-05-21-amara-aaron-trust-gradient-coordination-policy-not-consensus-hierarchy-row-level-caspaxos-casraft-tier-aaron-forwarded.md | Corrects CRDT substrate path references (src/Core/Crdt.fs). |
| validateEnumField (byte obs.Firefly) 1 "Firefly" | ||
|
|
||
| // Re-validate Authority.Raw / Momentum.Raw at Pack time. F# DU cases | ||
| // are inherently public — callers can construct `Authority.Raw 31` directly, |
Comment on lines
+56
to
+60
| match obs.Authority with | ||
| | Authority.Raw v -> | ||
| if v > 31uy then | ||
| raise (System.ArgumentOutOfRangeException( | ||
| "obs", v :> obj, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Post-merge cleanup PR addressing 5 actionable Copilot+Codex threads on PR #4548 (F# ZetaId 3rd peer oracle) and PR #4549 (trust-gradient archive). 1 known FP resolved no-op.
Findings + fixes
1. fs-output.json → fsharp-output.json (real bug, P1)
Copilot caught:
tests/cross-verification/zeta-id/compare.tsline 4 readsfsharp-output.json. My F# test wrotefs-output.json. The comparer wouldn't see F# output. Fixed:tests/cross-verification/zeta-id/fs-output.json→tests/cross-verification/zeta-id/fsharp-output.jsonviagit mvoutputPathintests/Tests.FSharp/ZetaId/CrossVerifyTests.fs:123to write to the correct filename2. Pack-time revalidation defends Authority.Raw / Momentum.Raw DU bypass (real design issue, P1+P2)
Codex P1 + Copilot caught: F# DU cases (
Authority.Raw of byte,Momentum.Raw of byte) are inherently public. Callers can writeAuthority.Raw 31uydirectly, bypassing theAuthority.rawsmart-constructor validation. F# cannot fully hide DU cases cross-assembly without signature files.Fix: Pack-time re-validation in
src/Core.FSharp.ZetaId/Codec.fs— when packing, re-checkAuthority.Raw vfor 5-bit-bounds + named-case-collision; re-checkMomentum.Raw vfor named-case-collision. Mirrors the C# safety guarantee (which lived in the sealed-record private-setter Raw constructor). Even if callers bypassAuthority.raw, Pack throws on out-of-range or named-collision values.3. Drop "Aaron" personal name from Types.fs (convention)
Copilot caught:
src/Core.FSharp.ZetaId/Types.fs:35had "Backlog (Aaron 2026-05-21)". Convention is role-refs only in current-state code. Changed to "Backlog (human maintainer 2026-05-21)".4.
src/Core/Crdt.fsnotsrc/Core/Crdt/*(factual correction)Copilot caught:
memory/persona/amara/conversations/...-trust-gradient-...md:194,223referencedsrc/Core/Crdt/*as if it were a directory. Actual repo state:src/Core/Crdt.fs(single file). Updated both references.5.
||table-pipe pattern at line 41 (KNOWN FP — no-op)Copilot flagged
||rendering as empty first column. Directawk -v N=41inspection shows single|at line start. This is the known-FP pattern documented in.claude/rules/blocked-green-ci-investigate-threads.md"Suspect-by-default Copilot finding classes" — Table double-pipe FP. Resolved no-op with reference to the rule.Empirical verification
dotnet build tests/Tests.FSharp/Tests.FSharp.fsproj -c Releasesucceeds 0 warnings 0 errorsdotnet test --filter "FullyQualifiedName~CrossVerify"passes 12/12 (Pack-time revalidation does NOT change the canonical hex; only catches invalid construction paths)Composes with rules
.claude/rules/blocked-green-ci-investigate-threads.md— verify-before-fix discipline + known-FP pattern catalog.claude/rules/m-acc-multi-oracle-end-user-moral-invariants.md— F# safety guarantees match C# (multi-oracle parity at safety surface, not just at functional surface).claude/rules/fsharp-anchor-dotnet-build-sanity-check.md— F# compiler verified clean post-fixComposes with substrate
Test plan
git mv(preserves history)src/Core/Crdt.fspath corrected in 2 archive references69481098base)