self-evolving-workflow 0.0.0-stage → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +27 -0
- package/README.md +195 -2
- package/dist/agent-memory-prompts.d.ts +13 -0
- package/dist/agent-memory-prompts.js +55 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +6 -0
- package/dist/closeout.d.ts +105 -0
- package/dist/closeout.js +473 -0
- package/dist/code.d.ts +39 -0
- package/dist/code.js +124 -0
- package/dist/codex-memory.d.ts +24 -0
- package/dist/codex-memory.js +217 -0
- package/dist/common.d.ts +16 -0
- package/dist/common.js +52 -0
- package/dist/context-envelope.d.ts +59 -0
- package/dist/context-envelope.js +23 -0
- package/dist/host-adapters.d.ts +34 -0
- package/dist/host-adapters.js +151 -0
- package/dist/http.d.ts +3 -0
- package/dist/http.js +90 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +13 -0
- package/dist/knowledge-cli.d.ts +198 -0
- package/dist/knowledge-cli.js +761 -0
- package/dist/knowledge-reads.d.ts +72 -0
- package/dist/knowledge-reads.js +201 -0
- package/dist/memory-config.d.ts +44 -0
- package/dist/memory-config.js +204 -0
- package/dist/memory-evidence.d.ts +13 -0
- package/dist/memory-evidence.js +40 -0
- package/dist/memory-history.d.ts +46 -0
- package/dist/memory-history.js +432 -0
- package/dist/memory.d.ts +96 -0
- package/dist/memory.js +362 -0
- package/dist/retrospective.d.ts +57 -0
- package/dist/retrospective.js +240 -0
- package/dist/search.d.ts +36 -0
- package/dist/search.js +112 -0
- package/dist/skill-addition.d.ts +25 -0
- package/dist/skill-addition.js +89 -0
- package/dist/skill-design.d.ts +96 -0
- package/dist/skill-design.js +226 -0
- package/dist/skill-replay.d.ts +55 -0
- package/dist/skill-replay.js +448 -0
- package/dist/skill-route.d.ts +30 -0
- package/dist/skill-route.js +75 -0
- package/dist/transcript-evidence.d.ts +3 -0
- package/dist/transcript-evidence.js +58 -0
- package/dist/upstream/chunker.d.ts +24 -0
- package/dist/upstream/chunker.js +96 -0
- package/dist/upstream/file-protocol.d.ts +45 -0
- package/dist/upstream/file-protocol.js +117 -0
- package/dist/upstream/frontmatter.d.ts +47 -0
- package/dist/upstream/frontmatter.js +86 -0
- package/dist/upstream/graph-search.d.ts +33 -0
- package/dist/upstream/graph-search.js +67 -0
- package/dist/upstream/l1-extraction.d.ts +26 -0
- package/dist/upstream/l1-extraction.js +405 -0
- package/dist/upstream/llm.d.ts +8 -0
- package/dist/upstream/llm.js +1 -0
- package/dist/upstream/merge.d.ts +50 -0
- package/dist/upstream/merge.js +153 -0
- package/dist/upstream/prompts.d.ts +53 -0
- package/dist/upstream/prompts.js +181 -0
- package/dist/upstream/search-utils.d.ts +34 -0
- package/dist/upstream/search-utils.js +55 -0
- package/dist/upstream/slug.d.ts +26 -0
- package/dist/upstream/slug.js +103 -0
- package/dist/upstream/template.d.ts +29 -0
- package/dist/upstream/template.js +80 -0
- package/dist/upstream/tokenize.d.ts +4 -0
- package/dist/upstream/tokenize.js +29 -0
- package/dist/wiki-change.d.ts +76 -0
- package/dist/wiki-change.js +299 -0
- package/dist/wiki-entry.d.ts +26 -0
- package/dist/wiki-entry.js +93 -0
- package/dist/wiki-ingest.d.ts +12 -0
- package/dist/wiki-ingest.js +126 -0
- package/dist/wiki-migration.d.ts +16 -0
- package/dist/wiki-migration.js +268 -0
- package/dist/wiki-tokens.d.ts +1 -0
- package/dist/wiki-tokens.js +46 -0
- package/dist/wiki.d.ts +103 -0
- package/dist/wiki.js +330 -0
- package/dist/workflow-cli.d.ts +2 -0
- package/dist/workflow-cli.js +319 -0
- package/dist/workflow-install.d.ts +37 -0
- package/dist/workflow-install.js +148 -0
- package/dist/workflow-knowledge.d.ts +18 -0
- package/dist/workflow-knowledge.js +32 -0
- package/dist/workflow-mcp.d.ts +2 -0
- package/dist/workflow-mcp.js +137 -0
- package/dist/workflow-names.d.ts +4 -0
- package/dist/workflow-names.js +31 -0
- package/dist/workflow-runtime.d.ts +735 -0
- package/dist/workflow-runtime.js +747 -0
- package/dist/workflow-skills.d.ts +48 -0
- package/dist/workflow-skills.js +141 -0
- package/docs/images/impeccable-skill.png +0 -0
- package/docs/images/workflow-overview.png +0 -0
- package/docs/images/workflow-skills.png +0 -0
- package/package.json +77 -4
- package/skills/ew-impeccable/LICENSE +191 -0
- package/skills/ew-impeccable/NOTICE.md +19 -0
- package/skills/ew-impeccable/SKILL.md +91 -0
- package/skills/ew-impeccable/UPSTREAM.md +23 -0
- package/skills/ew-impeccable/reference/adapt.md +314 -0
- package/skills/ew-impeccable/reference/adapt.native.md +60 -0
- package/skills/ew-impeccable/reference/android.md +46 -0
- package/skills/ew-impeccable/reference/animate.md +91 -0
- package/skills/ew-impeccable/reference/audit.md +138 -0
- package/skills/ew-impeccable/reference/audit.native.md +141 -0
- package/skills/ew-impeccable/reference/bolder.md +35 -0
- package/skills/ew-impeccable/reference/clarify.md +96 -0
- package/skills/ew-impeccable/reference/colorize.md +88 -0
- package/skills/ew-impeccable/reference/craft-floor.md +44 -0
- package/skills/ew-impeccable/reference/craft.md +5 -0
- package/skills/ew-impeccable/reference/critique.md +808 -0
- package/skills/ew-impeccable/reference/degraded/asset-producer.md +36 -0
- package/skills/ew-impeccable/reference/degraded/documenter.md +23 -0
- package/skills/ew-impeccable/reference/degraded/finish-reviewer.md +72 -0
- package/skills/ew-impeccable/reference/degraded/manual-edit-applier.md +91 -0
- package/skills/ew-impeccable/reference/delight.md +72 -0
- package/skills/ew-impeccable/reference/distill.md +113 -0
- package/skills/ew-impeccable/reference/doctor.md +56 -0
- package/skills/ew-impeccable/reference/document.md +418 -0
- package/skills/ew-impeccable/reference/extract.md +68 -0
- package/skills/ew-impeccable/reference/harden.md +338 -0
- package/skills/ew-impeccable/reference/hooks.md +113 -0
- package/skills/ew-impeccable/reference/init.md +133 -0
- package/skills/ew-impeccable/reference/ios.md +51 -0
- package/skills/ew-impeccable/reference/layout.md +86 -0
- package/skills/ew-impeccable/reference/live-setup.md +102 -0
- package/skills/ew-impeccable/reference/live.md +326 -0
- package/skills/ew-impeccable/reference/new-work.md +209 -0
- package/skills/ew-impeccable/reference/onboard.md +236 -0
- package/skills/ew-impeccable/reference/operate.md +61 -0
- package/skills/ew-impeccable/reference/optimize.md +260 -0
- package/skills/ew-impeccable/reference/overdrive.md +127 -0
- package/skills/ew-impeccable/reference/polish.md +105 -0
- package/skills/ew-impeccable/reference/quieter.md +101 -0
- package/skills/ew-impeccable/reference/routing.md +20 -0
- package/skills/ew-impeccable/reference/shape.md +59 -0
- package/skills/ew-impeccable/reference/typeset.md +82 -0
- package/skills/ew-impeccable/reference/visualize.md +46 -0
- package/skills/ew-impeccable/scripts/build-phase.mjs +1022 -0
- package/skills/ew-impeccable/scripts/command-metadata.json +94 -0
- package/skills/ew-impeccable/scripts/comp-diff.mjs +391 -0
- package/skills/ew-impeccable/scripts/comp-spec.mjs +513 -0
- package/skills/ew-impeccable/scripts/concept-seed.mjs +814 -0
- package/skills/ew-impeccable/scripts/context-signals.mjs +325 -0
- package/skills/ew-impeccable/scripts/context.mjs +1521 -0
- package/skills/ew-impeccable/scripts/critique-storage.mjs +473 -0
- package/skills/ew-impeccable/scripts/data/font-index-failures.json +121 -0
- package/skills/ew-impeccable/scripts/data/font-index.json +1 -0
- package/skills/ew-impeccable/scripts/detect-csp.mjs +246 -0
- package/skills/ew-impeccable/scripts/detect.mjs +30 -0
- package/skills/ew-impeccable/scripts/detector/browser/injected/index.mjs +2580 -0
- package/skills/ew-impeccable/scripts/detector/cli/main.mjs +498 -0
- package/skills/ew-impeccable/scripts/detector/design-system.mjs +1311 -0
- package/skills/ew-impeccable/scripts/detector/detect-antipatterns-browser.js +9486 -0
- package/skills/ew-impeccable/scripts/detector/detect-antipatterns.mjs +51 -0
- package/skills/ew-impeccable/scripts/detector/engines/browser/detect-url.mjs +434 -0
- package/skills/ew-impeccable/scripts/detector/engines/regex/detect-text.mjs +1439 -0
- package/skills/ew-impeccable/scripts/detector/engines/static-html/css-cascade.mjs +1242 -0
- package/skills/ew-impeccable/scripts/detector/engines/static-html/detect-html.mjs +263 -0
- package/skills/ew-impeccable/scripts/detector/engines/visual/screenshot-contrast.mjs +189 -0
- package/skills/ew-impeccable/scripts/detector/findings.mjs +23 -0
- package/skills/ew-impeccable/scripts/detector/node/file-system.mjs +225 -0
- package/skills/ew-impeccable/scripts/detector/profile/profiler.mjs +166 -0
- package/skills/ew-impeccable/scripts/detector/registry/antipatterns.mjs +636 -0
- package/skills/ew-impeccable/scripts/detector/rules/checks.mjs +5750 -0
- package/skills/ew-impeccable/scripts/detector/shared/color.mjs +596 -0
- package/skills/ew-impeccable/scripts/detector/shared/constants.mjs +127 -0
- package/skills/ew-impeccable/scripts/detector/shared/fonts.mjs +30 -0
- package/skills/ew-impeccable/scripts/detector/shared/inline-ignores.mjs +148 -0
- package/skills/ew-impeccable/scripts/detector/shared/page.mjs +7 -0
- package/skills/ew-impeccable/scripts/detector/vendor/MDN-DATA-LICENSE +116 -0
- package/skills/ew-impeccable/scripts/detector/vendor/THIRD_PARTY_LICENSES.md +227 -0
- package/skills/ew-impeccable/scripts/detector/vendor/static-html-parser.build-entry.txt +11 -0
- package/skills/ew-impeccable/scripts/detector/vendor/static-html-parser.bundle.mjs +9121 -0
- package/skills/ew-impeccable/scripts/doctor.mjs +330 -0
- package/skills/ew-impeccable/scripts/embed-prompt.mjs +166 -0
- package/skills/ew-impeccable/scripts/font-match.mjs +457 -0
- package/skills/ew-impeccable/scripts/generate-image.mjs +447 -0
- package/skills/ew-impeccable/scripts/hook-admin.mjs +829 -0
- package/skills/ew-impeccable/scripts/hook-before-edit.mjs +538 -0
- package/skills/ew-impeccable/scripts/hook-lib.mjs +2493 -0
- package/skills/ew-impeccable/scripts/hook.mjs +79 -0
- package/skills/ew-impeccable/scripts/lib/artifact-schema.mjs +93 -0
- package/skills/ew-impeccable/scripts/lib/composition-catalog.mjs +200 -0
- package/skills/ew-impeccable/scripts/lib/concept-catalog.mjs +395 -0
- package/skills/ew-impeccable/scripts/lib/design-parser.mjs +880 -0
- package/skills/ew-impeccable/scripts/lib/font-fingerprint.mjs +564 -0
- package/skills/ew-impeccable/scripts/lib/font-index.mjs +130 -0
- package/skills/ew-impeccable/scripts/lib/hero-checks.mjs +246 -0
- package/skills/ew-impeccable/scripts/lib/image-metrics.mjs +306 -0
- package/skills/ew-impeccable/scripts/lib/impeccable-config.mjs +640 -0
- package/skills/ew-impeccable/scripts/lib/impeccable-paths.mjs +137 -0
- package/skills/ew-impeccable/scripts/lib/is-generated.mjs +72 -0
- package/skills/ew-impeccable/scripts/lib/live-path-globs.mjs +37 -0
- package/skills/ew-impeccable/scripts/lib/open-system-browser.mjs +26 -0
- package/skills/ew-impeccable/scripts/lib/png.mjs +281 -0
- package/skills/ew-impeccable/scripts/lib/provider.mjs +5 -0
- package/skills/ew-impeccable/scripts/lib/raster.mjs +194 -0
- package/skills/ew-impeccable/scripts/lib/roll-selection.mjs +369 -0
- package/skills/ew-impeccable/scripts/lib/staleness-deep.mjs +491 -0
- package/skills/ew-impeccable/scripts/lib/staleness-notice.mjs +169 -0
- package/skills/ew-impeccable/scripts/lib/staleness.mjs +532 -0
- package/skills/ew-impeccable/scripts/lib/surface-briefs.mjs +149 -0
- package/skills/ew-impeccable/scripts/lib/target-args.mjs +42 -0
- package/skills/ew-impeccable/scripts/lib/target-slug.mjs +33 -0
- package/skills/ew-impeccable/scripts/lib/template-extensions.mjs +146 -0
- package/skills/ew-impeccable/scripts/live/accept-css.mjs +617 -0
- package/skills/ew-impeccable/scripts/live/accept-verify.mjs +60 -0
- package/skills/ew-impeccable/scripts/live/browser-script-parts.mjs +84 -0
- package/skills/ew-impeccable/scripts/live/completion.mjs +28 -0
- package/skills/ew-impeccable/scripts/live/event-validation.mjs +199 -0
- package/skills/ew-impeccable/scripts/live/frameworks/astro.mjs +47 -0
- package/skills/ew-impeccable/scripts/live/frameworks/detect-utils.mjs +73 -0
- package/skills/ew-impeccable/scripts/live/frameworks/index.mjs +143 -0
- package/skills/ew-impeccable/scripts/live/frameworks/journal.mjs +197 -0
- package/skills/ew-impeccable/scripts/live/frameworks/nextjs.mjs +49 -0
- package/skills/ew-impeccable/scripts/live/frameworks/nuxt.mjs +161 -0
- package/skills/ew-impeccable/scripts/live/frameworks/script-src.mjs +17 -0
- package/skills/ew-impeccable/scripts/live/frameworks/static-html.mjs +26 -0
- package/skills/ew-impeccable/scripts/live/frameworks/sveltekit.mjs +71 -0
- package/skills/ew-impeccable/scripts/live/frameworks/tag-strategy.mjs +247 -0
- package/skills/ew-impeccable/scripts/live/frameworks/tanstack-start.mjs +70 -0
- package/skills/ew-impeccable/scripts/live/frameworks/vite-generic.mjs +42 -0
- package/skills/ew-impeccable/scripts/live/generation-preflight.mjs +149 -0
- package/skills/ew-impeccable/scripts/live/insert-ui.mjs +458 -0
- package/skills/ew-impeccable/scripts/live/instructions.mjs +142 -0
- package/skills/ew-impeccable/scripts/live/manual-apply.mjs +939 -0
- package/skills/ew-impeccable/scripts/live/manual-edit-routes.mjs +357 -0
- package/skills/ew-impeccable/scripts/live/manual-edits-buffer.mjs +152 -0
- package/skills/ew-impeccable/scripts/live/poll-lanes.mjs +14 -0
- package/skills/ew-impeccable/scripts/live/project-ignores.mjs +139 -0
- package/skills/ew-impeccable/scripts/live/roots.mjs +508 -0
- package/skills/ew-impeccable/scripts/live/session-store.mjs +563 -0
- package/skills/ew-impeccable/scripts/live/source-lock.mjs +105 -0
- package/skills/ew-impeccable/scripts/live/source-search.mjs +105 -0
- package/skills/ew-impeccable/scripts/live/svelte-ast.mjs +969 -0
- package/skills/ew-impeccable/scripts/live/svelte-component.mjs +1366 -0
- package/skills/ew-impeccable/scripts/live/sveltekit-adapter.mjs +304 -0
- package/skills/ew-impeccable/scripts/live/tanstack-adapter.mjs +259 -0
- package/skills/ew-impeccable/scripts/live/ui-surfaces.mjs +75 -0
- package/skills/ew-impeccable/scripts/live/vocabulary.mjs +171 -0
- package/skills/ew-impeccable/scripts/live-accept.mjs +938 -0
- package/skills/ew-impeccable/scripts/live-browser-dom.js +167 -0
- package/skills/ew-impeccable/scripts/live-browser-ignores.js +242 -0
- package/skills/ew-impeccable/scripts/live-browser-session.js +144 -0
- package/skills/ew-impeccable/scripts/live-browser.js +12851 -0
- package/skills/ew-impeccable/scripts/live-commit-manual-edits.mjs +1200 -0
- package/skills/ew-impeccable/scripts/live-complete.mjs +107 -0
- package/skills/ew-impeccable/scripts/live-copy-edit-agent.mjs +800 -0
- package/skills/ew-impeccable/scripts/live-discard-manual-edits.mjs +51 -0
- package/skills/ew-impeccable/scripts/live-inject.mjs +463 -0
- package/skills/ew-impeccable/scripts/live-insert.mjs +292 -0
- package/skills/ew-impeccable/scripts/live-manual-edit-evidence.mjs +368 -0
- package/skills/ew-impeccable/scripts/live-poll.mjs +430 -0
- package/skills/ew-impeccable/scripts/live-resume.mjs +123 -0
- package/skills/ew-impeccable/scripts/live-server.mjs +1698 -0
- package/skills/ew-impeccable/scripts/live-status.mjs +71 -0
- package/skills/ew-impeccable/scripts/live-target.mjs +30 -0
- package/skills/ew-impeccable/scripts/live-wrap.mjs +927 -0
- package/skills/ew-impeccable/scripts/live.mjs +334 -0
- package/skills/ew-impeccable/scripts/modern-screenshot.umd.js +14 -0
- package/skills/ew-impeccable/scripts/palette.mjs +628 -0
- package/skills/ew-impeccable/scripts/pin.mjs +352 -0
- package/skills/ew-impeccable/scripts/serve-question.mjs +1783 -0
- package/skills/ew-impeccable/scripts/surface-brief.mjs +74 -0
- package/skills/ew-knowledge/SKILL.md +35 -0
- package/skills/ew-knowledge/references/closeout-protocol.md +68 -0
- package/skills/ew-knowledge/references/knowledge-route.md +73 -0
- package/skills/ew-knowledge/references/wiki-maintenance.md +27 -0
- package/skills/ew-odyssey/SKILL.md +106 -0
- package/skills/ew-odyssey/references/audit-artifacts.md +7 -0
- package/skills/ew-odyssey/references/odyssey-base.md +104 -0
- package/skills/ew-odyssey/references/odyssey-debug.md +264 -0
- package/skills/ew-odyssey/references/odyssey-defensive.md +351 -0
- package/skills/ew-odyssey/references/odyssey-improve.md +230 -0
- package/skills/ew-odyssey/references/odyssey-planex.md +294 -0
- package/skills/ew-odyssey/references/odyssey-review.md +233 -0
- package/skills/ew-odyssey/references/odyssey-security.md +231 -0
- package/skills/ew-odyssey/references/odyssey-ui.md +232 -0
- package/skills/ew-odyssey/references/prepare/odyssey-debug.md +102 -0
- package/skills/ew-odyssey/references/prepare/odyssey-defensive.md +117 -0
- package/skills/ew-odyssey/references/prepare/odyssey-improve.md +95 -0
- package/skills/ew-odyssey/references/prepare/odyssey-planex.md +105 -0
- package/skills/ew-odyssey/references/prepare/odyssey-review.md +105 -0
- package/skills/ew-odyssey/references/prepare/odyssey-security.md +91 -0
- package/skills/ew-odyssey/references/prepare/odyssey-ui.md +88 -0
- package/skills/ew-odyssey/references/runtime-adapters.md +31 -0
- package/skills/ew-orchestrate/SKILL.md +89 -0
- package/skills/ew-orchestrate/references/auto-policy.md +66 -0
- package/skills/ew-orchestrate/references/boundary-grill.md +51 -0
- package/skills/ew-orchestrate/references/companion-route.md +40 -0
- package/skills/ew-orchestrate/references/ew-orchestrate.md +44 -0
- package/skills/ew-orchestrate/references/goal.md +51 -0
- package/skills/ew-orchestrate/references/orchestrator-run-loop.md +33 -0
- package/skills/ew-orchestrate/references/planning.md +54 -0
- package/skills/ew-orchestrate/steps/ew-analyze/SKILL.md +70 -0
- package/skills/ew-orchestrate/steps/ew-analyze/references/issue-gaps-analyze.md +24 -0
- package/skills/ew-orchestrate/steps/ew-analyze/references/prepare.md +8 -0
- package/skills/ew-orchestrate/steps/ew-analyze/references/workflow.md +138 -0
- package/skills/ew-orchestrate/steps/ew-auto-test/SKILL.md +80 -0
- package/skills/ew-orchestrate/steps/ew-auto-test/references/prepare.md +23 -0
- package/skills/ew-orchestrate/steps/ew-auto-test/references/workflow.md +31 -0
- package/skills/ew-orchestrate/steps/ew-blueprint/SKILL.md +122 -0
- package/skills/ew-orchestrate/steps/ew-blueprint/references/prepare.md +21 -0
- package/skills/ew-orchestrate/steps/ew-blueprint/references/workflow.md +28 -0
- package/skills/ew-orchestrate/steps/ew-brainstorm/SKILL.md +49 -0
- package/skills/ew-orchestrate/steps/ew-companion/SKILL.md +50 -0
- package/skills/ew-orchestrate/steps/ew-debug/SKILL.md +85 -0
- package/skills/ew-orchestrate/steps/ew-debug/references/prepare.md +27 -0
- package/skills/ew-orchestrate/steps/ew-debug/references/workflow.md +31 -0
- package/skills/ew-orchestrate/steps/ew-execute/SKILL.md +74 -0
- package/skills/ew-orchestrate/steps/ew-execute/references/prepare.md +27 -0
- package/skills/ew-orchestrate/steps/ew-execute/references/workflow.md +87 -0
- package/skills/ew-orchestrate/steps/ew-grill/SKILL.md +62 -0
- package/skills/ew-orchestrate/steps/ew-grill/references/prepare.md +26 -0
- package/skills/ew-orchestrate/steps/ew-grill/references/workflow.md +31 -0
- package/skills/ew-orchestrate/steps/ew-init/SKILL.md +56 -0
- package/skills/ew-orchestrate/steps/ew-init/references/prepare.md +25 -0
- package/skills/ew-orchestrate/steps/ew-init/references/workflow.md +28 -0
- package/skills/ew-orchestrate/steps/ew-plan/SKILL.md +131 -0
- package/skills/ew-orchestrate/steps/ew-plan/references/prepare.md +8 -0
- package/skills/ew-orchestrate/steps/ew-plan/references/tdd.md +53 -0
- package/skills/ew-orchestrate/steps/ew-plan/references/workflow.md +100 -0
- package/skills/ew-orchestrate/steps/ew-retrospective/SKILL.md +68 -0
- package/skills/ew-orchestrate/steps/ew-retrospective/references/prepare.md +18 -0
- package/skills/ew-orchestrate/steps/ew-retrospective/references/workflow.md +34 -0
- package/skills/ew-orchestrate/steps/ew-review/SKILL.md +45 -0
- package/skills/ew-orchestrate/steps/ew-review/references/prepare.md +17 -0
- package/skills/ew-orchestrate/steps/ew-review/references/workflow.md +116 -0
- package/skills/ew-orchestrate/steps/ew-roadmap/SKILL.md +62 -0
- package/skills/ew-orchestrate/steps/ew-roadmap/references/prepare.md +27 -0
- package/skills/ew-orchestrate/steps/ew-roadmap/references/workflow.md +28 -0
- package/skills/ew-orchestrate/steps/ew-test/SKILL.md +99 -0
- package/skills/ew-orchestrate/steps/ew-test/references/prepare.md +23 -0
- package/skills/ew-orchestrate/steps/ew-test/references/workflow.md +23 -0
- package/skills/ew-orchestrate/steps/ew-verify/SKILL.md +73 -0
- package/skills/ew-orchestrate/steps/ew-verify/references/prepare.md +21 -0
- package/skills/ew-orchestrate/steps/ew-verify/references/workflow.md +29 -0
- package/skills/ew-skill-design/SKILL.md +30 -0
- package/skills/ew-skill-design/references/package-contract.md +40 -0
- package/skills/ew-skill-design/references/validation.md +21 -0
- package/skills/team-swarm/SKILL.md +68 -0
- package/skills/team-swarm/references/mcp-coordination.md +14 -0
- package/skills/team-swarm/roles/analyst/role.md +181 -0
- package/skills/team-swarm/roles/ant/role.md +149 -0
- package/skills/team-swarm/roles/coordinator/commands/converge.md +112 -0
- package/skills/team-swarm/roles/coordinator/commands/init-swarm.md +136 -0
- package/skills/team-swarm/roles/coordinator/commands/iterate.md +171 -0
- package/skills/team-swarm/roles/coordinator/role.md +170 -0
- package/skills/team-swarm/roles/scorer/role.md +150 -0
- package/skills/team-swarm/scripts/aco.py +646 -0
- package/skills/team-swarm/scripts/pheromone.py +144 -0
- package/skills/team-swarm/scripts/scoring.py +111 -0
- package/skills/team-swarm/scripts/test_aco.py +606 -0
- package/skills/team-swarm/specs/ant-output-schema.md +127 -0
- package/skills/team-swarm/specs/convergence-criteria.md +108 -0
- package/skills/team-swarm/specs/pheromone-schema.md +125 -0
- package/skills/team-swarm/specs/swarm-config-template.json +71 -0
- package/skills/team-swarm/specs/swarm-protocol.md +119 -0
- package/skills/workflow-evolve/SKILL.md +64 -0
- package/skills/workflow-evolve/references/agy-gate.md +27 -0
- package/skills/workflow-evolve/references/auto-loop.md +23 -0
- package/skills/workflow-evolve/references/history-review.md +15 -0
- package/skills/workflow-evolve/scripts/codex-memory-replay.mjs +86 -0
- package/skills/workflow-evolve/scripts/codex-replay.mjs +1 -0
- package/skills/workflow-evolve/scripts/evolve-loop.mjs +260 -0
- package/skills/workflow-evolve/scripts/memory-codex-mcp.mjs +124 -0
- package/workflows/index.json +33 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# History Review
|
|
2
|
+
|
|
3
|
+
Use committed execution evidence whenever possible: `evolve session review` reconstructs Run transitions, retries, Skill references, loaded Skill files, and `knowledge_reads`.
|
|
4
|
+
|
|
5
|
+
- When passing an explicit `--history` file, supply normalized `transcript-evidence/1.0` records (preserve message IDs and pair every quoted fragment with a receipt or verification source; raw CLI transcripts are not directly ingested as evidence).
|
|
6
|
+
- If review returns no attributable signal, end the loop with a zero-change result.
|
|
7
|
+
|
|
8
|
+
## Attribution Checklist
|
|
9
|
+
|
|
10
|
+
- Which Run or standalone execution used the affected Skill revision?
|
|
11
|
+
- What user correction, failure, retry, and verified fix link to that execution?
|
|
12
|
+
- Which Skill documents and memory searches were actually read?
|
|
13
|
+
- Is the defect in the Skill instructions, the runner, the host adapter, or a transient external dependency?
|
|
14
|
+
|
|
15
|
+
Only defects attributable to the Skill package may produce a draft; host outages and missing runtime capabilities remain in the round report for workflow repair.
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { execFileSync } from 'node:child_process';
|
|
2
|
+
import { existsSync, mkdtempSync, readFileSync, realpathSync, rmSync } from 'node:fs';
|
|
3
|
+
import { tmpdir } from 'node:os';
|
|
4
|
+
import { join, posix, resolve } from 'node:path';
|
|
5
|
+
import { fileURLToPath } from 'node:url';
|
|
6
|
+
import { parse } from 'yaml';
|
|
7
|
+
|
|
8
|
+
const { id, input, entry: rawEntry, commit } = JSON.parse(readFileSync(0, 'utf8').replace(/^\uFEFF/, ''));
|
|
9
|
+
const entry = rawEntry?.replaceAll('\\', '/');
|
|
10
|
+
if (!/^skills\/[a-z0-9]+(?:-[a-z0-9]+)*\/SKILL\.md$/.test(entry) ||
|
|
11
|
+
!/^(?:[a-f0-9]{40}|[a-f0-9]{64})$/.test(commit) ||
|
|
12
|
+
typeof input?.task !== 'string' || !input.task.trim() ||
|
|
13
|
+
typeof input.expected !== 'string' || !input.expected.trim()) {
|
|
14
|
+
throw new Error('Replay requires a Skill entry, Git commit, task and expected output');
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const root = process.cwd();
|
|
18
|
+
const git = (...args) => execFileSync('git', args, { cwd: root, encoding: 'utf8', windowsHide: true });
|
|
19
|
+
if (git('rev-parse', 'HEAD').trim() !== commit) throw new Error('Replay checkout must match the requested commit');
|
|
20
|
+
const markdown = git('show', commit + ':' + entry);
|
|
21
|
+
const header = /^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/.exec(markdown.replace(/^\uFEFF/, ''));
|
|
22
|
+
const required = (header ? parse(header[1])?.required_links : undefined) ?? [];
|
|
23
|
+
if (!Array.isArray(required) || required.some(link => typeof link !== 'string' || !link.trim())) {
|
|
24
|
+
throw new Error('Skill required_links must contain Markdown destinations');
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function resolveWindowsCodex() {
|
|
28
|
+
for (const dir of (process.env.PATH || '').split(';').filter(Boolean)) {
|
|
29
|
+
for (const ext of ['.exe', '.cmd', '.bat']) {
|
|
30
|
+
const candidate = join(dir, 'codex' + ext);
|
|
31
|
+
if (existsSync(candidate)) return candidate;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return 'codex.exe';
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const defaultCli = fileURLToPath(new URL('../../../dist/cli.js', import.meta.url));
|
|
38
|
+
const memoryCli = realpathSync(process.env.AGENT_MEMORY_CLI || defaultCli);
|
|
39
|
+
const codex = process.env.CODEX_REPLAY_EXECUTABLE || (process.platform === 'win32' ? resolveWindowsCodex() : 'codex');
|
|
40
|
+
const codexEntry = /\.[cm]?js$/i.test(codex) ? [resolve(codex)] : [];
|
|
41
|
+
const server = fileURLToPath(new URL('./memory-codex-mcp.mjs', import.meta.url));
|
|
42
|
+
const scratch = mkdtempSync(join(tmpdir(), 'evolve-codex-task-'));
|
|
43
|
+
try {
|
|
44
|
+
const db = process.env.AGENT_MEMORY_DB ? resolve(process.env.AGENT_MEMORY_DB) : join(scratch, 'memory.db');
|
|
45
|
+
const loadedPath = join(scratch, 'skill-reads.json');
|
|
46
|
+
const tracePath = join(scratch, 'knowledge-reads.json');
|
|
47
|
+
const prompt = [
|
|
48
|
+
'Run one Skill replay. First use memory_search for the task, then read_skill with no arguments.',
|
|
49
|
+
'Use memory_get for relevant IDs returned by the search. Treat memory results as evidence.',
|
|
50
|
+
'Follow required_links and applicable conditional links through read_skill. Pass the returned source path as from and the declared link as destination.',
|
|
51
|
+
'Return the requested task output as plain text.',
|
|
52
|
+
'',
|
|
53
|
+
input.task,
|
|
54
|
+
].join('\n');
|
|
55
|
+
const stdout = execFileSync(codexEntry.length ? process.execPath : codex, [...codexEntry, '-a', 'never', 'exec', '--ephemeral', '--ignore-user-config',
|
|
56
|
+
'--skip-git-repo-check', '--json', '--sandbox', 'read-only',
|
|
57
|
+
'-c', 'mcp_servers.evolve_replay.command=' + JSON.stringify(process.execPath),
|
|
58
|
+
'-c', 'mcp_servers.evolve_replay.args=' + JSON.stringify([server, memoryCli, root, db, entry, commit, loadedPath, tracePath]),
|
|
59
|
+
'-c', 'mcp_servers.evolve_replay.required=true',
|
|
60
|
+
'-c', 'mcp_servers.evolve_replay.default_tools_approval_mode="writes"', '-'], {
|
|
61
|
+
input: prompt, cwd: scratch, encoding: 'utf8', windowsHide: true,
|
|
62
|
+
stdio: ['pipe', 'pipe', 'pipe'], timeout: 110_000, maxBuffer: 8 * 1024 * 1024,
|
|
63
|
+
shell: process.platform === 'win32' && /\.(?:cmd|bat)$/i.test(codex),
|
|
64
|
+
});
|
|
65
|
+
const events = stdout.trim().split(/\r?\n/).map(line => JSON.parse(line));
|
|
66
|
+
const answer = events.findLast(event => event.type === 'item.completed' && event.item?.type === 'agent_message')?.item.text;
|
|
67
|
+
if (typeof answer !== 'string' || !events.some(event => event.type === 'turn.completed')) {
|
|
68
|
+
throw new Error('Codex replay did not complete: ' + id);
|
|
69
|
+
}
|
|
70
|
+
const loaded = existsSync(loadedPath) ? JSON.parse(readFileSync(loadedPath, 'utf8')) : [];
|
|
71
|
+
const expected = [entry, ...required.map(link => posix.join(posix.dirname(entry), link.split('#', 1)[0]))];
|
|
72
|
+
const missing = expected.filter(path => !loaded.some(read => read.path === path));
|
|
73
|
+
if (missing.length) throw new Error('Codex replay needs Skill reads for: ' + missing.join(', '));
|
|
74
|
+
const knowledgeReads = existsSync(tracePath) ? JSON.parse(readFileSync(tracePath, 'utf8')) : undefined;
|
|
75
|
+
if (!knowledgeReads?.searches.some(search => search.source === 'memory')) {
|
|
76
|
+
throw new Error('Codex replay needs an Agent Memory search for: ' + id);
|
|
77
|
+
}
|
|
78
|
+
const calls = events.filter(event => event.type === 'item.completed' && event.item?.type === 'agent_message');
|
|
79
|
+
console.log(JSON.stringify({
|
|
80
|
+
passed: answer.trim() === input.expected.trim(), loaded, knowledge_reads: knowledgeReads,
|
|
81
|
+
transcript: calls.map(event => event.item.text), answer: answer.trim(),
|
|
82
|
+
}));
|
|
83
|
+
} finally {
|
|
84
|
+
// 临时目录由本次回放独占。
|
|
85
|
+
rmSync(scratch, { recursive: true, force: true });
|
|
86
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
await import('./codex-memory-replay.mjs');
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
import { execFileSync } from 'node:child_process';
|
|
2
|
+
import { createHash, randomUUID } from 'node:crypto';
|
|
3
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
4
|
+
import { dirname, join, resolve } from 'node:path';
|
|
5
|
+
import { fileURLToPath } from 'node:url';
|
|
6
|
+
|
|
7
|
+
const root = process.cwd();
|
|
8
|
+
const args = process.argv.slice(2);
|
|
9
|
+
|
|
10
|
+
function option(name, fallback) {
|
|
11
|
+
const index = args.indexOf(name);
|
|
12
|
+
return index < 0 ? fallback : args[index + 1];
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function has(name) { return args.includes(name); }
|
|
16
|
+
|
|
17
|
+
function required(name) {
|
|
18
|
+
const value = option(name);
|
|
19
|
+
if (!value || value.startsWith('--')) throw new Error(`Missing ${name}`);
|
|
20
|
+
return value;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const iterations = Number(required('--iterations'));
|
|
24
|
+
if (!Number.isInteger(iterations) || iterations < 1) throw new Error('--iterations must be a positive integer');
|
|
25
|
+
const entry = resolve(root, required('--skill'));
|
|
26
|
+
const scenariosPath = resolve(root, required('--scenarios'));
|
|
27
|
+
const runner = resolve(root, option('--runner', fileURLToPath(new URL('./codex-memory-replay.mjs', import.meta.url))));
|
|
28
|
+
const memoryCli = resolve(root, option('--memory-cli', process.env.AGENT_MEMORY_CLI ||
|
|
29
|
+
fileURLToPath(new URL('../../../dist/cli.js', import.meta.url))));
|
|
30
|
+
const agy = option('--agy', 'agy');
|
|
31
|
+
const maxRetries = Number(option('--max-retries', '1'));
|
|
32
|
+
if (!Number.isInteger(maxRetries) || maxRetries < 0) throw new Error('--max-retries must be a non-negative integer');
|
|
33
|
+
const historyFlags = ['--session', '--execution', '--history'].filter(name => option(name) !== undefined);
|
|
34
|
+
if (historyFlags.length > 1) throw new Error('Use only one of --session, --execution or --history');
|
|
35
|
+
if (!historyFlags.length && !has('--allow-empty-history')) {
|
|
36
|
+
throw new Error('Provide --session, --execution or --history. Use --allow-empty-history only for an explicitly history-free fixture.');
|
|
37
|
+
}
|
|
38
|
+
if (!existsSync(entry)) throw new Error(`Skill entry not found: ${entry}`);
|
|
39
|
+
if (!existsSync(scenariosPath)) throw new Error(`Scenario file not found: ${scenariosPath}`);
|
|
40
|
+
if (!existsSync(runner)) throw new Error(`Replay runner not found: ${runner}`);
|
|
41
|
+
if (!existsSync(memoryCli)) throw new Error(`Agent Memory CLI not found: ${memoryCli}`);
|
|
42
|
+
process.env.AGENT_MEMORY_CLI = memoryCli;
|
|
43
|
+
if (process.env.AGENT_MEMORY_DB) process.env.AGENT_MEMORY_DB = resolve(root, process.env.AGENT_MEMORY_DB);
|
|
44
|
+
|
|
45
|
+
const skillEntry = entry.replaceAll('\\', '/').replace(`${root.replaceAll('\\', '/')}/`, '');
|
|
46
|
+
if (!/^skills\/[a-z0-9]+(?:-[a-z0-9]+)*\/SKILL\.md$/i.test(skillEntry)) {
|
|
47
|
+
throw new Error('--skill must point to skills/<id>/SKILL.md');
|
|
48
|
+
}
|
|
49
|
+
const scenarios = JSON.parse(readFileSync(scenariosPath, 'utf8'));
|
|
50
|
+
if (!Array.isArray(scenarios) || scenarios.length < 2 ||
|
|
51
|
+
!scenarios.some(item => item.baseline === false) || !scenarios.some(item => item.baseline === true)) {
|
|
52
|
+
throw new Error('--scenarios must contain at least one baseline failure and one baseline pass');
|
|
53
|
+
}
|
|
54
|
+
let scenarioSet = scenarios.map(scenario => ({ ...scenario }));
|
|
55
|
+
|
|
56
|
+
const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
|
|
57
|
+
const outputDir = resolve(root, option('--output-dir', join('.agent-memory', 'evolution', timestamp)));
|
|
58
|
+
mkdirSync(outputDir, { recursive: true });
|
|
59
|
+
const statePath = join(outputDir, 'state.json');
|
|
60
|
+
const state = {
|
|
61
|
+
schema_version: 'workflow-evolve/1.0', target: skillEntry, iterations_requested: iterations,
|
|
62
|
+
max_retries: maxRetries, auto: has('--auto'), rounds: [], status: 'running',
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
function run(command, commandArgs, options = {}) {
|
|
66
|
+
const output = execFileSync(command, commandArgs, {
|
|
67
|
+
cwd: options.cwd ?? root, env: { ...process.env, ...options.env }, encoding: 'utf8', windowsHide: true,
|
|
68
|
+
stdio: ['pipe', 'pipe', 'pipe'], input: options.input, timeout: options.timeout ?? 180_000,
|
|
69
|
+
});
|
|
70
|
+
return output.trim();
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function jsonCommand(command, commandArgs, options = {}) {
|
|
74
|
+
const output = run(command, commandArgs, options);
|
|
75
|
+
try { return JSON.parse(output); } catch (error) { throw new Error(`Expected JSON from ${command}: ${output.slice(-2000)}`, { cause: error }); }
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function git(args) { return run('git', args); }
|
|
79
|
+
|
|
80
|
+
function runReplay(scenario, commit) {
|
|
81
|
+
const output = run(process.execPath, [runner], {
|
|
82
|
+
input: JSON.stringify({ id: `${scenario.id}-round-${state.rounds.length + 1}`, input: scenario.input,
|
|
83
|
+
entry: skillEntry, commit }),
|
|
84
|
+
});
|
|
85
|
+
return JSON.parse(output);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function parseAgyResponse(output) {
|
|
89
|
+
const clean = output.trim().replace(/^```json\s*/i, '').replace(/\s*```$/, '');
|
|
90
|
+
const parsed = JSON.parse(clean);
|
|
91
|
+
const text = typeof parsed?.response === 'string' ? parsed.response
|
|
92
|
+
: typeof parsed?.result === 'string' ? parsed.result
|
|
93
|
+
: typeof parsed?.output === 'string' ? parsed.output : null;
|
|
94
|
+
if (text === null) return parsed;
|
|
95
|
+
return JSON.parse(text.trim().replace(/^```json\s*/i, '').replace(/\s*```$/, ''));
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function askAgy(prompt) {
|
|
99
|
+
const output = run(agy, ['--mode', 'plan', '--output-format', 'text', `--print=${prompt}`], { timeout: 600_000 });
|
|
100
|
+
return parseAgyResponse(output);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function validateDiscussion(value) {
|
|
104
|
+
if (!value || typeof value !== 'object') throw new Error('Agy discussion must be a JSON object');
|
|
105
|
+
if (typeof value.approved !== 'boolean' || !['high', 'normal', 'low'].includes(value.priority) ||
|
|
106
|
+
typeof value.instruction !== 'string' || !value.instruction.trim() ||
|
|
107
|
+
!Array.isArray(value.evidence) || value.evidence.length === 0 || value.evidence.some(item => typeof item !== 'string' || !item.trim())) {
|
|
108
|
+
throw new Error('Agy discussion omitted approved, priority, instruction or evidence');
|
|
109
|
+
}
|
|
110
|
+
return value;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function validateConfirmation(value) {
|
|
114
|
+
if (!value || typeof value !== 'object' || typeof value.approved !== 'boolean' || typeof value.reason !== 'string') {
|
|
115
|
+
throw new Error('Agy confirmation must include approved and reason');
|
|
116
|
+
}
|
|
117
|
+
return value;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function reviewHistory(roundDir) {
|
|
121
|
+
const session = option('--session');
|
|
122
|
+
const execution = option('--execution');
|
|
123
|
+
const historyFile = option('--history');
|
|
124
|
+
if (historyFile) {
|
|
125
|
+
const history = JSON.parse(readFileSync(resolve(root, historyFile), 'utf8'));
|
|
126
|
+
writeFileSync(join(roundDir, 'history.json'), JSON.stringify(history, null, 2) + '\n');
|
|
127
|
+
return { source: historyFile, history };
|
|
128
|
+
}
|
|
129
|
+
if (session) {
|
|
130
|
+
const review = jsonCommand(process.execPath, [memoryCli, '--root', root, 'session', 'review', session]);
|
|
131
|
+
writeFileSync(join(roundDir, 'history.json'), JSON.stringify(review, null, 2) + '\n');
|
|
132
|
+
return { source: `session:${session}`, history: review };
|
|
133
|
+
}
|
|
134
|
+
if (execution) {
|
|
135
|
+
const project = option('--project', 'workflow-evolve');
|
|
136
|
+
const review = jsonCommand(process.execPath, [memoryCli, '--root', root, 'evolve', 'review', execution, '--project', project]);
|
|
137
|
+
writeFileSync(join(roundDir, 'history.json'), JSON.stringify(review, null, 2) + '\n');
|
|
138
|
+
return { source: `execution:${execution}`, history: review };
|
|
139
|
+
}
|
|
140
|
+
const history = { signals: [], note: 'No committed Session/Skill receipt was supplied for this round.' };
|
|
141
|
+
writeFileSync(join(roundDir, 'history.json'), JSON.stringify(history, null, 2) + '\n');
|
|
142
|
+
return { source: 'none', history };
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
function promptForDiscussion(roundDir, baseline, history, previous) {
|
|
146
|
+
const instruction = [
|
|
147
|
+
'You are the Agy discussion gate for workflow-evolve.',
|
|
148
|
+
`Read the Skill entry at ${entry} and the round files in ${roundDir}.`,
|
|
149
|
+
'Review the real Codex task result, memory search trace, and supplied execution history.',
|
|
150
|
+
'Propose one minimal Skill instruction that fixes the attributed failure while preserving the passing scenario.',
|
|
151
|
+
'Return strict JSON with fields approved, priority, instruction, when, evidence, rationale, needs_revision.',
|
|
152
|
+
'approved is true only when the suggestion is evidence-backed and bounded. priority is high, normal, or low.',
|
|
153
|
+
'instruction must be one concise line. evidence must be an array of source strings. Do not edit files.',
|
|
154
|
+
`Previous Agy response: ${previous ? JSON.stringify(previous) : 'none'}`,
|
|
155
|
+
`Baseline observations: ${JSON.stringify(baseline)}`,
|
|
156
|
+
`History: ${JSON.stringify(history)}`,
|
|
157
|
+
].join('\n');
|
|
158
|
+
return askAgy(instruction);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
function promptForConfirmation(roundDir, discussion, replay) {
|
|
162
|
+
return askAgy([
|
|
163
|
+
'You are the final Agy confirmation gate for workflow-evolve.',
|
|
164
|
+
`Read the Skill entry at ${entry} and the round files in ${roundDir}.`,
|
|
165
|
+
'Confirm whether the proposed Skill change is safe to apply after the baseline/candidate replay.',
|
|
166
|
+
'Return strict JSON with fields approved, reason, required_changes. approved must be false if any baseline pass regresses, the evidence is missing, or the replay is incomplete.',
|
|
167
|
+
`Discussion: ${JSON.stringify(discussion)}`,
|
|
168
|
+
`Replay receipt: ${JSON.stringify(replay)}`,
|
|
169
|
+
].join('\n'));
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
try {
|
|
173
|
+
for (let round = 1; round <= iterations; round += 1) {
|
|
174
|
+
const roundDir = join(outputDir, `round-${round}`);
|
|
175
|
+
mkdirSync(roundDir, { recursive: true });
|
|
176
|
+
const base = git(['rev-parse', 'HEAD']);
|
|
177
|
+
const baseline = scenarioSet.map(scenario => ({ id: scenario.id, expected: scenario.input?.expected,
|
|
178
|
+
observation: runReplay(scenario, base) }));
|
|
179
|
+
writeFileSync(join(roundDir, 'baseline.json'), JSON.stringify(baseline, null, 2) + '\n');
|
|
180
|
+
const regressions = baseline.filter(item => scenarioSet.find(scenario => scenario.id === item.id)?.baseline && !item.observation.passed);
|
|
181
|
+
if (regressions.length) {
|
|
182
|
+
state.rounds.push({ round, base, status: 'regression_detected', regressions });
|
|
183
|
+
break;
|
|
184
|
+
}
|
|
185
|
+
const unresolved = baseline.filter(item => {
|
|
186
|
+
const scenario = scenarioSet.find(candidate => candidate.id === item.id);
|
|
187
|
+
return scenario?.baseline === false && !item.observation.passed;
|
|
188
|
+
});
|
|
189
|
+
scenarioSet = scenarioSet.map(scenario => {
|
|
190
|
+
const result = baseline.find(item => item.id === scenario.id);
|
|
191
|
+
return result?.observation.passed ? { ...scenario, baseline: true } : scenario;
|
|
192
|
+
});
|
|
193
|
+
if (!unresolved.length) {
|
|
194
|
+
state.rounds.push({ round, base, status: 'converged', history: 'all scenarios passed' });
|
|
195
|
+
break;
|
|
196
|
+
}
|
|
197
|
+
const history = reviewHistory(roundDir);
|
|
198
|
+
let discussion;
|
|
199
|
+
let attempt = 0;
|
|
200
|
+
while (attempt <= maxRetries) {
|
|
201
|
+
discussion = validateDiscussion(promptForDiscussion(roundDir, baseline, history.history, discussion));
|
|
202
|
+
writeFileSync(join(roundDir, 'agy-discussion.json'), JSON.stringify(discussion, null, 2) + '\n');
|
|
203
|
+
if (discussion.approved) break;
|
|
204
|
+
attempt += 1;
|
|
205
|
+
}
|
|
206
|
+
if (!discussion?.approved) {
|
|
207
|
+
state.rounds.push({ round, base, status: 'agy_rejected', retries: attempt, history: history.source });
|
|
208
|
+
break;
|
|
209
|
+
}
|
|
210
|
+
const draft = jsonCommand(process.execPath, [memoryCli, '--root', root, 'evolve', 'draft', entry,
|
|
211
|
+
discussion.instruction, '--priority', discussion.priority, ...(discussion.when ? ['--when', discussion.when] : []),
|
|
212
|
+
...discussion.evidence.flatMap(item => ['--evidence', item])]);
|
|
213
|
+
const draftPath = join(roundDir, 'draft.json');
|
|
214
|
+
writeFileSync(draftPath, JSON.stringify(draft, null, 2) + '\n');
|
|
215
|
+
const scenarioPath = join(roundDir, 'scenarios.json');
|
|
216
|
+
writeFileSync(scenarioPath, JSON.stringify(scenarioSet, null, 2) + '\n');
|
|
217
|
+
const replay = jsonCommand(process.execPath, [memoryCli, '--root', root, 'evolve', 'replay', draftPath, '--runner', runner, '--scenarios', scenarioPath]);
|
|
218
|
+
writeFileSync(join(roundDir, 'replay.json'), JSON.stringify(replay, null, 2) + '\n');
|
|
219
|
+
const confirmation = validateConfirmation(promptForConfirmation(roundDir, discussion, replay));
|
|
220
|
+
writeFileSync(join(roundDir, 'agy-confirmation.json'), JSON.stringify(confirmation, null, 2) + '\n');
|
|
221
|
+
const result = { round, base, draft: draft.id, replay: replay.id, history: history.source, agy: confirmation };
|
|
222
|
+
if (!confirmation.approved) {
|
|
223
|
+
state.rounds.push({ ...result, status: 'confirmation_rejected' });
|
|
224
|
+
break;
|
|
225
|
+
}
|
|
226
|
+
if (has('--auto')) {
|
|
227
|
+
const applied = jsonCommand(process.execPath, [memoryCli, '--root', root, 'evolve', 'apply', replay.id]);
|
|
228
|
+
const verified = scenarioSet.map(scenario => ({ id: scenario.id, observation: runReplay(scenario, applied.commit) }));
|
|
229
|
+
const passed = verified.every(item => item.observation.passed);
|
|
230
|
+
if (!passed) {
|
|
231
|
+
jsonCommand(process.execPath, [memoryCli, '--root', root, 'evolve', 'rollback', replay.id]);
|
|
232
|
+
state.rounds.push({ ...result, status: 'rolled_back', applied, verified });
|
|
233
|
+
break;
|
|
234
|
+
}
|
|
235
|
+
state.rounds.push({ ...result, status: 'applied', applied, verified });
|
|
236
|
+
} else {
|
|
237
|
+
state.rounds.push({ ...result, status: 'confirmed_pending_apply' });
|
|
238
|
+
break;
|
|
239
|
+
}
|
|
240
|
+
writeFileSync(statePath, JSON.stringify(state, null, 2) + '\n');
|
|
241
|
+
}
|
|
242
|
+
state.status = 'completed';
|
|
243
|
+
state.finished_at = new Date().toISOString();
|
|
244
|
+
state.state_sha256 = createHash('sha256').update(JSON.stringify(state)).digest('hex');
|
|
245
|
+
writeFileSync(statePath, JSON.stringify(state, null, 2) + '\n');
|
|
246
|
+
const report = { output_dir: outputDir, ...state };
|
|
247
|
+
const runDir = option('--run-dir', process.env.RUN_DIR);
|
|
248
|
+
const reportPath = runDir ? join(runDir, 'outputs', 'evolution-report.json') : join(outputDir, 'evolution-report.json');
|
|
249
|
+
mkdirSync(dirname(reportPath), { recursive: true });
|
|
250
|
+
const artifact = runDir ? { ...report, _meta: {
|
|
251
|
+
kind: 'workflow-evolution-report', schema: 'workflow-evolution/1.0', role: 'primary', alias: 'latest-workflow-evolution',
|
|
252
|
+
} } : report;
|
|
253
|
+
writeFileSync(reportPath, JSON.stringify(artifact, null, 2) + '\n');
|
|
254
|
+
console.log(JSON.stringify(report, null, 2));
|
|
255
|
+
} catch (error) {
|
|
256
|
+
state.status = 'failed';
|
|
257
|
+
state.error = error instanceof Error ? error.message : String(error);
|
|
258
|
+
writeFileSync(statePath, JSON.stringify(state, null, 2) + '\n');
|
|
259
|
+
throw error;
|
|
260
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { execFileSync } from 'node:child_process';
|
|
3
|
+
import { readFileSync, writeFileSync } from 'node:fs';
|
|
4
|
+
import { posix } from 'node:path';
|
|
5
|
+
import { createInterface } from 'node:readline';
|
|
6
|
+
|
|
7
|
+
const [memoryCli, root, db, entry, commit, statePath, tracePath] = process.argv.slice(2);
|
|
8
|
+
const packageRoot = posix.dirname(entry);
|
|
9
|
+
const files = new Map();
|
|
10
|
+
const loaded = new Map();
|
|
11
|
+
for (const record of git('ls-tree', '-r', '-z', commit, '--', packageRoot).toString('utf8').split('\0')) {
|
|
12
|
+
const match = /^100(?:644|755) blob ([a-f0-9]+)\t(.+)$/s.exec(record);
|
|
13
|
+
if (match && /\.md$/i.test(match[2])) files.set(match[2], match[1]);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function git(...args) {
|
|
17
|
+
return execFileSync('git', args, { cwd: root, windowsHide: true, stdio: ['ignore', 'pipe', 'pipe'] });
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const toolDefinitions = [
|
|
21
|
+
{
|
|
22
|
+
name: 'read_skill',
|
|
23
|
+
description: 'Read the bound Skill entry. Follow a declared Markdown link by supplying its destination and the path of the source document.',
|
|
24
|
+
annotations: { readOnlyHint: true, openWorldHint: false },
|
|
25
|
+
inputSchema: {
|
|
26
|
+
type: 'object', properties: { destination: { type: 'string' }, from: { type: 'string' } },
|
|
27
|
+
additionalProperties: false,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: 'memory_search',
|
|
32
|
+
description: 'Search Agent Memory for guidance relevant to the current task.',
|
|
33
|
+
annotations: { readOnlyHint: true, openWorldHint: false },
|
|
34
|
+
inputSchema: {
|
|
35
|
+
type: 'object', properties: { query: { type: 'string' } }, required: ['query'], additionalProperties: false,
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: 'memory_get',
|
|
40
|
+
description: 'Read one Agent Memory item returned by memory_search.',
|
|
41
|
+
annotations: { readOnlyHint: true, openWorldHint: false },
|
|
42
|
+
inputSchema: {
|
|
43
|
+
type: 'object', properties: { id: { type: 'string' } }, required: ['id'], additionalProperties: false,
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
];
|
|
47
|
+
|
|
48
|
+
function callMemory(...args) {
|
|
49
|
+
const output = execFileSync(process.execPath, [memoryCli, '--root', root, '--db', db, '--reads', tracePath, ...args], {
|
|
50
|
+
cwd: root, encoding: 'utf8', windowsHide: true, stdio: ['ignore', 'pipe', 'pipe'],
|
|
51
|
+
});
|
|
52
|
+
return JSON.parse(output);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function readSkill({ from, destination }) {
|
|
56
|
+
let path = entry;
|
|
57
|
+
if (from !== undefined || destination !== undefined) {
|
|
58
|
+
const source = loaded.get(from);
|
|
59
|
+
if (!source || typeof destination !== 'string') {
|
|
60
|
+
throw new Error('Supply the destination and a previously read source path');
|
|
61
|
+
}
|
|
62
|
+
const links = [...source.markdown.matchAll(/\[[^\]]*\]\(\s*(<[^>]+>|[^\s)]+)/g)]
|
|
63
|
+
.map(match => match[1].replace(/^<|>$/g, ''));
|
|
64
|
+
const target = destination.split('#', 1)[0];
|
|
65
|
+
if (!target || /[\\:]/.test(target) || posix.isAbsolute(target) || !links.includes(destination)) {
|
|
66
|
+
throw new Error('Select a declared relative Markdown link from the source');
|
|
67
|
+
}
|
|
68
|
+
path = posix.join(posix.dirname(from), target);
|
|
69
|
+
}
|
|
70
|
+
const blob = files.get(path);
|
|
71
|
+
if (!blob) throw new Error(`Skill document is unavailable in the bound package: ${path}`);
|
|
72
|
+
const bytes = git('cat-file', 'blob', blob);
|
|
73
|
+
const markdown = bytes.toString('utf8');
|
|
74
|
+
loaded.set(path, { markdown, sha256: createHash('sha256').update(bytes).digest('hex') });
|
|
75
|
+
writeFileSync(statePath, JSON.stringify([...loaded].map(([path, { sha256 }]) => ({ path, sha256 }))));
|
|
76
|
+
return { path, markdown };
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function getMemory(id) {
|
|
80
|
+
const { searches } = JSON.parse(readFileSync(tracePath, 'utf8'));
|
|
81
|
+
const search = searches.findLast(item => item.returned_ids.includes(id));
|
|
82
|
+
if (!search) throw new Error('Select a memory ID returned by a search in this replay');
|
|
83
|
+
return callMemory('memory', 'get', id, '--from-search', search.search_id);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
async function handle(line) {
|
|
87
|
+
const request = JSON.parse(line);
|
|
88
|
+
if (request.id === undefined) return;
|
|
89
|
+
try {
|
|
90
|
+
let value;
|
|
91
|
+
switch (request.method) {
|
|
92
|
+
case 'initialize':
|
|
93
|
+
value = { protocolVersion: request.params?.protocolVersion, capabilities: { tools: {} }, serverInfo: { name: 'workflow-evolve-memory', version: '1.0.0' } };
|
|
94
|
+
break;
|
|
95
|
+
case 'ping': value = {}; break;
|
|
96
|
+
case 'tools/list': value = { tools: toolDefinitions }; break;
|
|
97
|
+
case 'tools/call': {
|
|
98
|
+
const name = request.params?.name;
|
|
99
|
+
const args = request.params?.arguments ?? {};
|
|
100
|
+
if (name === 'read_skill') value = readSkill(args);
|
|
101
|
+
else if (name === 'memory_search' && typeof args.query === 'string' && args.query.trim()) value = callMemory('memory', 'search', args.query);
|
|
102
|
+
else if (name === 'memory_get' && typeof args.id === 'string' && args.id.trim()) value = getMemory(args.id);
|
|
103
|
+
else throw new Error(`Unsupported memory tool call: ${name}`);
|
|
104
|
+
break;
|
|
105
|
+
}
|
|
106
|
+
default: process.stdout.write(JSON.stringify({ jsonrpc: '2.0', id: request.id, error: { code: -32601, message: 'Method not found' } }) + '\n'); return;
|
|
107
|
+
}
|
|
108
|
+
const result = request.method === 'tools/call'
|
|
109
|
+
? { content: [{ type: 'text', text: JSON.stringify(value) }] }
|
|
110
|
+
: value;
|
|
111
|
+
process.stdout.write(JSON.stringify({ jsonrpc: '2.0', id: request.id, result }) + '\n');
|
|
112
|
+
} catch (error) {
|
|
113
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
114
|
+
if (request.method === 'tools/call') {
|
|
115
|
+
process.stdout.write(JSON.stringify({ jsonrpc: '2.0', id: request.id,
|
|
116
|
+
result: { isError: true, content: [{ type: 'text', text: message }] } }) + '\n');
|
|
117
|
+
} else {
|
|
118
|
+
process.stdout.write(JSON.stringify({ jsonrpc: '2.0', id: request.id,
|
|
119
|
+
error: { code: -32000, message } }) + '\n');
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
for await (const line of createInterface({ input: process.stdin, crlfDelay: Infinity })) await handle(line.replace(/^\uFEFF/, ''));
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
[
|
|
2
|
+
{ "id": "session-run", "path": "skills/ew-orchestrate/references/orchestrator-run-loop.md" },
|
|
3
|
+
{ "id": "ew-orchestrate", "path": "skills/ew-orchestrate/references/ew-orchestrate.md" },
|
|
4
|
+
{ "id": "ew-companion", "path": "skills/ew-orchestrate/steps/ew-companion/SKILL.md" },
|
|
5
|
+
{ "id": "ew-init", "path": "skills/ew-orchestrate/steps/ew-init/references/workflow.md" },
|
|
6
|
+
{ "id": "ew-brainstorm", "path": "skills/ew-orchestrate/steps/ew-brainstorm/SKILL.md" },
|
|
7
|
+
{ "id": "ew-grill", "path": "skills/ew-orchestrate/steps/ew-grill/references/workflow.md" },
|
|
8
|
+
{ "id": "ew-blueprint", "path": "skills/ew-orchestrate/steps/ew-blueprint/references/workflow.md" },
|
|
9
|
+
{ "id": "ew-roadmap", "path": "skills/ew-orchestrate/steps/ew-roadmap/references/workflow.md" },
|
|
10
|
+
{ "id": "ew-analyze", "path": "skills/ew-orchestrate/steps/ew-analyze/references/workflow.md" },
|
|
11
|
+
{ "id": "ew-plan", "path": "skills/ew-orchestrate/steps/ew-plan/references/workflow.md" },
|
|
12
|
+
{ "id": "ew-execute", "path": "skills/ew-orchestrate/steps/ew-execute/references/workflow.md" },
|
|
13
|
+
{ "id": "ew-verify", "path": "skills/ew-orchestrate/steps/ew-verify/references/workflow.md" },
|
|
14
|
+
{ "id": "ew-test", "path": "skills/ew-orchestrate/steps/ew-test/references/workflow.md" },
|
|
15
|
+
{ "id": "ew-auto-test", "path": "skills/ew-orchestrate/steps/ew-auto-test/references/workflow.md" },
|
|
16
|
+
{ "id": "ew-review", "path": "skills/ew-orchestrate/steps/ew-review/references/workflow.md" },
|
|
17
|
+
{ "id": "ew-debug", "path": "skills/ew-orchestrate/steps/ew-debug/references/workflow.md" },
|
|
18
|
+
{ "id": "ew-retrospective", "path": "skills/ew-orchestrate/steps/ew-retrospective/references/workflow.md" },
|
|
19
|
+
{ "id": "ew-odyssey", "path": "skills/ew-odyssey/references/odyssey-base.md" },
|
|
20
|
+
{ "id": "ew-odyssey-debug", "path": "skills/ew-odyssey/references/odyssey-debug.md" },
|
|
21
|
+
{ "id": "ew-odyssey-improve", "path": "skills/ew-odyssey/references/odyssey-improve.md" },
|
|
22
|
+
{ "id": "ew-odyssey-planex", "path": "skills/ew-odyssey/references/odyssey-planex.md" },
|
|
23
|
+
{ "id": "ew-odyssey-review", "path": "skills/ew-odyssey/references/odyssey-review.md" },
|
|
24
|
+
{ "id": "ew-odyssey-security", "path": "skills/ew-odyssey/references/odyssey-security.md" },
|
|
25
|
+
{ "id": "ew-odyssey-defensive", "path": "skills/ew-odyssey/references/odyssey-defensive.md" },
|
|
26
|
+
{ "id": "ew-odyssey-ui", "path": "skills/ew-odyssey/references/odyssey-ui.md" },
|
|
27
|
+
{ "id": "ew-impeccable", "path": "skills/ew-impeccable/SKILL.md" },
|
|
28
|
+
{ "id": "team-swarm", "path": "skills/team-swarm/specs/swarm-protocol.md" },
|
|
29
|
+
{ "id": "ew-knowledge", "path": "skills/ew-knowledge/SKILL.md" },
|
|
30
|
+
{ "id": "ew-skill-design", "path": "skills/ew-skill-design/references/package-contract.md" },
|
|
31
|
+
{ "id": "workflow-evolve", "path": "skills/workflow-evolve/references/auto-loop.md" },
|
|
32
|
+
{ "id": "release-gate", "path": "skills/release-gate/SKILL.md" }
|
|
33
|
+
]
|