Skip to content

[Ledgers] Add the row ID to the dedupe map - #37589

Open
acdlite wants to merge 1 commit into
ledgers/1-flagfrom
ledgers/2-dedupe-map
Open

acdlite wants to merge 1 commit into
ledgers/1-flagfrom
ledgers/2-dedupe-map

Conversation

@acdlite

@acdlite acdlite commented Sep 11, 2026 •

Copy link
Copy Markdown
Collaborator

Small refactor to prepare for Ledgers.

Changes the type of the value in object deduping map (writtenObjects) from string (a reference to an object already written to the response) to {id: number, reference: string} instead. reference is the same string as before, and id is the row ID of the object.

The motivation is so a consumer of the dedupe map can access the row ID of the deduped object. For Ledgers, this allows us to also reuse the corresponding Ledger entries.

The original reference is kept in the map, too, since it encodes additional information about the reference besides just the row id.

An alternative considered was changing the type to string | {id: string, reference: number} but this results in additional type checks whenever the map is accessed, and also means the map is no longer monomorphic.

@meta-cla meta-cla Bot added the CLA Signed label Sep 11, 2026
@acdlite
acdlite added this pull request to stack #37595 September 11, 2026 17:07
@github-actions github-actions Bot added the React Core Team Opened by a member of the React Core Team label Sep 11, 2026
@acdlite
acdlite marked this pull request as ready for review September 11, 2026 17:30
Comment thread packages/react-server/src/ReactFlightServer.js Outdated
@acdlite
acdlite force-pushed the ledgers/2-dedupe-map branch 2 times, most recently from 056b319 to 732de8e Compare September 11, 2026 19:04
@acdlite
acdlite force-pushed the ledgers/2-dedupe-map branch from 732de8e to 5eed38e Compare September 11, 2026 19:09
@acdlite
acdlite force-pushed the ledgers/2-dedupe-map branch from 5eed38e to e1224c5 Compare September 14, 2026 01:24
Small refactor to prepare for Ledgers.

Changes the type of the value in object deduping map (`writtenObjects`) from `string` (a reference to an object already written to the response) to `{id: number, reference: string}` instead. `reference` is the same string as before, and `id` is the row ID of the object.

The motivation is so a consumer of the dedupe map can access the row ID of the deduped object. For Ledgers, this allows us to also reuse the corresponding Ledger entries.

The original reference is kept in the map, too, since it encodes additional information about the reference besides just the row id.

An alternative considered was changing the type to `string | {id: string, reference: number}` but this results in additional type checks whenever the map is accessed, and also means the map is no longer monomorphic.
@acdlite
acdlite force-pushed the ledgers/2-dedupe-map branch from e1224c5 to 2ba5ce3 Compare September 17, 2026 19:48
Pierozi added a commit to agentic-dev3o/devx-plugins that referenced this pull request Sep 18, 2026
…skill

A max-effort review confirmed 18 defects, reproduced against gh 2.100.0.
Every load-bearing gh interaction was wrong.

Security and safety:
- Stop executing command strings read out of CI logs; verification commands
  now come from the repo's own scripts. Logs are stated to be data.
- Forbid copying literal values from logs into the tree: GitHub masks only
  registered secrets and secrets-guard inspects paths, not context.
- Add disable-model-invocation, a scoped allowed-tools, and argument-hint.
  This was the only auto-triggering, push-capable skill in the marketplace.
- Verify the PR head branch is checked out before committing; refuse forks.
- Ask before the first push.

