release(v0.4.0): purge learnship, migrate .planning→.ci, fix backends, add test coverage

- Remove all learnship references: Decision.learnship_equivalent field,
  agent persona prompts, opencode.json permissions, test fixtures
- Migrate verification layers from .planning/ to .ci/: structural
  checks .ci/ dir + ROADMAP.md, behavioral checks ROADMAP.md
- Fix ollama-local: remove sync require+curl blocking, use async
  fetchAvailableModels() in callModel
- Fix opencode.json: use __OPENCODE_DIR__ template tokens, remove
  legacy learnship permission entries
- Remove duplicate install script from package.json (keep postinstall)
- Fix quality any-regex false positives (target type annotations only)
- Add backends test coverage: backends.test.ts, tool-registry.test.ts
- Version bump 0.3.0 → 0.4.0
- Artifacts module: rename .planning→.ci internal paths
- Remove dead TODO_PATTERN/FIXME_PATTERN constants

---ci---
phase: 3
milestone: v0.4
status: complete
requirements:
  covered: [REQ-09, REQ-10, REQ-11, REQ-13, REQ-14, REQ-17]
  partial: []
decisions:
  - id: D-001
    decision: purge all learnship references from codebase
    rationale: project is CI-only, learnship is no longer a dependency
    confidence: 0.99
    category: scope
    alternatives: [keep for historical reference]
  - id: D-002
    decision: migrate verification from .planning/ to .ci/ paths
    rationale: .planning/ is removed schema, all current state lives in .ci/
    confidence: 0.95
    category: architecture
    alternatives: [keep dual-path support]
  - id: D-003
    decision: use __OPENCODE_DIR__ template tokens in opencode.json
    rationale: hardcoded ~ paths fail in containers and non-standard homes
    confidence: 0.90
    category: implementation_approach
    alternatives: [keep tilde expansion]
---/ci---
This commit is contained in:
CI
2026-05-29 16:18:30 +00:00
parent 7a20784c87
commit fb3f1df13e
32 changed files with 364 additions and 136 deletions
+7 -16
View File
@@ -25,8 +25,7 @@ export class OllamaLocalBackend extends OllamaBaseBackend {
protected resolveModel(): string {
if (this.localConfig.model) return this.localConfig.model;
const models = this.fetchAvailableModelsSync();
return this.modelProfileToModel(this.localConfig.model_profile, models);
return this.modelProfileToModel(this.localConfig.model_profile, []);
}
protected async callModel(
@@ -34,10 +33,15 @@ export class OllamaLocalBackend extends OllamaBaseBackend {
model: string,
toolRegistry: ToolRegistry
): Promise<OllamaChatResponse> {
let resolvedModel = model;
if (!this.localConfig.model) {
const models = await this.fetchAvailableModels();
resolvedModel = this.modelProfileToModel(this.localConfig.model_profile, models);
}
const url = `${this.localConfig.base_url}/v1/chat/completions`;
const body: Record<string, unknown> = {
model,
model: resolvedModel,
messages: messages.map((m) => {
const msg: Record<string, unknown> = { role: m.role, content: m.content };
if (m.name) msg.name = m.name;
@@ -65,17 +69,4 @@ export class OllamaLocalBackend extends OllamaBaseBackend {
return (await response.json()) as OllamaChatResponse;
}
private fetchAvailableModelsSync(): string[] {
try {
const { execSync } = require("node:child_process");
const result = execSync(`curl -s ${this.localConfig.base_url}/api/tags`, {
encoding: "utf-8",
timeout: 5000,
});
const data = JSON.parse(result) as { models?: Array<{ name: string }> };
return (data.models || []).map((m) => m.name);
} catch {
return [];
}
}
}