import type { Migration } from "../types.js"; /** * v0.5.0 → v0.6.0 — default-workflow tuning + memory archive + org layer. * * Per docs/plan/v0.6-default-workflow-tuning.md §2.1/§2.2/§2.3/§2.4 + §4. The * step is 2-pass like v0.5 (S5) — Pass 1 is the bulk automatic work, Pass 2 * is `solosquad agent validate --all` against the migrated workspace. * * What changes in the user workspace: * * 1. Folder re-shape (§2.1): `agents/_teams/{team}/TEAM_KNOWLEDGE.md` → * `agents/{team}/KNOWLEDGE.md`. Non-destructive file move. * 2. Org layer stubs (§2.2): each `/` gets `core/PRINCIPLES.md`, * `core/VOICE.md`, `agent-profile.yaml` (defaults + schema_version: 1), * `domain/README.md`. * 3. Workspace knowledge guide (§2.3): `/.solosquad/knowledge/README.md`. * 4. FTS5 archive init (§4): each `/memory/archive.sqlite` opened → * schema applied. * 5. v0.5 ledger redestination (§2.2 receiver-side): every analysis-ledger * entry with `pending_v0.6_redestination: true` is processed — * · role → org-color H2/H3 sections heuristically extracted from * the temp SKILL.md body and merged into * `/agent-profile.yaml`. Match 0 → mark * `human_review_required: true`, leave in place. * · domain → `/memory/domain/*.md` moved to `/domain/*.md`. * Each processed entry flips to `pending_v0.6_redestination: false` + * `redestinated_at: ` + `redestination_method: auto | * human-review-required`. A side-car Markdown report is written. * 6. Migration budget cap (§2.2 P0 #2): `workspace.yaml.migration.budget_usd` * (default $5). LLM fallback for ledger redestination calls * `checkBudget()` first; cap reached → remaining items are flagged * `human_review_required` and the run *succeeds* (idempotent retry). * Cumulative cost lands in `/memory/migration-costs.jsonl`. * 7. collab_pattern injection (§2.4): the same logic as * `scripts/inject-collab-pattern.ts` runs against every reachable user * SKILL.md (workspace-bundled + org-local + user-global). Idempotent. * 8. Routine copy: `assets/routines/archive-rotate.md` + * `v06-retrospective-stats.md` → user workspace `routines/` if present. * 9. workspace.yaml patches: `fs_watch`, `archive`, `spawn`, `migration` * sections (idempotent default fill-ins). * 10. Version bump 0.5.x → 0.6.0. * * Pass 2 (post-migration, automatic): * - `solosquad agent validate --all` is invoked once; failures are *warned*, * not raised. Users edit SKILLs by hand afterwards. * * Idempotency: re-running on a 0.6.0 workspace is a no-op (detect() returns * false). Running before completion on a half-migrated workspace re-processes * only the remaining pending entries. */ export declare const migration: Migration; declare function reshapeTeamsFolder(workspace: string): void; declare function ensureOrgLayerStubs(workspace: string, orgSlug: string): void; declare function ensureWorkspaceKnowledgeStub(workspace: string): void; declare function ensureArchiveSqlite(workspace: string, orgSlug: string): void; interface RedestinateOpts { workspace: string; orgSlug: string; orgDir: string; cumulativeBudgetCost: number; budgetCap: number; dateStamp: string; } interface RedestinationResult { cumulativeBudgetCost: number; } declare function redestinateLedger(opts: RedestinateOpts): RedestinationResult; declare function resolveDestinationPath(destination: string): string | null; declare function inferAgentNameFromPath(skillPath: string): string | undefined; interface OrgColorSection { heading: string; body: string; keyword: string; } export declare function extractOrgColorSections(raw: string): OrgColorSection[]; declare function matchOrgColorKeyword(heading: string): string | null; declare function stripFrontmatter(raw: string): string; interface MergeOrgColorOpts { workspace: string; orgSlug: string; agentName: string; sections: OrgColorSection[]; } declare function mergeOrgColorIntoAgentProfile(opts: MergeOrgColorOpts): void; interface RecordMigrationCostInput { workspace: string; orgSlug: string; entryPath: string; usd: number; method: "heuristic" | "llm-fallback"; } declare function recordMigrationCost(input: RecordMigrationCostInput): void; declare function readMigrationCostsTotal(workspace: string, orgSlug: string): number; declare function readMigrationBudgetCap(workspace: string): number; declare function patternForTeamAgent(team: string, agent: string): "hierarchical" | "graph" | "dynamic"; declare function injectCollabPatternBody(raw: string, pattern: "hierarchical" | "graph" | "dynamic"): string | null; declare function patchWorkspaceYaml(workspace: string): void; export declare const __test: { extractOrgColorSections: typeof extractOrgColorSections; matchOrgColorKeyword: typeof matchOrgColorKeyword; stripFrontmatter: typeof stripFrontmatter; mergeOrgColorIntoAgentProfile: typeof mergeOrgColorIntoAgentProfile; injectCollabPatternBody: typeof injectCollabPatternBody; patternForTeamAgent: typeof patternForTeamAgent; reshapeTeamsFolder: typeof reshapeTeamsFolder; ensureOrgLayerStubs: typeof ensureOrgLayerStubs; ensureArchiveSqlite: typeof ensureArchiveSqlite; ensureWorkspaceKnowledgeStub: typeof ensureWorkspaceKnowledgeStub; patchWorkspaceYaml: typeof patchWorkspaceYaml; redestinateLedger: typeof redestinateLedger; recordMigrationCost: typeof recordMigrationCost; readMigrationCostsTotal: typeof readMigrationCostsTotal; resolveDestinationPath: typeof resolveDestinationPath; inferAgentNameFromPath: typeof inferAgentNameFromPath; readMigrationBudgetCap: typeof readMigrationBudgetCap; TARGET: string; }; export {};