Skip to content

memory(ts-pattern): SQLSharp external anchor — super-strongly-typed bun/ts DI pattern (Aaron 2026-05-01)#1155

Merged
AceHack merged 3 commits intomainfrom
otto/sqlsharp-bun-ts-pattern-anchor-2026-05-01
May 1, 2026
Merged

memory(ts-pattern): SQLSharp external anchor — super-strongly-typed bun/ts DI pattern (Aaron 2026-05-01)#1155
AceHack merged 3 commits intomainfrom
otto/sqlsharp-bun-ts-pattern-anchor-2026-05-01

Conversation

@AceHack
Copy link
Copy Markdown
Member

@AceHack AceHack commented May 1, 2026

Summary

Aaron 2026-05-01 four-message clarification stack pointed at ../SQLSharp as the bun/ts best-practices anchor — distinct from the DST anchor (a different sibling repo carries that), this is the "super strongly typed... not js-in-ts failure mode" pattern Otto should write toward when authoring TS tools.

Pattern (from ../SQLSharp/tools/automation/format/format-repo.ts):

  1. Dependencies interface for every external call surface (typeof X-keyed against production import).
  2. defaultDependencies const wires production deps once.
  3. Top-level functions take (args, options, deps?) triple.
  4. Tests pass synthetic deps — structural DI compiler-checked, no monkeypatching, no mock frameworks.
  5. No any. No implicit any. Discriminated unions. readonly array params. Exhaustive type checks.

The discriminating axis is "not js-in-ts failure mode" — TS that carries design invariants in compiler-checked types vs TS that's just JS-with-.ts-extension-and-any-escapes.

Memory file content: pattern definition + how-to-apply + worked-example gap analysis on poll-pr-gate-batch.ts (PR #1153 landed only pollFn injectable; full pattern would extract spawnSync, process.exit, process.stdout, new Date() to a BatchPollDependencies interface). Follow-up refactor target tracked.

Composes with:

  • prefer-TS-over-bash rule (this is the form-factor target)
  • DST-grade-A pull-to-sibling-repo discipline (SQLSharp is one of the high-credibility instances of that rule)
  • detect-changes/parallel-optimization sibling-repo anchor (different anchor, different domain — ../no-copy-only-learning-agents-insight for parallel-optimization, ../SQLSharp for bun/ts)
  • post-install-TS strategy (TS is the target language; this rule names what good TS looks like)

Carved sentence (candidate): "Super-strongly-typed TS, not js-in-ts. Every external call surface in an interface. Every function takes its dependencies. The default const wires production; the test constructs the synthetic. The pattern IS the DST achievability vehicle."

Test plan

  • MEMORY.md row added per memory-index-integrity rule (mandatory pair)
  • Memory file ASCII-clean per BP-10
  • Cross-references to composing memory files verified existing

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings May 1, 2026 20:34
@AceHack AceHack enabled auto-merge (squash) May 1, 2026 20:34
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: aa48bce672

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread memory/MEMORY.md
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new memory entry capturing a TypeScript “dependencies-as-interface” DI pattern (anchored to the external SQLSharp repo) and indexes it in memory/MEMORY.md so future TS tooling work in Zeta can follow a more strongly-typed, compiler-enforced design.

Changes:

  • Added a new memory file documenting the SQLSharp-style TS DI/dependency injection pattern and how to apply it in Zeta tools.
  • Updated memory/MEMORY.md to include the new memory entry.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
memory/feedback_ts_dependencies_as_interface_di_pattern_sqlsharp_anchor_aaron_2026_05_01.md New memory describing the TS DI pattern, rationale, and an application gap analysis.
memory/MEMORY.md Index update to link the new memory entry (currently introduces a duplicate link).

Comment thread memory/MEMORY.md Outdated
AceHack added a commit that referenced this pull request May 1, 2026
…ck (PRs #1153 +2 commits, #1155 opened) (#1156)

Three landings this tick: (1) Codex P2 fix on poll-pr-gate-batch.ts
(`gh api --paginate` replaces `gh pr list --limit 1000` to handle
queues over 1000 PRs without silent truncation). (2) DST test
suite: 10 tests in 152ms, zero gh spawns, exercises pure functions
+ injectable pollFn — worked-example proof for the dynamic-bash
memo's load-bearing claim "DST is achievable in TS." (3) New
SQLSharp-bun-ts-pattern memory file (PR #1155) capturing Aaron's
external-anchor lesson: super-strongly-typed dependencies-as-interface
DI pattern, not js-in-ts failure mode.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
AceHack added a commit that referenced this pull request May 1, 2026
…th (Codex P1, Copilot P0)

Two findings on PR #1155:

(1) Codex P1 + Copilot P0 (duplicate finding): MEMORY.md had
    two rows for the dynamic-bash memory file (line 12 older
    form + line 14 extended form with worked-example footer).
    The duplicate was a cherry-pick artifact: my SQLSharp-row
    cherry-pick onto fresh main applied the row-add cleanly
    but git's 3-way merge also re-added the dynamic-bash row
    in its updated form rather than editing the original. The
    audit lint (tools/hygiene/audit-memory-index-duplicates.sh)
    enforces "one row per memory file" — Codex/Copilot caught
    the violation.

    Fix: remove the older (shorter) duplicate row. Keep the
    newer row with the worked-example footer pointing at
    poll-pr-gate*.ts. Memory index now satisfies the
    one-row-per-file invariant.

(2) Copilot: caused_by referenced absolute filesystem path
    /Users/acehack/Documents/src/repos/SQLSharp/... — host-
    specific, not reproducible for other readers. Fix:
    replace with sibling-repo-relative `../SQLSharp/...` and
    note the absolute-path rationale inline.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
AceHack added a commit that referenced this pull request May 1, 2026
…PRs #1153 +2 commits, #1155 +1 commit) (#1157)

Three commits across two PRs draining 11 unresolved review
threads (1 outdated + 10 real-fix from Codex + Copilot):

- 6b8c743 (#1153): 4 fixes — requireValue rejects `-` prefix,
  spawn drops explicit stdio for non-null typing, listOpenPRs
  uses --jq for line-oriented output, de-name attribution per
  persona-on-current-state-surface rule
- 9e12f3f (#1153): try/catch around pollFn — orchestrator
  never rejects (Copilot P0). New DST test asserts invariant.
- cea6017 (#1155): MEMORY.md dup-row removal + de-absolute
  SQLSharp path

All threads resolved. Both PRs now wait-ci with no warnings.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
AceHack added a commit that referenced this pull request May 1, 2026
…s-substrate-inventory bullet (review fixes + maintainer framing)

Three fixes on PR #1160:

(1) Codex P2 + Copilot P0 (duplicate findings): the SQLSharp DI
    pattern bullet pointed at memory/feedback_ts_dependencies_as_interface_di_pattern_sqlsharp_anchor_aaron_2026_05_01.md,
    which lives on PR #1155's branch (not yet merged to main).
    The CLAUDE.md pointer would dangle when #1160 lands.

    Fix: remove the SQLSharp bullet entirely from #1160. It can
    re-land as a follow-up PR after #1155 merges and the memory
    file is on main. Cleaner sequencing — each PR's pointer
    targets must exist on main at merge time.

(2) Copilot: the meta-rule bullet quotes the human maintainer's
    verbatim message including ".claude/rules" — but Zeta
    doesn't currently have a `.claude/rules/` directory. Future
    readers might hunt for a path that doesn't exist locally.

    Fix: brief inline note clarifying that `.claude/rules/` IS
    canonical Anthropic per code.claude.com/docs/en/memory but
    Zeta uses `.claude/skills/`, `.claude/agents/`,
    `.claude/commands/`. Adopting `.claude/rules/` is a viable
    future addition. Per maintainer framing 2026-05-01: "we can
    do whatever here to get it right IDK the right answer it's
    probably play around a bit" — keeping the clarification
    open-ended rather than locking in a position.

(3) Maintainer framing 2026-05-01: "it could just remind to
    you use the router as lookup of existing substrate, quick
    inventory via router."

    Add new ground-rule bullet: skill router as substrate
    inventory before authoring. Before writing a new memory
    file / rule / skill / agent / doctrine bullet, search the
    available-skills list AND `.claude/{skills,agents,commands,rules}/`
    on disk for substrate on the same topic. The router's
    description-keyed search IS Zeta's structured-substrate
    index; using it as inventory before authoring prevents the
    goldfish-ontology failure mode (recreating substrate that
    already exists).

    This bullet IS the wake-time encoding of the discipline so
    fresh sessions inherit it without primed prompting — per
    the buddy-test design constraint also from this maintainer
    input cluster: "you can't tell him in his prompt to use the
    skills as a prompt you have to give him a task that should
    trigger him to use an existing skill without telling him
    specifically and the claude.md should be sufficient for
    him to figure out skill router as substrate inventory."

The new bullet's pointers verified to be either landing in
this same PR or already on main:
- feedback_learnings_must_land_*: this PR (#1160) adds it
- feedback_otto_buddy_spin_up_*: already on main

(Removed the loading-taxonomy reference since that memory file
is on PR #1161's branch, not yet on main — same dangling-pointer
discipline applied to the new bullet.)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
AceHack added a commit that referenced this pull request May 1, 2026
… failure mode named (#1160)

* claude.md(meta-rule): wake-time substrate or it didn't land — biggest failure mode named (the human maintainer 2026-05-01)

The human maintainer 2026-05-01 verbatim:

> i think you biggest failure mode is not updated claude.md
> or pointers in that file, if you learn something claude.md
> or a pointer from that file like the .claude/rules or some
> other pointers, you didn't learn it

Two landings in one commit:

1. **New CLAUDE.md ground-rule bullet** for the meta-rule
   itself — load-bearing learnings must land as: (a) CLAUDE.md
   bullet, (b) memory file + CLAUDE.md pointer, or (c)
   transitively via AGENTS.md/BP-NN/skill/agent. Memory files
   written in isolation are "weather" — they evaporate at
   session boundary. CLAUDE.md is loaded at every wake; files
   referenced from it are one read away; everything else is
   read-on-demand and effectively invisible.

   The bullet establishes a tick-close ritual: enumerate what
   was learned; classify landing per item; orphan items become
   next-tick speculative-work targets.

   Self-encoding test: this rule's own landing IS the CLAUDE.md
   bullet pointing at the memory file, recursively satisfying
   itself.

2. **Adds the missing SQLSharp-pattern pointer** — PR #1155
   landed the SQLSharp bun/ts external-anchor memory file
   without a CLAUDE.md pointer. That file was a textbook
   example of the failure mode this rule names: a learning
   that didn't actually land at wake-time scope. New CLAUDE.md
   bullet for the SQLSharp pattern fixes the orphan and
   pre-applies the meta-rule's discipline.

Adjacent companion landings (memory file + MEMORY.md row added
per memory-index-integrity rule).

Audit retrospective on the 2026-05-01 session named in the
memory file: SQLSharp pattern (orphaned — fixed here),
test.each-over-fixtures pattern (no substrate — speculative
target), cherry-pick-when-squash-merged pattern (chat-only —
speculative target), MEMORY.md duplicate-link audit lint
existence (chat-only — speculative target). Each gap is
filable as next-tick speculative work.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* fix(claude.md): remove dangling SQLSharp pointer + add skill-router-as-substrate-inventory bullet (review fixes + maintainer framing)

Three fixes on PR #1160:

(1) Codex P2 + Copilot P0 (duplicate findings): the SQLSharp DI
    pattern bullet pointed at memory/feedback_ts_dependencies_as_interface_di_pattern_sqlsharp_anchor_aaron_2026_05_01.md,
    which lives on PR #1155's branch (not yet merged to main).
    The CLAUDE.md pointer would dangle when #1160 lands.

    Fix: remove the SQLSharp bullet entirely from #1160. It can
    re-land as a follow-up PR after #1155 merges and the memory
    file is on main. Cleaner sequencing — each PR's pointer
    targets must exist on main at merge time.

(2) Copilot: the meta-rule bullet quotes the human maintainer's
    verbatim message including ".claude/rules" — but Zeta
    doesn't currently have a `.claude/rules/` directory. Future
    readers might hunt for a path that doesn't exist locally.

    Fix: brief inline note clarifying that `.claude/rules/` IS
    canonical Anthropic per code.claude.com/docs/en/memory but
    Zeta uses `.claude/skills/`, `.claude/agents/`,
    `.claude/commands/`. Adopting `.claude/rules/` is a viable
    future addition. Per maintainer framing 2026-05-01: "we can
    do whatever here to get it right IDK the right answer it's
    probably play around a bit" — keeping the clarification
    open-ended rather than locking in a position.

(3) Maintainer framing 2026-05-01: "it could just remind to
    you use the router as lookup of existing substrate, quick
    inventory via router."

    Add new ground-rule bullet: skill router as substrate
    inventory before authoring. Before writing a new memory
    file / rule / skill / agent / doctrine bullet, search the
    available-skills list AND `.claude/{skills,agents,commands,rules}/`
    on disk for substrate on the same topic. The router's
    description-keyed search IS Zeta's structured-substrate
    index; using it as inventory before authoring prevents the
    goldfish-ontology failure mode (recreating substrate that
    already exists).

    This bullet IS the wake-time encoding of the discipline so
    fresh sessions inherit it without primed prompting — per
    the buddy-test design constraint also from this maintainer
    input cluster: "you can't tell him in his prompt to use the
    skills as a prompt you have to give him a task that should
    trigger him to use an existing skill without telling him
    specifically and the claude.md should be sufficient for
    him to figure out skill router as substrate inventory."

The new bullet's pointers verified to be either landing in
this same PR or already on main:
- feedback_learnings_must_land_*: this PR (#1160) adds it
- feedback_otto_buddy_spin_up_*: already on main

(Removed the loading-taxonomy reference since that memory file
is on PR #1161's branch, not yet on main — same dangling-pointer
discipline applied to the new bullet.)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
AceHack added a commit that referenced this pull request May 1, 2026
…th (Codex P1, Copilot P0)

Two findings on PR #1155:

(1) Codex P1 + Copilot P0 (duplicate finding): MEMORY.md had
    two rows for the dynamic-bash memory file (line 12 older
    form + line 14 extended form with worked-example footer).
    The duplicate was a cherry-pick artifact: my SQLSharp-row
    cherry-pick onto fresh main applied the row-add cleanly
    but git's 3-way merge also re-added the dynamic-bash row
    in its updated form rather than editing the original. The
    audit lint (tools/hygiene/audit-memory-index-duplicates.sh)
    enforces "one row per memory file" — Codex/Copilot caught
    the violation.

    Fix: remove the older (shorter) duplicate row. Keep the
    newer row with the worked-example footer pointing at
    poll-pr-gate*.ts. Memory index now satisfies the
    one-row-per-file invariant.

(2) Copilot: caused_by referenced absolute filesystem path
    /Users/acehack/Documents/src/repos/SQLSharp/... — host-
    specific, not reproducible for other readers. Fix:
    replace with sibling-repo-relative `../SQLSharp/...` and
    note the absolute-path rationale inline.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 1, 2026 21:20
@AceHack AceHack force-pushed the otto/sqlsharp-bun-ts-pattern-anchor-2026-05-01 branch from cea6017 to cc0c6bd Compare May 1, 2026 21:20
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

AceHack added a commit that referenced this pull request May 1, 2026
…e-overlap axis (Otto 2026-05-01, 2x-confirmed) (#1166)

When a PR branch goes DIRTY because main moved, the discriminating signal between traditional rebase and cherry-pick-supersede is line-region overlap (not file overlap alone).

Worked examples this session: PR #1161 unmergeable on CLAUDE.md (intermediate merges in same region) → superseded via #1164 from fresh main; same tick PR #1155 clean rebase (no line overlap). Cherry-pick-supersede saves 10-30 minutes vs fighting cumulative conflicts.

Memory file documents protocol, decision rule, two worked examples, and what NOT to do (bulk-copy old state regresses intermediate merges).

Per the meta-rule (PR #1160), this is a load-bearing learning that needs CLAUDE.md scope or pointer. Memory file + MEMORY.md row landing pair-edit; CLAUDE.md pointer can be added in follow-up if rule proves to fire on more cases (currently 2x; promotion threshold tracked).

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
AceHack and others added 2 commits May 1, 2026 17:36
…un/ts DI pattern (Aaron 2026-05-01)

Aaron 2026-05-01 four-message clarification stack pointed at
`../SQLSharp` as the bun/ts best-practices anchor — distinct
from DST anchor (a different repo carries that), this is the
"super strongly typed" pattern Otto should write toward. The
discriminating axis is "not js-in-ts failure mode" — TS that
carries design invariants in compiler-checked types vs TS that
is JS with .ts extension and any escapes.

Pattern (from `../SQLSharp/tools/automation/format/format-repo.ts`):

1. `Dependencies` interface for every external call surface
   (typeof X-keyed against production import).
2. `defaultDependencies` const wires production deps once.
3. Top-level functions take (args, options, deps?) triple.
4. Tests pass synthetic deps — no monkeypatching, no mock
   frameworks, just structural DI compiler-checked.
5. No any. No implicit any. Discriminated unions.
   readonly array params. Exhaustive type checks.

Memory file documents: pattern definition + how-to-apply +
worked-example gap analysis on poll-pr-gate-batch.ts (which
landed PR #1153 with only `pollFn` injectable; full pattern
would extract `spawnSync`, `process.exit`, `process.stdout`,
`new Date()` to a BatchPollDependencies interface). Follow-up
refactor target tracked.

Composes with:
- prefer-TS-over-bash (this rule names the target shape)
- DST-grade-A pull-to-sibling-repo (SQLSharp IS one of the
  high-credibility instances of that rule)
- detect-changes/parallel-optimization sibling-repo anchor
  (different anchor, different domain, same discipline)
- post-install-TS strategy (TS is the target language; this
  rule names what good TS looks like)

Carved sentence candidate: "Super-strongly-typed TS, not
js-in-ts. Every external call surface in an interface. Every
function takes its dependencies. The default const wires
production; the test constructs the synthetic. The pattern
IS the DST achievability vehicle."

Pair-edit: MEMORY.md row added per memory-index-integrity rule.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…th (Codex P1, Copilot P0)

Two findings on PR #1155:

(1) Codex P1 + Copilot P0 (duplicate finding): MEMORY.md had
    two rows for the dynamic-bash memory file (line 12 older
    form + line 14 extended form with worked-example footer).
    The duplicate was a cherry-pick artifact: my SQLSharp-row
    cherry-pick onto fresh main applied the row-add cleanly
    but git's 3-way merge also re-added the dynamic-bash row
    in its updated form rather than editing the original. The
    audit lint (tools/hygiene/audit-memory-index-duplicates.sh)
    enforces "one row per memory file" — Codex/Copilot caught
    the violation.

    Fix: remove the older (shorter) duplicate row. Keep the
    newer row with the worked-example footer pointing at
    poll-pr-gate*.ts. Memory index now satisfies the
    one-row-per-file invariant.

(2) Copilot: caused_by referenced absolute filesystem path
    /Users/acehack/Documents/src/repos/SQLSharp/... — host-
    specific, not reproducible for other readers. Fix:
    replace with sibling-repo-relative `../SQLSharp/...` and
    note the absolute-path rationale inline.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
AceHack added a commit that referenced this pull request May 1, 2026
… clean-rebase contrast (PRs #1164/#1161/#1155) (#1165)

Two rebase outcomes this tick:
- #1164 supersedes #1161 via cherry-pick-from-fresh-main (cumulative conflicts)
- #1155 cleanly rebased on main (no overlapping merges in edit regions)

The discriminating axis: do main's intermediate merges touch the same lines your branch edits? Yes → cherry-pick supersede. No → rebase.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
…ded line numbers + reconcile identifier naming (3 Copilot threads)

Three Copilot review threads on PR #1155:

(1) 'bun run validate:typescript' doesn't exist in this repo's package.json. Replace with the actual scripts (bun run lint:typescript / typecheck / test:typescript). Add note: 'Check package.json for canonical names; don't trust generic command names.'

(2) Hard-coded external line numbers ('formatRepo.ts line 14-26') drift as the external repo evolves. Replace with directional reference ('the FormatRepoDependencies interface near the top of the file') + pointer to verify via 'git -C ../SQLSharp log'.

(3) Identifier inconsistency between formatRepo.ts (body) and format-repo.ts (frontmatter), and between defaultFormatRepoDependencies and formatRepoDependencies. Reconcile to format-repo.ts throughout + clarify the const is named defaultFormatRepoDependencies in the canonical file (using schematic 'default*Dependencies' for the rule itself).

Pattern: hard-coded references to external repo state drift; use directional language + verification pointers instead.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@AceHack AceHack force-pushed the otto/sqlsharp-bun-ts-pattern-anchor-2026-05-01 branch from cc0c6bd to 3fd6bf3 Compare May 1, 2026 21:37
@AceHack AceHack merged commit bab8c90 into main May 1, 2026
23 checks passed
@AceHack AceHack deleted the otto/sqlsharp-bun-ts-pattern-anchor-2026-05-01 branch May 1, 2026 21:40
AceHack added a commit that referenced this pull request May 1, 2026
…t (Claude.ai 2026-05-01)

Claude.ai's calibrated follow-up to the refresh-before-decide packet identified Otto's narrow-refresh failure mode empirically:

- 5:32pm refresh: 4 PRs
- 5:37pm refresh: same 4 PRs
- 5:40pm-5:50pm refresh: 2-3 PRs across 6 consecutive ticks
- 5:50pm: PR #1170 'appeared out of nowhere' because prior 4 ticks' refresh scope didn't include it

The narrow-refresh pattern hides cross-cutting state changes — PRs from other harnesses, auto-merge cascades, backlog deltas, claim file inventory, recent merges, branch state, pending CI runs.

`poll-pr-gate-batch.ts` is correctly-scoped per its design (per-PR detail). The gap is the cross-cutting view.

This row specs `tools/refresh-github-worldview/refresh.ts` — supersets poll-pr-gate-batch (calls it internally for per-PR detail), adds 5+ cross-cutting queries, two-layer print discipline, DST-grade-A test coverage with fixtures.

Composes with refresh-before-decide memo (PR #1171), poll-pr-gate-batch (PR #1153), SQLSharp DI pattern memo (PR #1155).

Phase 2+ deferred (Mirror/Beacon ratio gate, 22 named failure modes, DST scenario suite, pre-DORA metrics, dual-PM mode-selection) — each is its own future row.

Per Claude.ai's caution: this row is the filing-not-implementation step. Don't context-switch mid-PR-cycle; let it flow through standard claim protocol when queue is quiet.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
AceHack added a commit that referenced this pull request May 1, 2026
…t (Claude.ai 2026-05-01) (#1173)

* backlog(B-0159): refresh-github-worldview cross-cutting refresh script (Claude.ai 2026-05-01)

Claude.ai's calibrated follow-up to the refresh-before-decide packet identified Otto's narrow-refresh failure mode empirically:

- 5:32pm refresh: 4 PRs
- 5:37pm refresh: same 4 PRs
- 5:40pm-5:50pm refresh: 2-3 PRs across 6 consecutive ticks
- 5:50pm: PR #1170 'appeared out of nowhere' because prior 4 ticks' refresh scope didn't include it

The narrow-refresh pattern hides cross-cutting state changes — PRs from other harnesses, auto-merge cascades, backlog deltas, claim file inventory, recent merges, branch state, pending CI runs.

`poll-pr-gate-batch.ts` is correctly-scoped per its design (per-PR detail). The gap is the cross-cutting view.

This row specs `tools/refresh-github-worldview/refresh.ts` — supersets poll-pr-gate-batch (calls it internally for per-PR detail), adds 5+ cross-cutting queries, two-layer print discipline, DST-grade-A test coverage with fixtures.

Composes with refresh-before-decide memo (PR #1171), poll-pr-gate-batch (PR #1153), SQLSharp DI pattern memo (PR #1155).

Phase 2+ deferred (Mirror/Beacon ratio gate, 22 named failure modes, DST scenario suite, pre-DORA metrics, dual-PM mode-selection) — each is its own future row.

Per Claude.ai's caution: this row is the filing-not-implementation step. Don't context-switch mid-PR-cycle; let it flow through standard claim protocol when queue is quiet.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* fix(B-0159): Deepseek refinements — delta-diff, provenance, stale_assumptions, perf target, tiered fallback (2026-05-01)

Deepseek follow-up review identified 7 critical refinements:

(1) Delta-diff over current-state-dump — Otto's deeper failure isn't refresh-not-run, it's refresh-not-integrated. Saw 27 open PRs at 5:37pm, noted count, moved on. Snapshot persistence at .zeta/refresh-snapshot.json enables actual deltas.

(2) Provenance per PR — self / peer-call / maintainer / unknown. Computed mechanically from author. Unknowns are highest-priority signal.

(3) stale_assumptions field — most operationally valuable. Refresh reports surprises, not just state. 'PR #X expected to merge by now, why hasn't it?'

(4) Single JSON with summary field — match Otto's existing pattern (poll-pr-gate-batch.ts produces both layers in one output). Maintainer reads same JSON Claude reads; mismatch debuggable at boundary.

(5) Performance target <5s typical tick + tiered fallback (degrade to poll-pr-gate-batch + 'stale at <timestamp>' if exceeded). Prevents bottleneck.

(6) Backlog-row delta as git-derived (git diff --name-only HEAD~1 HEAD -- docs/backlog/), not frontmatter timestamps. Avoids B-0098-class metadata drift.

(7) Recent merges via git log + post-hoc author bucketing. Unknown-author = highest priority.

Plus refresh frequency recommendations + composing with poll-the-gate / manufactured-patience / never-idle / pre-commit lint for refresh artifacts.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* fix(B-0159): add required YAML frontmatter (Codex P1 + Copilot dup)

Codex P1 + Copilot duplicate finding on PR #1173: backlog rows require frontmatter (id, priority, status, title, created, last_updated) per tools/backlog/README.md schema. The .github/workflows/backlog-index-integrity.yml gate blocks PRs touching docs/backlog/** without it.

Fix: add YAML frontmatter matching the canonical shape used by sibling P1 rows (B-0156 style). Includes depends_on: [B-0156] since the unified refresh script is part of the broader TS-standardization trajectory.

Two additional Copilot dangling-pointer findings on the same PR:
- docs/research/2026-05-01-claudeai-backlog-driven-dual-pm-loop-with-refresh-discipline.md
- memory/feedback_refresh_before_decide_invariant_two_layer_print_dx_claudeai_2026_05_01.md

Both were dangling at PR-open time because they were on PR #1171 which had not merged. PR #1171 has now merged to main; rebasing this branch resolves both. The branch is now up-to-date with origin/main and the cross-references resolve.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* substrate(B-0159): peer-AI absorption + git-native/github-state two-layer split (Aaron + 4 peer reviewers 2026-05-01)

Two artifacts:

(1) docs/research/2026-05-01-peer-ai-followup-reviews-on-b-0159-refresh-script.md — verbatim preservation of 4 peer-AI reviews (Ani / Alexa / Gemini / Amara) per substrate-or-it-didn't-happen + GOVERNANCE §33 trigger (multi-AI review packet preserve verbatim FIRST). Includes carved blades, cross-peer convergence (4/4 agree on aggregator-not-replacement + two-layer output + don't-context-switch + compose-with-existing-disciplines), and divergence preserved as alternatives (tool naming, snapshot persistence path).

(2) B-0159 backlog row updated with two architectural decisions:

   ARCHITECTURE — TWO-LAYER GIT-NATIVE + GITHUB-API SPLIT (Aaron 2026-05-01 calibration of Amara's repo-state rename):
   - Layer 1: tools/repo-state/repo-state.ts — git-native, portable across hosts. Pure git ops + filesystem (backlog, claims, branch state, dirty flag).
   - Layer 2: tools/github/github-state.ts — wraps repo-state + poll-pr-gate-batch + adds GitHub API (PRs, CI, threads, reviews, workflows). GitHub-native.
   - Composes with feedback_git_native_vs_github_native_plural_host_pluggable_adapters_2026_04_23.md and feedback_first_class_for_us_not_for_our_host_*.

   PEER-AI CONSOLIDATED REQUIREMENTS:
   - Ani: idempotency + fail-closed (exit 10 on dirty/rebase), --raw flag, noise filter
   - Alexa: success criteria per phase, staleness detection, rollback procedures, cross-harness coordination, performance benchmarking
   - Gemini: macro/micro framing, strict sequence (don't context switch)
   - Amara: aggregator-not-replacement, flow metrics, unknown/unavailable per-source states, modular collectN() functions, persisted snapshot at .state/<layer>/last.json, --since/--write-state flags

Aaron's calibration in same packet on time-estimation: 'you can't tell time without something like the previous state files you get how long thing took wrong all the time.' My 'X minutes' estimates throughout session are unanchored. Same persisted-snapshot mechanism that enables deltas would also anchor real durations. Filing as separate substrate target for next tick (time-estimation requires external timestamps, not internal feel).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* fix(B-0159): --since placement + output-contract reconciliation (Codex P2 + Copilot P1)

Two real findings on PR #1173:

1. Codex P2: `git log --since="..."` after `--` pathspec doesn't filter
   per git-log man page (options must precede pathspecs). Reordered
   to `git log --oneline --diff-filter=A --since="<ts>" -- docs/backlog/`.

2. Codex P2 + Copilot P1 (dup): output-format contradiction —
   row described two separate stdout passes (raw-then-interpretation)
   AND single JSON with `summary` field. Reconciled per Deepseek's
   single-JSON design: `summary` object IS the interpretation layer
   alongside raw arrays in one JSON document, one invocation.
   Mismatch between summary and underlying arrays is the bug class.
   Supersedes the two-pass framing earlier in the row.

Two earlier dangling-pointer Copilot threads on this PR are now
satisfied by main since #1171 landed
(docs/research/2026-05-01-claudeai-backlog-driven-dual-pm-loop-with-refresh-discipline.md
+ memory/feedback_refresh_before_decide_invariant_two_layer_print_dx_claudeai_2026_05_01.md
both exist on main).

---------

Co-authored-by: Claude Opus 4.7 <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.

2 participants