Repository navigation
feat(server): expose skill policy and knowledge review over HTTP - #106
Merged
Merged
Conversation
Add the session-server routes for the Skill-management surface introduced in #99, so a client other than the TUI can read and act on it: - `POST /sessions/<id>/skill-policy` sets one Session's Skill dispositions. - `GET /skills/proposals` lists Skill/Memory drafts awaiting human review. - `POST /skills/proposals/<id>/review` approves or rejects one draft. Every route is capability-optional: a runtime that does not expose the method answers 404 with the same wording the existing write surface uses. Review fixes on top of the first revision: - Clamp `limit` to the draft store's own 200 cap, and pin the proposals route to its two path shapes so a stray `/skills/<other>` keeps falling through to the plain 404 tail whatever the runtime exposes. - Translate the knowledge-proposal domain errors at the boundary: a proposal that is gone answers 404 and an already-reviewed one 409, instead of the bare 500 a client cannot tell from a server fault. - Make the skill-policy fake merge across calls and record what the runtime receives, so the suite pins forwarding (kind/limit, `null`-clearing) instead of echoing the request back; declare the third route in the minimal-runtime 404 case. - Document the review response shape and the limit cap in docs/harness-integration.md, and point docs/tui-capabilities.md at the HTTP surface. Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: hermes-agent <hermes-agent@users.noreply.github.com>
4 tasks done
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.
Change
#99 is merged. This PR adds the session-server HTTP surface so Android and other HTTP clients can drive that skill workflow:
POST /sessions/:id/skill-policy— mandatory / optional / forbidden dispositions and closed catalogGET /skills/proposals— list Skill/Memory drafts awaiting review. Query:status,kind,sessionId,limit(default 50, clamped to the store's 200 cap)POST /skills/proposals/:id/review— approve / reject (optionaleditedDraft,reviewNote). Reviewing an unknown proposal answers404and an already-reviewed one409, so a client can tell a lost retry from a broken serverAlso wires those methods onto
TuiServerRuntime, documents them indocs/harness-integration.mdanddocs/tui-capabilities.md, and extends theserver-httpunit tests.Supersedes #104: its head branch was renamed
cursor/skill-http-after-99-9cd5→feat/server-skill-reviewto matchAGENTS.md, and GitHub closes a pull request whose head branch is renamed (docs; only base branches are repointed), so the old PR could not follow the rename. Same single commitec67eed, same body — the review thread, the review follow-up comment and the gate results stay on #104, which itself replaced draft #102 (its branch still carried pre-merge #99 history).Review fixes carried in this commit, each with a test: the proposals route is pinned to its two path shapes,
limitis clamped to 200, and the knowledge-proposal domain errors map to404/409instead of a bare500.Validation
pnpm verifyatec67eed— 15 gates passed (linux aarch64, Node 26.5.1, pnpm 9.12.0); skippedtest:windowsandtest:sandboxas not applicable on this platform, andtest:release-packageas it needs an npm release archive.packages/tui/test/unit/server-http.test.ts(24 tests) is declared intest/vitest-suites.jsonundercapability.http.ts(500instead of404/409;limit=100000forwarded unclamped), so they pin the fix rather than the fixture.perf:fulllabel — nothing here touches the paths the performance rules cover.Publication and contribution checks
release/public-source.json; new tests are declared intest/vitest-suites.jsonwhere applicable. (No source file added or removed: the change edits five existing paths, so the inventory is unchanged andcheck:source/check:tsconfigare unaffected.)docs/harness-integration.md, anddocs/tui-capabilities.mdnow points its capability record at the server surface. No localized product string changed, so nocopy.zh-Hansentry applies. Mock/offline results are not described as live-service acceptance.Maintainer handoff
Publication scope or license changes (if any): none.
Shared-source port: not needed.