-
Notifications
You must be signed in to change notification settings - Fork 0
drive: cloud run ecf55208 #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,49 +1,44 @@ | ||
| # NEXT — Gate 3: Build the work package consumer | ||
| # NEXT — Gate 3: Harden backlog picker against malformed entries | ||
|
|
||
| **Scope:** Gate 3 — close the Garden's loop. CODE task, SDK-side. The picker EMITS a work package (sdk/src/backlog-picker.ts + testdata/backlog-picker.flow.yaml, merged, four tested properties) and NOTHING consumes it — that is the missing half. Build the consumer: an SDK entrypoint taking an emitted package and turning it into something runnable, validating it has a title, a non-empty scope and a definition of done, and REFUSING with a typed reason when it does not, because a package that cannot be verified must not become work. NOTE: two previous attempts (ee5c9b3e, 06c0d6ab) did this correctly and their files were LOST before delivery by a platform fault — the build sandbox's .git points at a directory that does not exist, so writes cannot be captured. You are not duplicating live work. | ||
| **Pinned to gate 3** per ops/TARGET.md. | ||
|
|
||
| ## Objective | ||
|
|
||
| Build the SDK entrypoint that takes an emitted work package and turns it into something runnable. The consumer must validate that the package has: | ||
| - A title (non-empty string) | ||
| - A non-empty scope | ||
| - A definition of done | ||
| The picker reads ops/BACKLOG.md and selects the first bold top-level bullet. Currently it handles well-formed entries but a malformed entry — a bold title with no body, an unterminated backtick, a bullet nested under another — can crash or produce a half-formed package. Add handling so malformed entries produce typed refusals, never crashes and never half-formed packages. | ||
|
|
||
| When any of these is missing or invalid, the consumer REFUSES with a typed reason. A package that cannot be verified must not become work. | ||
| ## Scope from ops/TARGET.md | ||
|
|
||
| > The picker reads whatever ops/BACKLOG.md contains. A malformed entry — a | ||
| > bold title with no body, an unterminated backtick, a bullet nested under | ||
| > another — should produce a typed refusal, never a crash and never a | ||
| > half-formed package. Add the handling and the tests. | ||
|
|
||
| Note: The consumer's file existence check (option b) is ALREADY implemented in sdk/src/work-package-consumer.ts:52-55 with the 'nonexistent_files' refusal reason. This work package implements option (a). | ||
|
|
||
| ## Files in scope | ||
|
|
||
| - `sdk/src/` (new consumer code) | ||
| - `sdk/tests/` (new consumer tests) | ||
| - NO changes to `kernel/` (PR #19 is open) | ||
| - NO changes to `sdk/src/demo-hn-monitor.ts` (PR #19 is open) | ||
| - sdk/src/backlog-picker.ts — add validation and typed refusal reasons | ||
| - sdk/tests/backlog-picker-flow.test.ts — tests for malformed entry handling | ||
| - sdk/src/index.ts — export new refusal types if needed | ||
|
|
||
| ## Definition of done | ||
|
|
||
| 1. **SDK code exists** that consumes an emitted work package | ||
| 2. **Validation tests exist** for: | ||
| - Missing title → typed refusal | ||
| - Empty title → typed refusal | ||
| - Missing scope → typed refusal | ||
| - Empty scope → typed refusal | ||
| - Missing definition of done → typed refusal | ||
| - Empty definition of done → typed refusal | ||
| - Valid package → accepted | ||
| 3. **Every new test is confirmed to FAIL against current code** with literal output pasted | ||
| 4. **SDK test suite passes:** | ||
| 1. Code added to sdk/src/backlog-picker.ts that validates entries and returns typed refusal reasons | ||
| 2. Tests covering malformed cases: bold title with no body, unterminated backtick, nested bullet | ||
| 3. Tests covering existing behavior still passing | ||
| 4. Command passes: | ||
| ``` | ||
| cd sdk && npm test | ||
| cd /project/workflows/runs/fec0723e-4bcb-4512-a599-fc61e110dfa6/sdk && npm test | ||
| ``` | ||
| Paste the literal output showing all tests pass, 0 failed | ||
| 5. **Final verification** — as the LAST action, run: | ||
| 5. EVERY new test confirmed to FAIL against current code with literal failing output quoted in summary | ||
| 6. As LAST action, run and paste output: | ||
| ``` | ||
| git status --porcelain | ||
| ``` | ||
| And paste the output to make lost writes visible immediately | ||
|
|
||
| ## Out of scope | ||
| ## Explicitly OUT of scope | ||
|
|
||
| - Kernel changes (different PR) | ||
| - Integration with hn-monitor (different PR) | ||
| - Any changes to the backlog picker itself (already merged in PRs #20, #21, #22) | ||
| - Changes to flow execution or scheduling | ||
| - kernel/ changes | ||
| - sdk/src/demo-hn-monitor.ts | ||
| - anything under ops/ | ||
| - the consumer's file existence check (already implemented in work-package-consumer.ts:52-55) |
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
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The checked
testdata/backlog-picker.flow.yamland its canonical spec still run the old inline regex and never call this validator. Consequently, the real gate-3 flow accepts a title with no body or an unmatched backtick and emits a half-formed package, while a nested bullet merely exits with an untyped status; only the unit tests that call this new helper directly see the typed refusals. Wire the validation into the flow commands and regenerate the canonical spec so the deterministic behavior being tested is the behavior that runs.AGENTS.md reference: AGENTS.md:L19-L21
Useful? React with 👍 / 👎.