first commit
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
## 1. Platform AI Invocation Contracts
|
||||
|
||||
- [x] 1.1 Add domain and DTO contracts for AI invocation requests, context refs, purposes, recommendations, usage metadata, and safe errors.
|
||||
- [x] 1.2 Add validators for purpose authorization, provider IDs, model preferences, bounded input/output, context refs, and unsafe credential/path/socket content.
|
||||
- [x] 1.3 Add a platform provider client interface and deterministic mock provider implementation for tests/local verification.
|
||||
|
||||
## 2. Platform AI Invocation Service And API
|
||||
|
||||
- [x] 2.1 Add service methods that authorize purpose-scoped invocation, select enabled providers, call the provider client, redact outputs, and return typed responses.
|
||||
- [x] 2.2 Implement AI invocation route using named DTOs and service methods.
|
||||
- [x] 2.3 Ensure config-related AI responses produce reviewable recommendations/diffs and never dispatch run-side writes directly.
|
||||
- [x] 2.4 Update platform route/protocol documentation for mediated AI invocation and live-provider deferral.
|
||||
- [x] 2.5 Add platform tests for allowed invocation, undeclared purpose denial, unsafe payload rejection, provider failure redaction, config recommendation reviewability, and no raw key exposure.
|
||||
|
||||
## 3. Frontend And Plugin Integration
|
||||
|
||||
- [x] 3.1 Add centralized `platform_web/api` AI invocation types and client methods.
|
||||
- [x] 3.2 Integrate AI invocation into plugin bridge host execution flow for `ai.invoke` responses.
|
||||
- [x] 3.3 Add plugin SDK/example helpers for AI invocation request builders and safe response parsing.
|
||||
- [x] 3.4 Add frontend and plugin tests for mediated AI requests, denied purposes, redacted results, and no direct provider config exposure.
|
||||
|
||||
## 4. Verification
|
||||
|
||||
- [x] 4.1 Run `cd platform && go test ./...` and record evidence.
|
||||
- [x] 4.2 Run `cd platform_web && npm run typecheck && npm test && npm run build` and record evidence.
|
||||
- [x] 4.3 Run `cd plugins && npm run typecheck && npm test` and record evidence.
|
||||
- [x] 4.4 Run browser walkthrough for mediated AI invocation and record evidence.
|
||||
- [x] 4.5 Run `scripts/check-structure.sh` and record evidence.
|
||||
- [x] 4.6 Run `openspec validate implement-platform-mediated-ai-invocation --strict` and record evidence.
|
||||
|
||||
## Evidence
|
||||
|
||||
- 2026-07-06: `cd platform && GOCACHE=/private/tmp/browser-go-build-cache go test ./... -run TestAIInvocationAPIIsMediatedAndSafe -count=1` passed for mediated invocation, purpose denial, unsafe prompt rejection, config suggestion reviewability/no job dispatch, bridge `ai.invoke`, and no forbidden response fragments.
|
||||
- 2026-07-06: `cd platform_web && npm run typecheck` and `cd platform_web && npm test -- --run api/client.test.ts utils/pluginBridgeHost.test.ts` passed for AI invocation API types/client and bridge `ai.invoke` dispatcher behavior.
|
||||
- 2026-07-06: `cd plugins && npm run typecheck` and `cd plugins && npm test -- --run tests/manifest-validation.test.ts` passed for SDK AI invocation request/response helpers and no provider config exposure.
|
||||
- 2026-07-06: `cd platform && GOCACHE=/private/tmp/browser-go-build-cache go test ./...` passed.
|
||||
- 2026-07-06: `cd platform_web && npm run typecheck`, `cd platform_web && npm test`, and `cd platform_web && npm run build` passed.
|
||||
- 2026-07-06: `cd plugins && npm run typecheck` and `cd plugins && npm test` passed.
|
||||
- 2026-07-06: Browser walkthrough passed using a local mock platform API plus headless Chrome: logged in, opened `#/servers/server-ai-walkthrough`, switched to `插件控制`, clicked `AI 调用`, verified `AI 建议已返回`, and confirmed no forbidden credential/path/provider fragments were rendered.
|
||||
- 2026-07-06: `scripts/check-structure.sh` passed.
|
||||
- 2026-07-06: `openspec validate implement-platform-mediated-ai-invocation --strict` passed (`Change 'implement-platform-mediated-ai-invocation' is valid`; PostHog DNS flush warnings were non-fatal telemetry failures).
|
||||
Reference in New Issue
Block a user