Skip to content

docs(W7): SHA-advance re-review + external-dep timer rules - #45

Merged
gHashTag merged 1 commit into
mainfrom
w7/docs/temporal-rules
Jul 5, 2026
Merged

docs(W7): SHA-advance re-review + external-dep timer rules#45
gHashTag merged 1 commit into
mainfrom
w7/docs/temporal-rules

Conversation

@gHashTag

@gHashTag gHashTag commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Что делает

Добавляет два sibling-правила к no-paste-review в docs/W7_COLLAB_OPTIONS.md §Handoff protocol:

  1. SHA-advance re-review rule — approve привязывается к cited SHA; branch advance между approve и merge требует explicit re-confirm с delta bullet-list. Silent SHA-swap forbidden. Урок: PR W7.1 investigation — E0425 root cause is dropped let statements in t27c Rust emitter (findings-only) #44 @ 3f1d98a после approve @ 60d2e04.

  2. External-dep timer rule — PR блокированный внешней dep обязан иметь terminal-event triggers (won't-fix / closing PR / explicit reject) + backstop timer (14д default). Whichever comes first. Урок: t27#1401 upstream tracking для PR W7.1 investigation — E0425 root cause is dropped let statements in t27c Rust emitter (findings-only) #44.

Мотивация

Все три правила (no-paste-review + SHA-advance + external-dep timer) — про temporal precision approve/merge:

  • no-paste-review: review \ne paste (spatial locality)
  • SHA-advance: approve \ne merge-state (temporal drift within PR)
  • external-dep timer: draft \ne infinite wait (temporal drift outside PR)

Без всех трёх — anchor-bias через paste, silent SHA-swap, perpetual-draft. С ними — reproducible approve chain.

Delta

+9 строк в docs/W7_COLLAB_OPTIONS.md, только docs. Zero code.

References

phi^2 + phi^-2 = 3

Sibling rules к no-paste-review (все три — про temporal precision approve/merge).

SHA-advance: approve привязывается к cited SHA; branch advance между approve
и merge требует explicit re-confirm с delta bullet-list. Silent SHA-swap forbidden.

External-dep timer: PR блокированный внешней dep обязан иметь terminal-event
triggers + backstop timer (14д default). Whichever comes first. Без обоих:
event-only → silent-neglect infinite draft; timer-only → waste on явно rejected.

phi^2 + phi^-2 = 3
@gHashTag
gHashTag marked this pull request as ready for review July 5, 2026 12:56
@gHashTag
gHashTag merged commit be06148 into main Jul 5, 2026
2 checks passed
@gHashTag
gHashTag deleted the w7/docs/temporal-rules branch July 5, 2026 12:56
gHashTag pushed a commit that referenced this pull request Jul 5, 2026
…corpus ground truth

SHA-advance delta: 247427d → HEAD

Blocking finding from GLM peer-review of 247427d: collection-params
syntax mismatch with the actual audit corpus.

247427d emitted Zig-style forms:
  fn f(p: []const u8, q: [16]u32, r: []u16)

This was chosen from a workspace-wide grep that included a parallel
non-tri-net corpus at ../t27/specs/ (830 []const T occurrences there).
Re-verification against the audit corpus at tri-net/specs on the PR #39
branch (feat/strategic-audit-2026-07-04, 68 files) confirmed 0
[]const T occurrences. That corpus uses Rust-style [T; NAMED_CONST]
exclusively — 159 total occurrences, 100% u32 element type,
module-scope const-decls in the [2, 32] literal range.

Revision applied (option a, drop Zig-forms + u32-only):
- Rewrote gen.rs pick_coll_type to emit only [u32; NAMED_CONST].
- Added Ctx.declared_consts: Vec<(String, u32)> for per-module tracking.
- Added gen_const_decls: emits 1–4 module-scope const NAME: u32 = <lit>;
  before fns, values in [2, 32], no repeats within a module.
- Added NAMED_CONST_POOL: top-10 audit-corpus consts (MAX_NODES,
  MAX_PARAMS, MAX_METRICS, MAX_FLOWS, MAX_ENTRIES, MAX_MODULES,
  MAX_TASKS, MAX_FUNCTIONS, MAX_SAMPLES, MAX_RESULTS).
- gen_module now emits const-decls before fn-decls.
- gen_params guards: emit collection-param only if declared_consts
  non-empty, else fall back to scalar.
- Isolation constraint preserved: collection-typed idents recorded in
  Ctx.coll_params, never pushed into Ctx.idents.
- Grammar header comment updated.

Re-baseline (N=1000, seed range 0xC0FFEE..0xC0FFEE+999):
- ok=1000  parse_err=0  mut_fail=0  non_det=0
- 1951 fns emitted (1177 with ≥1 collection-param, 60.3%; 392 with 0
  params, 20.1%)
- 1924 [u32; NAMED_CONST] occurrences, distribution 166–224 per name
- 2510 module-scope const-decls (avg 2.5 per module)

BASELINE.md §Expanded baseline rewritten:
- New §Corpus-mismatch resolution and syntax choice documents the
  scope error and its fix explicitly.
- Results table replaced with [u32; NAMED_CONST] numbers.
- Coverage delta rewritten with actual named-const distribution.
- Interpretation notes updated; Zig-style absence documented as
  explicit non-coverage.

Anchor recorded (Anchor #4): any claim verified against ground truth
requires scoping the verification tool to the same corpus as the
claim. Workspace-wide grep is not corpus-scoped grep.

Discipline: honors SHA-advance rule (PR #45 → main @ be06148) —
this commit is a delta from 247427d, delta bulletized in PR body.

phi^2 + phi^-2 = 3
gHashTag added a commit that referenced this pull request Jul 5, 2026
…2; NAMED_CONST] (#47)

W7.3 grammar-expansion increment #1 — collection-typed params using [u32; NAMED_CONST] syntax matching the tri-net/specs audit corpus.

Path-confirmed via t27c gen-rust: 1000/1000 gen-rust succeeded, 1924 [u32; NAMED_CONST] in .t27 input → 1924 Vec<> in Rust output, exact one-to-one. W6.2 Class 2 defect surface (Vec<> param-position) exercised by construction.

Independently verified by GLM re-review at 9bbc103:
- Documented 1000-spec sweep: 1924 Vec<> in gen-rust output
- Independent t27c run on specs/anomaly_detector.t27: rc=0, 7 Vec<> confirmed

Discipline chain observations (this PR):
- Anchor #4 recorded: any claim verified against ground truth requires scoping the verification tool to the same corpus as the claim.
- SHA-advance rule (PR #45): applied at 247427d9bbc103 with delta bullet-list in PR body.
- No-paste-review rule (PR #43): GLM approved against committed body text with SHA citation.

Commits (post-squash provenance):
- 2080510  fix(W7.3): word-boundary anchor normalize_ast regex
- 247427d  feat(W7.3): grammar-expansion target #1 — collection-typed params (Zig-style, OBSOLETED)
- 9bbc103  fix(W7.3): rewrite collection-params to [u32; NAMED_CONST] per audit-corpus ground truth

Base: main @ 3272583 (PR #46, E1+E2 frozen baseline). E3 still timer-blocked (backstop 2026-07-19 12:24 UTC per PR #44).

phi^2 + phi^-2 = 3
gHashTag pushed a commit that referenced this pull request Jul 23, 2026
…r -> sealed offer)

Four waves built harness-proven but UNWIRED NAT modules (StunClient #42, HolePunch
#43, IceSession #44, CandidateOffer #45). Proven-in-a-harness is not
proven-in-the-product, and four modules outside the binary is a growing debt. This
wave puts them in the shipping Mac app and proves they run there, WITHOUT touching
the working same-subnet call.

  * project.yml: register the four modules + a new NatDiagnostics; xcodegen
    regenerated the tracked pbxproj (clean +20 lines, only the 5 files, no churn).
  * NatDiagnostics.run(): off-main at launch (.onAppear), gathers host + STUN
    server-reflexive candidates and seals a CandidateOffer under the current room,
    then logs it. Additive only — nothing in the call/media path changes.

Verified LIVE in the built binary (not a harness): launched with TRINET_LOG and
read back
  TRINET NAT: candidates host=["192.168.1.104"] srflx=182.232.218.171:59434
              -> sealed offer 83B (room=lobby)
so StunClient.hostCandidates + gatherServerReflexive (real public address via
Google STUN) + CandidateOffer.make all execute inside the app; the app did not
crash, so the working call is intact.

Deferred deliberately: the iOS embed (static file list is fragile) and the real
integration — deliver the offer via a rendezvous and run Ice.connect before the
media socket. The app now HOLDS its sealed candidate offer; delivering it and
connecting on it is next.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
gHashTag pushed a commit that referenced this pull request Jul 23, 2026
…nnect

Both platforms hold a sealed candidate offer (#45-47) but had no way to DELIVER it
to the peer. Even serverless P2P needs a meeting point for the first exchange
(WebRTC = signaling server, BitTorrent = tracker/DHT, tri-net = the mesh).
Rendezvous.swift is the CLIENT: address the relay by roomHash = SHA256(passphrase)
so it never sees the passphrase, publish your sealed offer, fetch the peer's. The
relay is a BLIND pairing service — offers are sealed, so it cannot read or forge
candidates; it only matches "someone else who hashed the same room" with you.

Verified in smoke/harness/rendezvous.swift (12th verify.sh test, 15 checks, 5x for
determinism, verify: 12 passed, 0 failed): pure layer — wire codec, roomHash
blinding, mailbox pairing logic; LIVE layer — a reference UDP rendezvous server +
two clients that gather -> seal -> publish -> fetch -> open -> Ice.connect and
actually connect over loopback KNOWING ONLY A SHARED ROOM NAME. That is the whole
serverless-connection chain end-to-end on one machine.

Also fixed a verify.sh regression this exposed (NOT caused by rendezvous): the
keychain harness began hanging because waves #46/#47 launched the real SIGNED app,
which stored its device identity under the default keychain account; a fresh
unsigned harness touching that signed item blocks on a GUI SecurityAgent prompt
(the #41 watchdog caught it as a timeout). The app launch poisoned the shared
keychain — identity before shared medium. Fix: export TRINET_KC_ACCOUNT=verify so
the keychain harness uses an isolated, harness-owned account; the app's real
identity item is left untouched.

roomHash and the seal are independent defenses: the hash hides WHICH room from the
relay, the seal hides WHAT candidates. Boundary: loopback proves discover +
exchange + punch + connect over real UDP; a deployment needs the relay host (a
tiny stateless service, or the mesh) and two separate NATs for real traversal.
Rendezvous is client-only, harness-proven, Mac-only this wave; the iOS mirror and
the CallManager integration are the last two steps.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant