Skip to content

drive: cloud run 1095ede6 - #26

Closed
khaliqgant wants to merge 1 commit into
mainfrom
cloud/run-1095ede6
Closed

drive: cloud run 1095ede6#26
khaliqgant wants to merge 1 commit into
mainfrom
cloud/run-1095ede6

Conversation

@khaliqgant

Copy link
Copy Markdown
Member

Automated drive work from cloud run 1095ede6-198b-4df0-8dc0-403d77dfaaf7.

The sandbox cannot open PRs (no remote, no GitHub token), so this was delivered
from a host that can. Verification and adversarial review ran in-run — see
ops/reviews/ in the diff. A human merges.

Work produced by cloud run 1095ede6-198b-4df0-8dc0-403d77dfaaf7 in a workflow sandbox and delivered from
this host, because a sandbox has no remote and no GitHub token.

Verification and adversarial review ran in-run; see ops/reviews/ in the diff.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 29, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-29T17:07:46.002153Z 3f2b9a6 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Aug 29, 2026

Copy link
Copy Markdown

Review Change Stack

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Free

Run ID: 42c61d9d-2fa9-4f7e-bdb4-7cd73da5f9fe

📥 Commits

Reviewing files that changed from the base of the PR and between 442adc4 and 3f2b9a6.

📒 Files selected for processing (4)
  • ops/NEXT.md
  • sdk/src/backlog-picker.ts
  • sdk/src/index.ts
  • sdk/tests/backlog-picker.test.ts

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The PR replaces the Gate 3 consumer brief with a work-package validator. It adds typed validation results, exports the validator through the SDK index, and tests accepted packages, missing requirements, empty fields, and empty backlogs.

Changes

Work-package validation

Layer / File(s) Summary
Gate 3 validator specification
ops/NEXT.md
The Gate 3 brief now specifies validator behavior, required tests, command output, status checks, and restricted file scope.
Validation contracts and implementation
sdk/src/backlog-picker.ts
The SDK adds validated work-package types and rejects invalid object shapes or empty title, files_in_scope, and definition_of_done values with typed reasons.
Public export and validation coverage
sdk/src/index.ts, sdk/tests/backlog-picker.test.ts
The SDK exports the validator API. Tests cover accepted packages, typed refusals, and empty-backlog handling.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 3f2b9

This PR makes a localized SDK and documentation change with no actionable merge-blocking risk remaining beyond normal checks and review.

Poem

A rabbit checks each package bright
With title, scope, and done in sight
Blank fields are turned away
Good work hops through the API
Tests guard the gate all day


Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/settings/billing.

Comment @coderabbitai help to get the list of available commands.

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

Copy link
Copy Markdown

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: 3f2b9a65a4

ℹ️ 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 sdk/src/backlog-picker.ts
}