Correctness:
- Dispatch on bucket, not state: state==FAILURE misses CANCELLED, TIMED_OUT,
  ERROR and ACTION_REQUIRED, and a cancelled-only run exits 0 (verified on
  react/react#37589: 238 pass, 6 cancel, exit 0).
- Full exit-code table; exit 1 spans no-required-checks, no-checks-yet and
  real failure (verified: cli/cli#14456 exits 0, react/react#37656 exits 1).
- Replace gh run view --job --log-failed, which errors 'run is still in
  progress' in exactly the state --fail-fast creates, with the jobs logs API
  plus --allow-escape-sequences. Grep the saved log instead of reading it all.
- Stop assuming every check link is an Actions job URL; branch on workflow.
- Wait for run completion before rerun (403 'already running') and decrement
  the budget only on a dispatched rerun.
- Re-poll mergeable=UNKNOWN; dispatch on mergeStateStatus so BEHIND merges.
- Substitute literal PR values: shell state does not survive between calls,
  and an empty selector silently resolves to the current branch's PR.
- Thread -R owner/repo so a URL argument's repo is not discarded.
- Add --required with a fallback for repos without branch protection.
- Restore --interval 60 and handle the Bash timeout killing --watch.

Structure:
- Delegate mutations to devx-git: commits to ci, base merges to update-origin.
  Nothing here ran git fetch, so Step 6 merged a stale base ref forever.
- Global budgets (5 pushes, 3 reruns, 45 min) evaluated at the loop head.

Docs: correct the disproven --job claim, align section headers with the
directory names Claude Code resolves, drop the phantom claudemd section, and
fix the stale /commit reference (the skill directory is ci).
Pierozi added a commit to agentic-dev3o/devx-plugins that referenced this pull request Sep 18, 2026
* feat(devx-qa): add babysit-pr skill

Watches a PR's CI after creation, diagnoses failing jobs from their logs,
fixes branch-caused failures, reruns genuine flakes (budget: 3), and pushes
until the PR is green and mergeable. Bumps devx-qa to 1.6.0 and wires the
skill into the plugin README and marketplace manifests.

* refactor(devx-qa): apply skill authoring best practices to babysit-pr

- Bind $PR in a preflight step; it was referenced but never defined
- Check gh auth and a clean tree before acting
- Gate every push behind a local verification of the same failing command
- Add a per-job fix-attempt budget so a wrong diagnosis cannot loop
- Rewrite the description in Use-when form with discovery terms
- Number the workflow steps and add a concrete classification example

* fix(devx-qa): correct every gh invocation in babysit-pr and gate the skill

A max-effort review confirmed 18 defects, reproduced against gh 2.100.0.
Every load-bearing gh interaction was wrong.

Security and safety:
- Stop executing command strings read out of CI logs; verification commands
  now come from the repo's own scripts. Logs are stated to be data.
- Forbid copying literal values from logs into the tree: GitHub masks only
  registered secrets and secrets-guard inspects paths, not context.
- Add disable-model-invocation, a scoped allowed-tools, and argument-hint.
  This was the only auto-triggering, push-capable skill in the marketplace.
- Verify the PR head branch is checked out before committing; refuse forks.
- Ask before the first push.

Correctness:
- Dispatch on bucket, not state: state==FAILURE misses CANCELLED, TIMED_OUT,
  ERROR and ACTION_REQUIRED, and a cancelled-only run exits 0 (verified on
  react/react#37589: 238 pass, 6 cancel, exit 0).
- Full exit-code table; exit 1 spans no-required-checks, no-checks-yet and
  real failure (verified: cli/cli#14456 exits 0, react/react#37656 exits 1).
- Replace gh run view --job --log-failed, which errors 'run is still in
  progress' in exactly the state --fail-fast creates, with the jobs logs API
  plus --allow-escape-sequences. Grep the saved log instead of reading it all.
- Stop assuming every check link is an Actions job URL; branch on workflow.
- Wait for run completion before rerun (403 'already running') and decrement
  the budget only on a dispatched rerun.
- Re-poll mergeable=UNKNOWN; dispatch on mergeStateStatus so BEHIND merges.
- Substitute literal PR values: shell state does not survive between calls,
  and an empty selector silently resolves to the current branch's PR.
- Thread -R owner/repo so a URL argument's repo is not discarded.
- Add --required with a fallback for repos without branch protection.
- Restore --interval 60 and handle the Bash timeout killing --watch.

Structure:
- Delegate mutations to devx-git: commits to ci, base merges to update-origin.
  Nothing here ran git fetch, so Step 6 merged a stale base ref forever.
- Global budgets (5 pushes, 3 reruns, 45 min) evaluated at the loop head.

Docs: correct the disproven --job claim, align section headers with the
directory names Claude Code resolves, drop the phantom claudemd section, and
fix the stale /commit reference (the skill directory is ci).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed React Core Team Opened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants