feat(api): propose the v2 rule API migration and add the v2 client (0.12.0, stack 1/5) - #411
Open
thecodedrift wants to merge 3 commits into
Open
thecodedrift wants to merge 3 commits into
thecodedrift wants to merge 3 commits into
Conversation
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Stack (root → tip):
Bottom of a five-PR stack that moves the CLI to the Taskless v2 rule API (taskless/taskless#229) for 0.12.0. The stack merges down: each PR merges into the one below it, and this branch reaches
mainonce, carrying all of it.Why the stack merges down
The server's version floor treats a prerelease as the release it precedes, so any nightly stamped
0.12.0-*counts as a v2 client. If a partial slice reachedmain, the nightly would publish a CLI the server treats as v2 while it still calls v1 routes, which answer410once the floor is set. Measured: this branch stamps0.12.0-20260929033014x86799ef.What this PR contains
cli-v2-rule-api: proposal, design, tasks, and six spec deltas. Start withdesign.md; the decisions there drive every later slice.minorchangeset.checknow fails on an edited sg or vale rule, andrule create --jsonrenames a field consumers read. Apatchchangeset would also stamp nightlies0.11.3-*, below the v2 floor.api-v2.schema.json/api-v2.d.ts), fetched from/cli/api/v2/__schema. It sits beside the frozen v1 files so every PR in the stack typechecks; v1 is deleted at the tip.api/v2.ts: one typed client for all nine v2 operations. Every call sendsx-taskless-cli-versionand returns an outcome instead of throwing. Each operation's error codes are checked against the schema at compile time, so a schema refresh that adds a code fails typecheck until it's handled.api/refusal.ts: a plan refusal (restoreRules: false) is an answer to relay, not an outage. Control characters are stripped from the server'smessagebefore it reaches a terminal.parseEntitlementV2: withheld runtime rules keyed by rule id. A test pins the Fail check when the server withholds runtime rules (paid Taskless accounts only) #403 hazard: the v1 parser drops every v2 withheld entry.Nothing calls the new client yet. Behavior is unchanged until the next slice.
The stack
rule create/rule improveon v2, with signature-verified delivery.rule restoreandrule rollback.Size
Around 5,000 added lines. About 3,500 are the generated schema and types. The rest is mostly the OpenSpec artifacts (~1,600 lines), which describe every later slice. Splitting them off would leave reviewers judging a client with no spec, so they stay here, over the usual ~1,200-line guideline.
Checks
pnpm typecheck,pnpm lint(which rebuilds and runscli check), and the full suite (110 files, 1,837 tests) pass. The archive was dry-run on a scratch copy ofopenspec/: every scenario that disappears belongs to a requirement marked REMOVED.Refs TSKL-307