Repository navigation
feat(server): expose skill policy and knowledge review over HTTP - #104
tournierjc wants to merge 1 commit into
Conversation
Code Review SummaryVerdict: Comment — the final tree is clean: routes, validation, 404 capability degradation, docs, and tests all match the #99 port shapes and the kinetic-android #5 client. Findings below are mostly about the branch hygiene and a few test/contract gaps, not the code itself. 🔴 Critical (before merge)
|
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>
bfe9372 to
ec67eed
Compare
Review follow-up —
|
Final Review — after the fixes (squashed head
|
|
Closed because the head branch was renamed Continued in #106, from the renamed branch ( |
tournierjc
left a comment
There was a problem hiding this comment.
Final review: approved — all findings from the previous round verified fixed on squashed head ec67eed (see the detailed comment). Full CI suite green on this head (verify ubuntu+macos, changes, performance, source-history-artifact, verification). Clean to squash-merge.
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.Replaces dirty draft #102 (that branch still carried pre-merge #99 history). Pairs with kinetic-android #5.
Review follow-up on this PR: the transfer scaffolding is gone — the branch is a single commit and the diff against
mainis the five published files — and the three code/boundary findings are fixed with tests (route-shape pinning,limitclamp,404/409mapping).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.