/** Accept a complete emitted package, or name the first missing requirement. */
export function validateWorkPackage(input: unknown): WorkPackageValidation {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Reuse the existing work-package consumer

In this commit's parent, sdk/src/work-package-consumer.ts already defines and exports consumeWorkPackage with the same input checks, result union, refusal reasons, and accepted package shape. Adding validateWorkPackage creates a second public implementation of the same boundary, so callers can choose different APIs and future validation changes can silently diverge; remove this duplicate and use or re-export the existing consumer instead.

AGENTS.md reference: AGENTS.md:L22-L23

Useful? React with 👍 / 👎.

Comment thread ops/NEXT.md
5. Command that must pass:
```
cd sdk && npm test
cd /project/workflows/runs/06163551-8818-4d54-939f-5363183ca903/sdk && npm test

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep the required test command workspace-relative

When this work package is executed or replayed in any fresh sandbox, the hard-coded directory from run 06163551-... will not exist, so the command that the definition of done says must pass fails at cd without running the SDK tests. Use a repository-relative command such as cd sdk && npm test so verification works in the actual checkout regardless of the run-specific mount path.

Useful? React with 👍 / 👎.

@kjgbot

kjgbot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Lead review (flows-lead-1, sf-mini) — this PR duplicates work already on main. Recommend close, do not merge.

This PR's NEXT.md says "NOT on main: the consumer that judges a package. It exists in open PR #23 ... has not been merged." — that premise was false when this PR opened. #23 merged as fff005d at 16:46Z, 18 min before this PR opened at 17:04Z. The retarget commit 442adc4 landed at 16:51Z. Run 1095ede6 must have been in-flight against the stale brief.

Verified on origin/main:

sdk/src/work-package-consumer.ts:

export function consumeWorkPackage(input: unknown): WorkPackageConsumption {
  if (!isRecord(input) || !isNonEmptyString(input['title'])) {
    return { accepted: false, reason: 'missing_title' };
  }
  if (!isNonEmptyStringArray(input['files_in_scope'])) {
    return { accepted: false, reason: 'missing_scope' };
  }
  if (!isNonEmptyStringArray(input['definition_of_done'])) {
    return { accepted: false, reason: 'missing_definition_of_done' };
  }
  return { accepted: true, work: input as unknown as EmittedWorkPackage };
}

This PR's sdk/src/backlog-picker.ts additions have byte-equivalent logic under the name validateWorkPackage, with the same three helpers isRecord/isNonEmptyString/isNonEmptyStringArray and the same three refusal reasons. Same accepted-shape too.

Also on main, testdata/backlog-picker.flow.yaml's emit-package step already emits definition_of_done, so the picker→consumer contract is complete.

No merge value. Recommend close as duplicate.

@miyaontherelay

Copy link
Copy Markdown
Contributor

Lead review (flows-lead-2, finn-mini) — independently confirmed the duplicate finding above, and one thing it did not cover: this PR would ship two identically-behaving public validators from the same package entrypoint.

sdk/src/index.ts on this branch, diffed against origin/main:

+export {
+  validateWorkPackage,
+  type ValidatedWorkPackage,
+  type WorkPackageValidation,
+  type WorkPackageValidationReason,
+} from './backlog-picker.js';
+
 export {
   consumeWorkPackage,
   type EmittedWorkPackage,
   type WorkPackageConsumption,

So @relayflows/sdk would export validateWorkPackage and consumeWorkPackage side by side, with the same three refusal reasons, the same accepted shape, and the same three private helpers duplicated in both modules. A caller has no way to tell which one is the contract. That is worse than a redundant internal function — it is an ambiguous public API.

Verified literally:

$ git diff --stat origin/main...origin/cloud/run-1095ede6
 ops/NEXT.md                      | 81 +++++++++++++++++++++++++---------------
 sdk/src/backlog-picker.ts        | 43 +++++++++++++++++++++
 sdk/src/index.ts                 |  7 ++++
 sdk/tests/backlog-picker.test.ts | 65 ++++++++++++++++++++++++++++++++
 4 files changed, 166 insertions(+), 30 deletions(-)

The 65 added test lines test the duplicate, not anything main lacks. Recommendation unchanged and now stronger: close as duplicate, do not merge.

@khaliqgant khaliqgant closed this Aug 29, 2026
khaliqgant pushed a commit that referenced this pull request Aug 29, 2026
… package

Salvaged from run 1095ede6. That run's delivered PR (#26) carried this work
alongside reverts of ops/deliver-run.sh (-32), ops/BACKLOG.md (-30),
ops/STATE.md (-17) and ops/IMMUTABLE_PATHS (-9) — every guard fix and finding
recorded after it launched, undone by a stale base. The code was good and the
rest was not, so only the three SDK files are taken, onto current main.

The picker reads whatever ops/BACKLOG.md contains. A bold title with no body,
an unterminated backtick, a bullet nested under another: each now produces a
typed result rather than a crash or a half-formed package that reads as
actionable.

Verified: sdk 174 passed across 13 files, tsc --noEmit clean. The one
live-kernel failure on first run was a worktree lacking a built relayflowd, not
a regression — it passes after cargo build.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
khaliqgant added a commit that referenced this pull request Aug 29, 2026
* gate 3: handle a malformed backlog without crashing or half-forming a package

Salvaged from run 1095ede6. That run's delivered PR (#26) carried this work
alongside reverts of ops/deliver-run.sh (-32), ops/BACKLOG.md (-30),
ops/STATE.md (-17) and ops/IMMUTABLE_PATHS (-9) — every guard fix and finding
recorded after it launched, undone by a stale base. The code was good and the
rest was not, so only the three SDK files are taken, onto current main.

The picker reads whatever ops/BACKLOG.md contains. A bold title with no body,
an unterminated backtick, a bullet nested under another: each now produces a
typed result rather than a crash or a half-formed package that reads as
actionable.

Verified: sdk 174 passed across 13 files, tsc --noEmit clean. The one
live-kernel failure on first run was a worktree lacking a built relayflowd, not
a regression — it passes after cargo build.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix: wire validation into the backlog flow, so the guard actually guards (PR #30 P1)

Review was right: validateWorkPackage existed but no flow step called it, so a
malformed entry still exited 0 and handed a package nobody could act on to the
next step. The same class of failure as PR #28 — a guard that does not guard.

What changed:

- select-entry now scans for the first ACTIONABLE entry rather than the first
  bold one, validating each candidate and skipping the ones that fail. It exits
  nonzero with NO_ACTIONABLE_BACKLOG_ENTRY only when nothing in the backlog
  qualifies. Selection stays in select-entry: existing tests correctly pin that
  emit-package describes the entry select-entry chose, and my first attempt at
  this moved the scan into emit-package and broke that contract.
- emit-package validates before emitting, as a second line of defence.
- packageFromEntry moved into the SDK. Both steps need to build a package —
  select-entry to judge actionability, emit-package to emit — and inlining the
  regex in both is exactly the drift the canonical-spec test warns about.
- build-sdk step added: dist/ is gitignored, so the flow must build the SDK
  before it can call it.
- Steps resolve the SDK by walking up from cwd, with a RELAYFLOWS_SDK_DIST
  override. The flow tests run the real commands in a temp cwd, so a path
  relative to the repo root does not survive.
- Canonical spec regenerated. The kernel consumes that file, not the yaml.

Why hard-failing outright was wrong: the real ops/BACKLOG.md's first entry has
no backticked file path, so a plain refusal broke the actual drive loop on every
run. Skipping unactionable entries keeps rule 2 intact — the real workload runs
on it.

Proven, not asserted:
  malformed-only backlog -> NO_ACTIONABLE_BACKLOG_ENTRY scanned=1, exit 1
  real ops/BACKLOG.md     -> exit 0, emits a package, SKIPPED_UNACTIONABLE=10

Verified: sdk 179 passed (13 files), kernel 11 suites ok / 0 failed, tsc clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Relayflow Lead <lead@relayflows.local>
Co-authored-by: Claude Fable 5 <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.

3 participants