feat: map-and-preserve strategy for frontmatter conversion#60
Merged
Conversation
Replace destructive field stripping with non-destructive map-and-preserve: - Agent transform copies all fields, then maps known CC→OC equivalents - CC tools arrays → OC tools maps with canonical name mapping - CC permissionMode → OC permission via explicit mapping table - CC maxTurns/maxSteps → OC steps (min strategy, positive integer validation) - CC disable-model-invocation → OC hidden - Skills/commands preserve all fields (CC_ONLY constants removed) - Model normalization applied to skills (not just agents/commands) - context: fork → subtask: true mapping for skills - Parse errors now still transform body content - Converter cache versioned for invalidation on logic changes - PermissionConfig extended with task/skill keys - maxSteps renamed to steps across AgentFrontmatter and config-handler
Add provenance manifest for tracking upstream definition sources: - SyncManifest types with ManifestSource and ManifestDefinition interfaces - Read/write/validate functions with type guard validation - findStaleEntries for detecting orphaned manifest entries - JSON Schema for editor autocomplete and CI validation - Empty manifest at repo root with schema reference - 16 unit tests covering read, write, validate, stale detection
… sync - bootstrap.ts: TodoWrite → todowrite (was incorrectly update_plan) - converter.ts: clarify TOOL_NAME_MAP must stay in sync with TOOL_MAPPINGS
- Add brainstorm doc capturing the design exploration for map-and-preserve strategy - Add compound solution doc for destructive-to-nondestructive converter transformation - Create docs/solutions/best-practices/ directory for compound-docs workflow
Revise CEP-to-OpenCode conversion guide to document the new non-destructive frontmatter handling. CC fields are now mapped to OC equivalents or passed through rather than stripped. - Add permission mode and tools array mapping tables - Document maxSteps→steps, disable-model-invocation→hidden mappings - Update field action language (Map/Pass through vs REMOVE) - Clarify unknown fields pass through untouched
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.
Summary
removeFields/CC_ONLY_*constants) with non-destructive map-and-preserve strategy. CEP fields are now mapped to OpenCode equivalents (tools[]→ tool permissions map,maxSteps→steps,permissionMode→PermissionConfig), and unknown fields pass through untouched.sync-manifest.jsonprovenance tracking with JSON Schema,src/lib/manifest.tsmodule (read/write/validate/stale detection), and 16 unit tests. Empty manifest ships as starting point.TodoWrite→todowritemapping (was incorrectlyupdate_plan).Changes
Phase 1: Converter Changes
src/lib/converter.tsTOOL_NAME_MAP,PERMISSION_MODE_MAP),CONVERTER_VERSION=2cache keysrc/lib/validation.tsPermissionConfigwithtaskandskillfieldssrc/lib/agents.tsmaxSteps→steps, addedhiddentoAgentFrontmattersrc/lib/config-handler.tsloadAgentAsConfig()forsteps/hiddensrc/lib/bootstrap.tsPhase 2: Manifest System
src/lib/manifest.tssync-manifest.json$schemareferencesync-manifest.schema.jsonTests
Documentation
Deferred (Phase 3)
sync-definitionsproject skill for automated manifest population