kenaz 0.0.0-stage → 0.3.2
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/bin/kenaz.js +3 -0
- package/core/.agents/skills/remotion-best-practices/SKILL.md +61 -0
- package/core/.agents/skills/remotion-best-practices/rules/3d.md +86 -0
- package/core/.agents/skills/remotion-best-practices/rules/animations.md +27 -0
- package/core/.agents/skills/remotion-best-practices/rules/assets/charts-bar-chart.tsx +173 -0
- package/core/.agents/skills/remotion-best-practices/rules/assets/text-animations-typewriter.tsx +100 -0
- package/core/.agents/skills/remotion-best-practices/rules/assets/text-animations-word-highlight.tsx +103 -0
- package/core/.agents/skills/remotion-best-practices/rules/assets.md +78 -0
- package/core/.agents/skills/remotion-best-practices/rules/audio-visualization.md +198 -0
- package/core/.agents/skills/remotion-best-practices/rules/audio.md +169 -0
- package/core/.agents/skills/remotion-best-practices/rules/calculate-metadata.md +134 -0
- package/core/.agents/skills/remotion-best-practices/rules/can-decode.md +81 -0
- package/core/.agents/skills/remotion-best-practices/rules/charts.md +120 -0
- package/core/.agents/skills/remotion-best-practices/rules/compositions.md +154 -0
- package/core/.agents/skills/remotion-best-practices/rules/display-captions.md +184 -0
- package/core/.agents/skills/remotion-best-practices/rules/extract-frames.md +229 -0
- package/core/.agents/skills/remotion-best-practices/rules/ffmpeg.md +38 -0
- package/core/.agents/skills/remotion-best-practices/rules/fonts.md +152 -0
- package/core/.agents/skills/remotion-best-practices/rules/get-audio-duration.md +58 -0
- package/core/.agents/skills/remotion-best-practices/rules/get-video-dimensions.md +68 -0
- package/core/.agents/skills/remotion-best-practices/rules/get-video-duration.md +60 -0
- package/core/.agents/skills/remotion-best-practices/rules/gifs.md +141 -0
- package/core/.agents/skills/remotion-best-practices/rules/images.md +134 -0
- package/core/.agents/skills/remotion-best-practices/rules/import-srt-captions.md +69 -0
- package/core/.agents/skills/remotion-best-practices/rules/light-leaks.md +73 -0
- package/core/.agents/skills/remotion-best-practices/rules/lottie.md +70 -0
- package/core/.agents/skills/remotion-best-practices/rules/maps.md +412 -0
- package/core/.agents/skills/remotion-best-practices/rules/measuring-dom-nodes.md +34 -0
- package/core/.agents/skills/remotion-best-practices/rules/measuring-text.md +140 -0
- package/core/.agents/skills/remotion-best-practices/rules/parameters.md +109 -0
- package/core/.agents/skills/remotion-best-practices/rules/sequencing.md +118 -0
- package/core/.agents/skills/remotion-best-practices/rules/sfx.md +30 -0
- package/core/.agents/skills/remotion-best-practices/rules/subtitles.md +36 -0
- package/core/.agents/skills/remotion-best-practices/rules/tailwind.md +11 -0
- package/core/.agents/skills/remotion-best-practices/rules/text-animations.md +20 -0
- package/core/.agents/skills/remotion-best-practices/rules/timing.md +179 -0
- package/core/.agents/skills/remotion-best-practices/rules/transcribe-captions.md +70 -0
- package/core/.agents/skills/remotion-best-practices/rules/transitions.md +197 -0
- package/core/.agents/skills/remotion-best-practices/rules/transparent-videos.md +106 -0
- package/core/.agents/skills/remotion-best-practices/rules/trimming.md +51 -0
- package/core/.agents/skills/remotion-best-practices/rules/videos.md +171 -0
- package/core/.agents/skills/remotion-best-practices/rules/voiceover.md +99 -0
- package/core/.agents/skills/supabase-postgres-best-practices/AGENTS.md +90 -0
- package/core/.agents/skills/supabase-postgres-best-practices/CLAUDE.md +1 -0
- package/core/.agents/skills/supabase-postgres-best-practices/SKILL.md +64 -0
- package/core/.agents/skills/supabase-postgres-best-practices/references/advanced-full-text-search.md +55 -0
- package/core/.agents/skills/supabase-postgres-best-practices/references/advanced-jsonb-indexing.md +49 -0
- package/core/.agents/skills/supabase-postgres-best-practices/references/conn-idle-timeout.md +46 -0
- package/core/.agents/skills/supabase-postgres-best-practices/references/conn-limits.md +44 -0
- package/core/.agents/skills/supabase-postgres-best-practices/references/conn-pooling.md +41 -0
- package/core/.agents/skills/supabase-postgres-best-practices/references/conn-prepared-statements.md +46 -0
- package/core/.agents/skills/supabase-postgres-best-practices/references/data-batch-inserts.md +54 -0
- package/core/.agents/skills/supabase-postgres-best-practices/references/data-n-plus-one.md +53 -0
- package/core/.agents/skills/supabase-postgres-best-practices/references/data-pagination.md +50 -0
- package/core/.agents/skills/supabase-postgres-best-practices/references/data-upsert.md +50 -0
- package/core/.agents/skills/supabase-postgres-best-practices/references/lock-advisory.md +56 -0
- package/core/.agents/skills/supabase-postgres-best-practices/references/lock-deadlock-prevention.md +68 -0
- package/core/.agents/skills/supabase-postgres-best-practices/references/lock-short-transactions.md +50 -0
- package/core/.agents/skills/supabase-postgres-best-practices/references/lock-skip-locked.md +54 -0
- package/core/.agents/skills/supabase-postgres-best-practices/references/monitor-explain-analyze.md +45 -0
- package/core/.agents/skills/supabase-postgres-best-practices/references/monitor-pg-stat-statements.md +55 -0
- package/core/.agents/skills/supabase-postgres-best-practices/references/monitor-vacuum-analyze.md +55 -0
- package/core/.agents/skills/supabase-postgres-best-practices/references/query-composite-indexes.md +44 -0
- package/core/.agents/skills/supabase-postgres-best-practices/references/query-covering-indexes.md +40 -0
- package/core/.agents/skills/supabase-postgres-best-practices/references/query-index-types.md +45 -0
- package/core/.agents/skills/supabase-postgres-best-practices/references/query-missing-indexes.md +43 -0
- package/core/.agents/skills/supabase-postgres-best-practices/references/query-partial-indexes.md +45 -0
- package/core/.agents/skills/supabase-postgres-best-practices/references/schema-data-types.md +46 -0
- package/core/.agents/skills/supabase-postgres-best-practices/references/schema-foreign-key-indexes.md +59 -0
- package/core/.agents/skills/supabase-postgres-best-practices/references/schema-lowercase-identifiers.md +55 -0
- package/core/.agents/skills/supabase-postgres-best-practices/references/schema-partitioning.md +55 -0
- package/core/.agents/skills/supabase-postgres-best-practices/references/schema-primary-keys.md +61 -0
- package/core/.agents/skills/supabase-postgres-best-practices/references/security-privileges.md +54 -0
- package/core/.agents/skills/supabase-postgres-best-practices/references/security-rls-basics.md +50 -0
- package/core/.agents/skills/supabase-postgres-best-practices/references/security-rls-performance.md +57 -0
- package/core/.agents/skills/typesafe-ai/LICENSE +21 -0
- package/core/.agents/skills/typesafe-ai/SKILL.md +149 -0
- package/core/.agents/skills/vercel-react-best-practices/AGENTS.md +2934 -0
- package/core/.agents/skills/vercel-react-best-practices/SKILL.md +136 -0
- package/core/.agents/skills/vercel-react-best-practices/rules/advanced-event-handler-refs.md +55 -0
- package/core/.agents/skills/vercel-react-best-practices/rules/advanced-init-once.md +42 -0
- package/core/.agents/skills/vercel-react-best-practices/rules/advanced-use-latest.md +39 -0
- package/core/.agents/skills/vercel-react-best-practices/rules/async-api-routes.md +38 -0
- package/core/.agents/skills/vercel-react-best-practices/rules/async-defer-await.md +80 -0
- package/core/.agents/skills/vercel-react-best-practices/rules/async-dependencies.md +51 -0
- package/core/.agents/skills/vercel-react-best-practices/rules/async-parallel.md +28 -0
- package/core/.agents/skills/vercel-react-best-practices/rules/async-suspense-boundaries.md +99 -0
- package/core/.agents/skills/vercel-react-best-practices/rules/bundle-barrel-imports.md +59 -0
- package/core/.agents/skills/vercel-react-best-practices/rules/bundle-conditional.md +31 -0
- package/core/.agents/skills/vercel-react-best-practices/rules/bundle-defer-third-party.md +49 -0
- package/core/.agents/skills/vercel-react-best-practices/rules/bundle-dynamic-imports.md +35 -0
- package/core/.agents/skills/vercel-react-best-practices/rules/bundle-preload.md +50 -0
- package/core/.agents/skills/vercel-react-best-practices/rules/client-event-listeners.md +74 -0
- package/core/.agents/skills/vercel-react-best-practices/rules/client-localstorage-schema.md +71 -0
- package/core/.agents/skills/vercel-react-best-practices/rules/client-passive-event-listeners.md +48 -0
- package/core/.agents/skills/vercel-react-best-practices/rules/client-swr-dedup.md +56 -0
- package/core/.agents/skills/vercel-react-best-practices/rules/js-batch-dom-css.md +107 -0
- package/core/.agents/skills/vercel-react-best-practices/rules/js-cache-function-results.md +80 -0
- package/core/.agents/skills/vercel-react-best-practices/rules/js-cache-property-access.md +28 -0
- package/core/.agents/skills/vercel-react-best-practices/rules/js-cache-storage.md +70 -0
- package/core/.agents/skills/vercel-react-best-practices/rules/js-combine-iterations.md +32 -0
- package/core/.agents/skills/vercel-react-best-practices/rules/js-early-exit.md +50 -0
- package/core/.agents/skills/vercel-react-best-practices/rules/js-hoist-regexp.md +45 -0
- package/core/.agents/skills/vercel-react-best-practices/rules/js-index-maps.md +37 -0
- package/core/.agents/skills/vercel-react-best-practices/rules/js-length-check-first.md +49 -0
- package/core/.agents/skills/vercel-react-best-practices/rules/js-min-max-loop.md +82 -0
- package/core/.agents/skills/vercel-react-best-practices/rules/js-set-map-lookups.md +24 -0
- package/core/.agents/skills/vercel-react-best-practices/rules/js-tosorted-immutable.md +57 -0
- package/core/.agents/skills/vercel-react-best-practices/rules/rendering-activity.md +26 -0
- package/core/.agents/skills/vercel-react-best-practices/rules/rendering-animate-svg-wrapper.md +47 -0
- package/core/.agents/skills/vercel-react-best-practices/rules/rendering-conditional-render.md +40 -0
- package/core/.agents/skills/vercel-react-best-practices/rules/rendering-content-visibility.md +38 -0
- package/core/.agents/skills/vercel-react-best-practices/rules/rendering-hoist-jsx.md +46 -0
- package/core/.agents/skills/vercel-react-best-practices/rules/rendering-hydration-no-flicker.md +82 -0
- package/core/.agents/skills/vercel-react-best-practices/rules/rendering-hydration-suppress-warning.md +30 -0
- package/core/.agents/skills/vercel-react-best-practices/rules/rendering-svg-precision.md +28 -0
- package/core/.agents/skills/vercel-react-best-practices/rules/rendering-usetransition-loading.md +75 -0
- package/core/.agents/skills/vercel-react-best-practices/rules/rerender-defer-reads.md +39 -0
- package/core/.agents/skills/vercel-react-best-practices/rules/rerender-dependencies.md +45 -0
- package/core/.agents/skills/vercel-react-best-practices/rules/rerender-derived-state-no-effect.md +40 -0
- package/core/.agents/skills/vercel-react-best-practices/rules/rerender-derived-state.md +29 -0
- package/core/.agents/skills/vercel-react-best-practices/rules/rerender-functional-setstate.md +74 -0
- package/core/.agents/skills/vercel-react-best-practices/rules/rerender-lazy-state-init.md +58 -0
- package/core/.agents/skills/vercel-react-best-practices/rules/rerender-memo-with-default-value.md +38 -0
- package/core/.agents/skills/vercel-react-best-practices/rules/rerender-memo.md +44 -0
- package/core/.agents/skills/vercel-react-best-practices/rules/rerender-move-effect-to-event.md +45 -0
- package/core/.agents/skills/vercel-react-best-practices/rules/rerender-simple-expression-in-memo.md +35 -0
- package/core/.agents/skills/vercel-react-best-practices/rules/rerender-transitions.md +40 -0
- package/core/.agents/skills/vercel-react-best-practices/rules/rerender-use-ref-transient-values.md +73 -0
- package/core/.agents/skills/vercel-react-best-practices/rules/server-after-nonblocking.md +73 -0
- package/core/.agents/skills/vercel-react-best-practices/rules/server-auth-actions.md +96 -0
- package/core/.agents/skills/vercel-react-best-practices/rules/server-cache-lru.md +41 -0
- package/core/.agents/skills/vercel-react-best-practices/rules/server-cache-react.md +76 -0
- package/core/.agents/skills/vercel-react-best-practices/rules/server-dedup-props.md +65 -0
- package/core/.agents/skills/vercel-react-best-practices/rules/server-parallel-fetching.md +83 -0
- package/core/.agents/skills/vercel-react-best-practices/rules/server-serialization.md +38 -0
- package/core/.claude/agents/pcb-reviewer.md +146 -0
- package/core/.claude/commands/Amelia.md +5 -0
- package/core/.claude/commands/Ansuz.md +38 -0
- package/core/.claude/commands/Huginn.md +25 -0
- package/core/.claude/commands/agent-worker.md +168 -0
- package/core/.claude/commands/architect.md +24 -0
- package/core/.claude/commands/archive.md +24 -0
- package/core/.claude/commands/canary.md +17 -0
- package/core/.claude/commands/incident.md +15 -0
- package/core/.claude/commands/init.md +112 -0
- package/core/.claude/commands/legacy_dev.md +18 -0
- package/core/.claude/commands/product-review.md +131 -0
- package/core/.claude/commands/review.md +14 -0
- package/core/.claude/commands/security.md +15 -0
- package/core/.claude/commands/spec.md +22 -0
- package/core/.claude/commands/strategy.md +141 -0
- package/core/.claude/commands/sunny.md +1 -0
- package/core/.claude/commands//347/224/242/345/223/201.md +15 -0
- package/core/.claude/commands//347/224/242/345/223/201/346/252/242/350/246/226.md +129 -0
- package/core/.claude/commands//350/250/255/350/250/210.md +14 -0
- package/core/.claude/commands//350/251/225/344/274/260.md +16 -0
- package/core/.claude/commands//351/200/262/345/272/246.md +15 -0
- package/core/.claude/hooks/__tests__/substrate.test.js +122 -0
- package/core/.claude/hooks/__tests__/task-1866-cli-guard.test.js +193 -0
- package/core/.claude/hooks/__tests__/task-1977-dedupe-guard.test.js +125 -0
- package/core/.claude/hooks/__tests__/task-2087-mark-landed-idempotent.test.js +128 -0
- package/core/.claude/hooks/__tests__/task-2253-null-tip-marker-reuse.test.js +84 -0
- package/core/.claude/hooks/__tests__/task-2381-project-guard-walkup.test.js +53 -0
- package/core/.claude/hooks/_ansuz-conversation.js +183 -0
- package/core/.claude/hooks/_ansuz-conversation.test.js +90 -0
- package/core/.claude/hooks/_dedupe-guard.js +75 -0
- package/core/.claude/hooks/_peer-project-root.js +113 -0
- package/core/.claude/hooks/_peer-project-root.test.js +121 -0
- package/core/.claude/hooks/_peer-waiting-line.js +27 -0
- package/core/.claude/hooks/_project-guard.js +45 -0
- package/core/.claude/hooks/_run-user-prompt.js +134 -0
- package/core/.claude/hooks/_run-user-prompt.test.js +80 -0
- package/core/.claude/hooks/_session-identity.js +62 -0
- package/core/.claude/hooks/_session-pin.js +34 -0
- package/core/.claude/hooks/_session-pin.test.js +89 -0
- package/core/.claude/hooks/_signal-fence.js +17 -0
- package/core/.claude/hooks/_substrate-paths.js +95 -0
- package/core/.claude/hooks/_user-scope.js +23 -0
- package/core/.claude/hooks/ansuz-session-pin-via-turn-context.test.js +52 -0
- package/core/.claude/hooks/ansuz-session-pin.js +171 -0
- package/core/.claude/hooks/ansuz-session-pin.test.js +140 -0
- package/core/.claude/hooks/context-check.js +51 -0
- package/core/.claude/hooks/core-resolve.js +230 -0
- package/core/.claude/hooks/daemon-outbox-hook.js +139 -0
- package/core/.claude/hooks/fatigue-check.js +52 -0
- package/core/.claude/hooks/handoff-snapshot-on-commit.js +154 -0
- package/core/.claude/hooks/handoff-snapshot-on-decision.js +188 -0
- package/core/.claude/hooks/handoff-snapshot-on-question.js +158 -0
- package/core/.claude/hooks/handoff-staleness.js +197 -0
- package/core/.claude/hooks/jev-thalamus-context.js +17 -0
- package/core/.claude/hooks/jev-thalamus-context.test.js +41 -0
- package/core/.claude/hooks/lease-release.js +119 -0
- package/core/.claude/hooks/lease-touch.js +96 -0
- package/core/.claude/hooks/memory-guard.js +723 -0
- package/core/.claude/hooks/memory-guard.test.js +574 -0
- package/core/.claude/hooks/reflex-feedback.js +5 -0
- package/core/.claude/hooks/session-init.ps1 +49 -0
- package/core/.claude/hooks/sound-event.js +70 -0
- package/core/.claude/hooks/sound-event.sh +37 -0
- package/core/.claude/hooks/stream-delta.js +169 -0
- package/core/.claude/hooks/synapse-first-investigation.js +326 -0
- package/core/.claude/hooks/synapse-first-investigation.test.js +126 -0
- package/core/.claude/hooks/task-bridge.js +33 -0
- package/core/.claude/hooks/turn-context-peer.test.js +115 -0
- package/core/.claude/hooks/turn-context-session-line.test.js +69 -0
- package/core/.claude/hooks/turn-context.js +215 -0
- package/core/.claude/hooks/worktree-create.js +1232 -0
- package/core/.claude/hooks/worktree-remove.js +181 -0
- package/core/.claude/no-hooks.settings.json +3 -0
- package/core/.claude/settings.json +180 -0
- package/core/.claude/skills/adapt/SKILL.md +199 -0
- package/core/.claude/skills/animate/SKILL.md +190 -0
- package/core/.claude/skills/architect_agent/SKILL.md +408 -0
- package/core/.claude/skills/assessment_agent/SKILL.md +289 -0
- package/core/.claude/skills/audit/SKILL.md +129 -0
- package/core/.claude/skills/backend_agent/SKILL.md +407 -0
- package/core/.claude/skills/backend_engineer/SKILL.md +788 -0
- package/core/.claude/skills/bolder/SKILL.md +132 -0
- package/core/.claude/skills/clarify/SKILL.md +180 -0
- package/core/.claude/skills/code_reviewer/SKILL.md +305 -0
- package/core/.claude/skills/code_reviewer/patterns.yaml +85 -0
- package/core/.claude/skills/colorize/SKILL.md +158 -0
- package/core/.claude/skills/critique/SKILL.md +118 -0
- package/core/.claude/skills/delight/SKILL.md +317 -0
- package/core/.claude/skills/designer/SKILL.md +845 -0
- package/core/.claude/skills/dev_agent/SKILL.md +503 -0
- package/core/.claude/skills/developer/SKILL.md +792 -0
- package/core/.claude/skills/distill/SKILL.md +137 -0
- package/core/.claude/skills/extract/SKILL.md +95 -0
- package/core/.claude/skills/feature_agent/SKILL.md +303 -0
- package/core/.claude/skills/frontend-design/SKILL.md +127 -0
- package/core/.claude/skills/frontend-design/reference/color-and-contrast.md +132 -0
- package/core/.claude/skills/frontend-design/reference/interaction-design.md +123 -0
- package/core/.claude/skills/frontend-design/reference/motion-design.md +99 -0
- package/core/.claude/skills/frontend-design/reference/responsive-design.md +114 -0
- package/core/.claude/skills/frontend-design/reference/spatial-design.md +100 -0
- package/core/.claude/skills/frontend-design/reference/typography.md +131 -0
- package/core/.claude/skills/frontend-design/reference/ux-writing.md +107 -0
- package/core/.claude/skills/frontend_agent/SKILL.md +327 -0
- package/core/.claude/skills/harden/SKILL.md +358 -0
- package/core/.claude/skills/heimdall/SKILL.md +84 -0
- package/core/.claude/skills/huginn/SKILL.md +208 -0
- package/core/.claude/skills/incident_response/SKILL.md +315 -0
- package/core/.claude/skills/legacy_dev/SKILL.md +202 -0
- package/core/.claude/skills/normalize/SKILL.md +67 -0
- package/core/.claude/skills/onboard/SKILL.md +243 -0
- package/core/.claude/skills/optimization_agent/SKILL.md +340 -0
- package/core/.claude/skills/optimize/SKILL.md +269 -0
- package/core/.claude/skills/pcb-review/SKILL.md +39 -0
- package/core/.claude/skills/polish/SKILL.md +202 -0
- package/core/.claude/skills/product_manager/SKILL.md +1091 -0
- package/core/.claude/skills/qa_engineer/SKILL.md +1269 -0
- package/core/.claude/skills/quieter/SKILL.md +118 -0
- package/core/.claude/skills/remotion-best-practices/SKILL.md +61 -0
- package/core/.claude/skills/remotion-best-practices/rules/3d.md +86 -0
- package/core/.claude/skills/remotion-best-practices/rules/animations.md +27 -0
- package/core/.claude/skills/remotion-best-practices/rules/assets/charts-bar-chart.tsx +173 -0
- package/core/.claude/skills/remotion-best-practices/rules/assets/text-animations-typewriter.tsx +100 -0
- package/core/.claude/skills/remotion-best-practices/rules/assets/text-animations-word-highlight.tsx +103 -0
- package/core/.claude/skills/remotion-best-practices/rules/assets.md +78 -0
- package/core/.claude/skills/remotion-best-practices/rules/audio-visualization.md +198 -0
- package/core/.claude/skills/remotion-best-practices/rules/audio.md +169 -0
- package/core/.claude/skills/remotion-best-practices/rules/calculate-metadata.md +134 -0
- package/core/.claude/skills/remotion-best-practices/rules/can-decode.md +81 -0
- package/core/.claude/skills/remotion-best-practices/rules/charts.md +120 -0
- package/core/.claude/skills/remotion-best-practices/rules/compositions.md +154 -0
- package/core/.claude/skills/remotion-best-practices/rules/display-captions.md +184 -0
- package/core/.claude/skills/remotion-best-practices/rules/extract-frames.md +229 -0
- package/core/.claude/skills/remotion-best-practices/rules/ffmpeg.md +38 -0
- package/core/.claude/skills/remotion-best-practices/rules/fonts.md +152 -0
- package/core/.claude/skills/remotion-best-practices/rules/get-audio-duration.md +58 -0
- package/core/.claude/skills/remotion-best-practices/rules/get-video-dimensions.md +68 -0
- package/core/.claude/skills/remotion-best-practices/rules/get-video-duration.md +60 -0
- package/core/.claude/skills/remotion-best-practices/rules/gifs.md +141 -0
- package/core/.claude/skills/remotion-best-practices/rules/images.md +134 -0
- package/core/.claude/skills/remotion-best-practices/rules/import-srt-captions.md +69 -0
- package/core/.claude/skills/remotion-best-practices/rules/light-leaks.md +73 -0
- package/core/.claude/skills/remotion-best-practices/rules/lottie.md +70 -0
- package/core/.claude/skills/remotion-best-practices/rules/maps.md +412 -0
- package/core/.claude/skills/remotion-best-practices/rules/measuring-dom-nodes.md +34 -0
- package/core/.claude/skills/remotion-best-practices/rules/measuring-text.md +140 -0
- package/core/.claude/skills/remotion-best-practices/rules/parameters.md +109 -0
- package/core/.claude/skills/remotion-best-practices/rules/sequencing.md +118 -0
- package/core/.claude/skills/remotion-best-practices/rules/sfx.md +30 -0
- package/core/.claude/skills/remotion-best-practices/rules/subtitles.md +36 -0
- package/core/.claude/skills/remotion-best-practices/rules/tailwind.md +11 -0
- package/core/.claude/skills/remotion-best-practices/rules/text-animations.md +20 -0
- package/core/.claude/skills/remotion-best-practices/rules/timing.md +179 -0
- package/core/.claude/skills/remotion-best-practices/rules/transcribe-captions.md +70 -0
- package/core/.claude/skills/remotion-best-practices/rules/transitions.md +197 -0
- package/core/.claude/skills/remotion-best-practices/rules/transparent-videos.md +106 -0
- package/core/.claude/skills/remotion-best-practices/rules/trimming.md +51 -0
- package/core/.claude/skills/remotion-best-practices/rules/videos.md +171 -0
- package/core/.claude/skills/remotion-best-practices/rules/voiceover.md +99 -0
- package/core/.claude/skills/security_agent/SKILL.md +312 -0
- package/core/.claude/skills/spec_optimizer/SKILL.md +299 -0
- package/core/.claude/skills/sre_agent/SKILL.md +1347 -0
- package/core/.claude/skills/sunny/SKILL.md +74 -0
- package/core/.claude/skills/supabase-postgres-best-practices/AGENTS.md +90 -0
- package/core/.claude/skills/supabase-postgres-best-practices/CLAUDE.md +1 -0
- package/core/.claude/skills/supabase-postgres-best-practices/SKILL.md +64 -0
- package/core/.claude/skills/supabase-postgres-best-practices/references/advanced-full-text-search.md +55 -0
- package/core/.claude/skills/supabase-postgres-best-practices/references/advanced-jsonb-indexing.md +49 -0
- package/core/.claude/skills/supabase-postgres-best-practices/references/conn-idle-timeout.md +46 -0
- package/core/.claude/skills/supabase-postgres-best-practices/references/conn-limits.md +44 -0
- package/core/.claude/skills/supabase-postgres-best-practices/references/conn-pooling.md +41 -0
- package/core/.claude/skills/supabase-postgres-best-practices/references/conn-prepared-statements.md +46 -0
- package/core/.claude/skills/supabase-postgres-best-practices/references/data-batch-inserts.md +54 -0
- package/core/.claude/skills/supabase-postgres-best-practices/references/data-n-plus-one.md +53 -0
- package/core/.claude/skills/supabase-postgres-best-practices/references/data-pagination.md +50 -0
- package/core/.claude/skills/supabase-postgres-best-practices/references/data-upsert.md +50 -0
- package/core/.claude/skills/supabase-postgres-best-practices/references/lock-advisory.md +56 -0
- package/core/.claude/skills/supabase-postgres-best-practices/references/lock-deadlock-prevention.md +68 -0
- package/core/.claude/skills/supabase-postgres-best-practices/references/lock-short-transactions.md +50 -0
- package/core/.claude/skills/supabase-postgres-best-practices/references/lock-skip-locked.md +54 -0
- package/core/.claude/skills/supabase-postgres-best-practices/references/monitor-explain-analyze.md +45 -0
- package/core/.claude/skills/supabase-postgres-best-practices/references/monitor-pg-stat-statements.md +55 -0
- package/core/.claude/skills/supabase-postgres-best-practices/references/monitor-vacuum-analyze.md +55 -0
- package/core/.claude/skills/supabase-postgres-best-practices/references/query-composite-indexes.md +44 -0
- package/core/.claude/skills/supabase-postgres-best-practices/references/query-covering-indexes.md +40 -0
- package/core/.claude/skills/supabase-postgres-best-practices/references/query-index-types.md +45 -0
- package/core/.claude/skills/supabase-postgres-best-practices/references/query-missing-indexes.md +43 -0
- package/core/.claude/skills/supabase-postgres-best-practices/references/query-partial-indexes.md +45 -0
- package/core/.claude/skills/supabase-postgres-best-practices/references/schema-data-types.md +46 -0
- package/core/.claude/skills/supabase-postgres-best-practices/references/schema-foreign-key-indexes.md +59 -0
- package/core/.claude/skills/supabase-postgres-best-practices/references/schema-lowercase-identifiers.md +55 -0
- package/core/.claude/skills/supabase-postgres-best-practices/references/schema-partitioning.md +55 -0
- package/core/.claude/skills/supabase-postgres-best-practices/references/schema-primary-keys.md +61 -0
- package/core/.claude/skills/supabase-postgres-best-practices/references/security-privileges.md +54 -0
- package/core/.claude/skills/supabase-postgres-best-practices/references/security-rls-basics.md +50 -0
- package/core/.claude/skills/supabase-postgres-best-practices/references/security-rls-performance.md +57 -0
- package/core/.claude/skills/synapse_maintain/SKILL.md +84 -0
- package/core/.claude/skills/ui-ux-pro-max/SKILL.md +377 -0
- package/core/.claude/skills/ui-ux-pro-max/data/charts.csv +26 -0
- package/core/.claude/skills/ui-ux-pro-max/data/colors.csv +97 -0
- package/core/.claude/skills/ui-ux-pro-max/data/icons.csv +101 -0
- package/core/.claude/skills/ui-ux-pro-max/data/landing.csv +31 -0
- package/core/.claude/skills/ui-ux-pro-max/data/products.csv +97 -0
- package/core/.claude/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
- package/core/.claude/skills/ui-ux-pro-max/data/stacks/astro.csv +54 -0
- package/core/.claude/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
- package/core/.claude/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
- package/core/.claude/skills/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
- package/core/.claude/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
- package/core/.claude/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
- package/core/.claude/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
- package/core/.claude/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
- package/core/.claude/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
- package/core/.claude/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
- package/core/.claude/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
- package/core/.claude/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
- package/core/.claude/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
- package/core/.claude/skills/ui-ux-pro-max/data/styles.csv +68 -0
- package/core/.claude/skills/ui-ux-pro-max/data/typography.csv +58 -0
- package/core/.claude/skills/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
- package/core/.claude/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
- package/core/.claude/skills/ui-ux-pro-max/data/web-interface.csv +31 -0
- package/core/.claude/skills/ui-ux-pro-max/scripts/core.py +253 -0
- package/core/.claude/skills/ui-ux-pro-max/scripts/design_system.py +1067 -0
- package/core/.claude/skills/ui-ux-pro-max/scripts/search.py +106 -0
- package/core/.claude/skills/vercel-react-best-practices/AGENTS.md +2934 -0
- package/core/.claude/skills/vercel-react-best-practices/SKILL.md +136 -0
- package/core/.claude/skills/vercel-react-best-practices/rules/advanced-event-handler-refs.md +55 -0
- package/core/.claude/skills/vercel-react-best-practices/rules/advanced-init-once.md +42 -0
- package/core/.claude/skills/vercel-react-best-practices/rules/advanced-use-latest.md +39 -0
- package/core/.claude/skills/vercel-react-best-practices/rules/async-api-routes.md +38 -0
- package/core/.claude/skills/vercel-react-best-practices/rules/async-defer-await.md +80 -0
- package/core/.claude/skills/vercel-react-best-practices/rules/async-dependencies.md +51 -0
- package/core/.claude/skills/vercel-react-best-practices/rules/async-parallel.md +28 -0
- package/core/.claude/skills/vercel-react-best-practices/rules/async-suspense-boundaries.md +99 -0
- package/core/.claude/skills/vercel-react-best-practices/rules/bundle-barrel-imports.md +59 -0
- package/core/.claude/skills/vercel-react-best-practices/rules/bundle-conditional.md +31 -0
- package/core/.claude/skills/vercel-react-best-practices/rules/bundle-defer-third-party.md +49 -0
- package/core/.claude/skills/vercel-react-best-practices/rules/bundle-dynamic-imports.md +35 -0
- package/core/.claude/skills/vercel-react-best-practices/rules/bundle-preload.md +50 -0
- package/core/.claude/skills/vercel-react-best-practices/rules/client-event-listeners.md +74 -0
- package/core/.claude/skills/vercel-react-best-practices/rules/client-localstorage-schema.md +71 -0
- package/core/.claude/skills/vercel-react-best-practices/rules/client-passive-event-listeners.md +48 -0
- package/core/.claude/skills/vercel-react-best-practices/rules/client-swr-dedup.md +56 -0
- package/core/.claude/skills/vercel-react-best-practices/rules/js-batch-dom-css.md +107 -0
- package/core/.claude/skills/vercel-react-best-practices/rules/js-cache-function-results.md +80 -0
- package/core/.claude/skills/vercel-react-best-practices/rules/js-cache-property-access.md +28 -0
- package/core/.claude/skills/vercel-react-best-practices/rules/js-cache-storage.md +70 -0
- package/core/.claude/skills/vercel-react-best-practices/rules/js-combine-iterations.md +32 -0
- package/core/.claude/skills/vercel-react-best-practices/rules/js-early-exit.md +50 -0
- package/core/.claude/skills/vercel-react-best-practices/rules/js-hoist-regexp.md +45 -0
- package/core/.claude/skills/vercel-react-best-practices/rules/js-index-maps.md +37 -0
- package/core/.claude/skills/vercel-react-best-practices/rules/js-length-check-first.md +49 -0
- package/core/.claude/skills/vercel-react-best-practices/rules/js-min-max-loop.md +82 -0
- package/core/.claude/skills/vercel-react-best-practices/rules/js-set-map-lookups.md +24 -0
- package/core/.claude/skills/vercel-react-best-practices/rules/js-tosorted-immutable.md +57 -0
- package/core/.claude/skills/vercel-react-best-practices/rules/rendering-activity.md +26 -0
- package/core/.claude/skills/vercel-react-best-practices/rules/rendering-animate-svg-wrapper.md +47 -0
- package/core/.claude/skills/vercel-react-best-practices/rules/rendering-conditional-render.md +40 -0
- package/core/.claude/skills/vercel-react-best-practices/rules/rendering-content-visibility.md +38 -0
- package/core/.claude/skills/vercel-react-best-practices/rules/rendering-hoist-jsx.md +46 -0
- package/core/.claude/skills/vercel-react-best-practices/rules/rendering-hydration-no-flicker.md +82 -0
- package/core/.claude/skills/vercel-react-best-practices/rules/rendering-hydration-suppress-warning.md +30 -0
- package/core/.claude/skills/vercel-react-best-practices/rules/rendering-svg-precision.md +28 -0
- package/core/.claude/skills/vercel-react-best-practices/rules/rendering-usetransition-loading.md +75 -0
- package/core/.claude/skills/vercel-react-best-practices/rules/rerender-defer-reads.md +39 -0
- package/core/.claude/skills/vercel-react-best-practices/rules/rerender-dependencies.md +45 -0
- package/core/.claude/skills/vercel-react-best-practices/rules/rerender-derived-state-no-effect.md +40 -0
- package/core/.claude/skills/vercel-react-best-practices/rules/rerender-derived-state.md +29 -0
- package/core/.claude/skills/vercel-react-best-practices/rules/rerender-functional-setstate.md +74 -0
- package/core/.claude/skills/vercel-react-best-practices/rules/rerender-lazy-state-init.md +58 -0
- package/core/.claude/skills/vercel-react-best-practices/rules/rerender-memo-with-default-value.md +38 -0
- package/core/.claude/skills/vercel-react-best-practices/rules/rerender-memo.md +44 -0
- package/core/.claude/skills/vercel-react-best-practices/rules/rerender-move-effect-to-event.md +45 -0
- package/core/.claude/skills/vercel-react-best-practices/rules/rerender-simple-expression-in-memo.md +35 -0
- package/core/.claude/skills/vercel-react-best-practices/rules/rerender-transitions.md +40 -0
- package/core/.claude/skills/vercel-react-best-practices/rules/rerender-use-ref-transient-values.md +73 -0
- package/core/.claude/skills/vercel-react-best-practices/rules/server-after-nonblocking.md +73 -0
- package/core/.claude/skills/vercel-react-best-practices/rules/server-auth-actions.md +96 -0
- package/core/.claude/skills/vercel-react-best-practices/rules/server-cache-lru.md +41 -0
- package/core/.claude/skills/vercel-react-best-practices/rules/server-cache-react.md +76 -0
- package/core/.claude/skills/vercel-react-best-practices/rules/server-dedup-props.md +65 -0
- package/core/.claude/skills/vercel-react-best-practices/rules/server-parallel-fetching.md +83 -0
- package/core/.claude/skills/vercel-react-best-practices/rules/server-serialization.md +38 -0
- package/core/.collaboration/README.md +258 -0
- package/core/.collaboration/cli/commands/assign.js +39 -0
- package/core/.collaboration/cli/commands/claim.js +33 -0
- package/core/.collaboration/cli/commands/complete.js +44 -0
- package/core/.collaboration/cli/commands/create.js +110 -0
- package/core/.collaboration/cli/commands/get.js +83 -0
- package/core/.collaboration/cli/commands/index.js +52 -0
- package/core/.collaboration/cli/commands/list.js +51 -0
- package/core/.collaboration/cli/commands/lock.js +45 -0
- package/core/.collaboration/cli/commands/rebuild.js +39 -0
- package/core/.collaboration/cli/commands/search.js +61 -0
- package/core/.collaboration/cli/commands/stats.js +61 -0
- package/core/.collaboration/cli/commands/transfer.js +41 -0
- package/core/.collaboration/cli/commands/unlock.js +48 -0
- package/core/.collaboration/cli/formatters/help-formatter.js +70 -0
- package/core/.collaboration/cli/formatters/index.js +7 -0
- package/core/.collaboration/cli/task-cli.js +46 -0
- package/core/.collaboration/cli/utils/arg-parser.js +74 -0
- package/core/.collaboration/cli/utils/git-user.js +25 -0
- package/core/.collaboration/cli/utils/index.js +9 -0
- package/core/.collaboration/cli/utils/output.js +10 -0
- package/core/.collaboration/config/default.yaml +189 -0
- package/core/.collaboration/core/conflict-resolver.js +461 -0
- package/core/.collaboration/core/conflict-resolver.test.js +389 -0
- package/core/.collaboration/core/id-generator.js +303 -0
- package/core/.collaboration/core/migrate-legacy.js +260 -0
- package/core/.collaboration/core/package.json +1 -0
- package/core/.collaboration/core/task-2257-estimated-hours.test.js +72 -0
- package/core/.collaboration/core/task-2260-dir-layout-move.test.js +60 -0
- package/core/.collaboration/core/task-2264-single-after-capture.test.js +61 -0
- package/core/.collaboration/core/task-2288-followups.test.js +121 -0
- package/core/.collaboration/core/task-api-json.js +211 -0
- package/core/.collaboration/core/task-api.js +3729 -0
- package/core/.collaboration/core/task-api.test.js +1268 -0
- package/core/.collaboration/docs/API.md +787 -0
- package/core/.collaboration/docs/ARCHITECTURE.md +596 -0
- package/core/.collaboration/docs/CLI.md +821 -0
- package/core/.collaboration/docs/FAQ.md +695 -0
- package/core/.collaboration/docs/MIGRATION.md +804 -0
- package/core/.collaboration/docs/examples/README.md +320 -0
- package/core/.collaboration/docs/examples/advanced-queries.js +261 -0
- package/core/.collaboration/docs/examples/basic-usage.js +184 -0
- package/core/.collaboration/docs/examples/team-workflow.js +352 -0
- package/core/.collaboration/hooks/README.md +70 -0
- package/core/.collaboration/hooks/config.json +10 -0
- package/core/.collaboration/hooks/install.js +400 -0
- package/core/.collaboration/hooks/post-merge.js +163 -0
- package/core/.collaboration/hooks/pre-commit.js +264 -0
- package/core/.collaboration/hooks/synapse-hook.js +486 -0
- package/core/.collaboration/hooks/synapse-hook.test.js +69 -0
- package/core/.failure/INDEX.yaml +231 -0
- package/core/.failure/agent-execution/FAIL-001-agent-no-output.yaml +391 -0
- package/core/.failure/agent-execution/FAIL-004_agent_platform_specific_commands.md +194 -0
- package/core/.failure/agent-execution/FAIL-005_background_agent_permission_denied.md +204 -0
- package/core/.failure/agent-execution/FAIL-007-pm-lead-wrong-team-invocation.yaml +0 -0
- package/core/.failure/agent-execution/FAIL-008-bypass-api-direct-yaml-write.yaml +94 -0
- package/core/.failure/agent-execution/FAIL-010-phase0-poem-format-skipped.yaml +28 -0
- package/core/.failure/agent-execution/FAIL-010-skipping-cognitive-checkpoint-after-verification.yaml +59 -0
- package/core/.failure/agent-execution/FAIL-012-grep-shortcut-during-investigation.yaml +85 -0
- package/core/.failure/agent-execution/FAIL-013-search-cwd-drift-and-case-mismatch.yaml +103 -0
- package/core/.failure/agent-execution/FAIL-014-shared-worktree-premature-death-verdict.yaml +35 -0
- package/core/.failure/agent-execution/FAIL-AUTO-TASK_1413.yaml +31 -0
- package/core/.failure/agent-execution/FAIL-AUTO-TASK_1427.yaml +41 -0
- package/core/.failure/agent-execution/FAIL-AUTO-TASK_904.yaml +30 -0
- package/core/.failure/agent-execution/README.md +68 -0
- package/core/.failure/architecture/FAIL-004_session_based_skill_recognition.md +128 -0
- package/core/.failure/architecture/FAIL-006-python-version-compatibility.yaml +445 -0
- package/core/.failure/architecture/README.md +87 -0
- package/core/.failure/code-quality/README.md +89 -0
- package/core/.failure/data-integrity/FAIL-002-json-bom.yaml +220 -0
- package/core/.failure/data-integrity/README.md +141 -0
- package/core/.failure/pipeline/FAIL-003-queue-pollution.yaml +335 -0
- package/core/.failure/pipeline/README.md +95 -0
- package/core/.failure/retired/FAIL-009-skipping-synapse-pulse-before-code-change.yaml +49 -0
- package/core/.failure/tools/README.md +230 -0
- package/core/.failure/tools/USAGE_GUIDE.md +323 -0
- package/core/.failure/tools/check_bom.js +101 -0
- package/core/.failure/tools/check_failures.ps1 +387 -0
- package/core/.failure/tools/fix_json.js +58 -0
- package/core/.failure/tools/log_failure.ps1 +474 -0
- package/core/.failure/tools/remove_bom.js +46 -0
- package/core/.failure/tools/validate_json.js +50 -0
- package/core/.formation/.episode-input.json +10 -0
- package/core/.formation/README.md +188 -0
- package/core/.formation/bifrost/CGDD_hook_lifecycle.js +575 -0
- package/core/.formation/bifrost/HOOK_PARITY_VERIFICATION.md +241 -0
- package/core/.formation/bifrost/README.md +71 -0
- package/core/.formation/bifrost/codex-doctor.js +106 -0
- package/core/.formation/bifrost/codex-doctor.test.js +51 -0
- package/core/.formation/bifrost/launch.js +510 -0
- package/core/.formation/bifrost/launch.test.js +217 -0
- package/core/.formation/bifrost/openai/codex-hook-shim.js +171 -0
- package/core/.formation/bifrost/openai/codex-hook-shim.test.js +107 -0
- package/core/.formation/bifrost/openai/models.json +36 -0
- package/core/.formation/bifrost/openai/relay.js +781 -0
- package/core/.formation/bifrost/openai/relay.test.js +71 -0
- package/core/.formation/bifrost/session.js +382 -0
- package/core/.formation/bifrost/session.test.js +121 -0
- package/core/.formation/bifrost/setup-codex.js +685 -0
- package/core/.formation/bifrost/setup-codex.test.js +102 -0
- package/core/.formation/bifrost/shared/ansuz-boot-policy.js +31 -0
- package/core/.formation/bifrost/shared/ansuz-boot-policy.test.js +40 -0
- package/core/.formation/bifrost/shared/boot-context.js +68 -0
- package/core/.formation/bifrost/shared/boot-context.test.js +67 -0
- package/core/.formation/bifrost/shared/codex-appserver.js +191 -0
- package/core/.formation/bifrost/shared/codex-injection.js +126 -0
- package/core/.formation/bifrost/shared/codex-session-registry.js +105 -0
- package/core/.formation/bifrost/shared/codex-session-registry.test.js +126 -0
- package/core/.formation/bifrost/shared/consolidate.js +286 -0
- package/core/.formation/bifrost/shared/stream-json.js +103 -0
- package/core/.formation/bifrost/shared/tools.js +278 -0
- package/core/.formation/bifrost/sync.js +142 -0
- package/core/.formation/briefs/scheduler-evolution.md +209 -0
- package/core/.formation/lead.yaml +118 -0
- package/core/.formation/legacy.bak/designer.yaml +57 -0
- package/core/.formation/legacy.bak/pm.yaml +57 -0
- package/core/.formation/legacy.bak/qa.yaml +57 -0
- package/core/.formation/legacy.bak/review.yaml +62 -0
- package/core/.formation/legacy.bak/scheduler.yaml +129 -0
- package/core/.formation/legacy.bak/sre.yaml +57 -0
- package/core/.formation/legion/forge.yaml +299 -0
- package/core/.formation/legion/hive.yaml +238 -0
- package/core/.formation/native/claude/README.md +61 -0
- package/core/.formation/native/claude/models.json +42 -0
- package/core/.formation/role-map.yaml +274 -0
- package/core/.formation/roles/_shared/modules/code_review.yaml +98 -0
- package/core/.formation/roles/_shared/modules/security.yaml +103 -0
- package/core/.formation/roles/_shared/modules/testing.yaml +14 -0
- package/core/.formation/roles/backend/role.yaml +93 -0
- package/core/.formation/roles/code_reviewer/role.yaml +102 -0
- package/core/.formation/roles/database_optimizer/role.yaml +107 -0
- package/core/.formation/roles/designer/role.yaml +66 -0
- package/core/.formation/roles/developer/role.yaml +75 -0
- package/core/.formation/roles/frontend/role.yaml +134 -0
- package/core/.formation/roles/incident_response/role.yaml +89 -0
- package/core/.formation/roles/qa/role.yaml +89 -0
- package/core/.formation/roles/security/role.yaml +87 -0
- package/core/.formation/roles/sre/role.yaml +66 -0
- package/core/.formation/skills/coordinator.yaml +52 -0
- package/core/.formation/solo/diagnosis.yaml +78 -0
- package/core/.formation/solo/strategy.yaml +121 -0
- package/core/.formation/spec/task_operations.parity.test.js +426 -0
- package/core/.formation/spec/task_operations.yaml +291 -0
- package/core/.formation/squad/blitz.yaml +192 -0
- package/core/.formation/squad/strategy-tribunal.yaml +354 -0
- package/core/.formation/squad/strategy.yaml +349 -0
- package/core/.formation/squad/sweep.yaml +208 -0
- package/core/.formation/tests/hello.txt +2 -0
- package/core/.formation/tools/__tests__/m1-claim-gate.test.js +175 -0
- package/core/.formation/tools/__tests__/m1-hmap-convid.test.js +216 -0
- package/core/.formation/tools/__tests__/release-lock.test.js +176 -0
- package/core/.formation/tools/__tests__/subagent-bifrost-guard.test.js +234 -0
- package/core/.formation/tools/__tests__/subagent-codex-harness.test.js +96 -0
- package/core/.formation/tools/__tests__/task-1863-claim-late-release.test.js +160 -0
- package/core/.formation/tools/__tests__/task-2265-singleton-identity.test.js +134 -0
- package/core/.formation/tools/__tests__/task-2281-singleton-readers.test.js +64 -0
- package/core/.formation/tools/__tests__/task2030-worktree-node-modules.test.js +221 -0
- package/core/.formation/tools/__tests__/task2067-worktree-branch-reuse.test.js +148 -0
- package/core/.formation/tools/alaya-gate.js +198 -0
- package/core/.formation/tools/analytics.js +172 -0
- package/core/.formation/tools/broadcast.js +103 -0
- package/core/.formation/tools/commit-sync.js +154 -0
- package/core/.formation/tools/coordinator.js +350 -0
- package/core/.formation/tools/dashboard-models-chain.test.js +60 -0
- package/core/.formation/tools/dispatch-cortex-context.test.js +52 -0
- package/core/.formation/tools/dispatch-detail/cross-project-worktree.md +40 -0
- package/core/.formation/tools/dispatch-detail/testing-module.md +53 -0
- package/core/.formation/tools/dispatch-detail/worktree-subagent-mode.md +72 -0
- package/core/.formation/tools/dispatch-dryrun.test.js +54 -0
- package/core/.formation/tools/dispatch-model-policy.test.js +165 -0
- package/core/.formation/tools/dispatch-notifier.js +84 -0
- package/core/.formation/tools/dispatch-registry.js +346 -0
- package/core/.formation/tools/dispatch.js +1931 -0
- package/core/.formation/tools/formations.js +1203 -0
- package/core/.formation/tools/forseti-verify.js +1170 -0
- package/core/.formation/tools/git-salvage.js +269 -0
- package/core/.formation/tools/guard-attribution.js +224 -0
- package/core/.formation/tools/headless-branch-recovery.test.js +64 -0
- package/core/.formation/tools/headless-dryrun.test.js +79 -0
- package/core/.formation/tools/headless-v2.js +659 -0
- package/core/.formation/tools/headless.js +1071 -0
- package/core/.formation/tools/integration.js +528 -0
- package/core/.formation/tools/jev-correction.js +214 -0
- package/core/.formation/tools/jev-correction.test.js +178 -0
- package/core/.formation/tools/legacy-scheduler.js +1994 -0
- package/core/.formation/tools/lib/exec-tree.js +92 -0
- package/core/.formation/tools/lib/exec-tree.test.js +82 -0
- package/core/.formation/tools/loader.js +190 -0
- package/core/.formation/tools/log-reader.js +232 -0
- package/core/.formation/tools/logger.js +273 -0
- package/core/.formation/tools/mcp-allowlist.test.js +40 -0
- package/core/.formation/tools/memory-loader.js +422 -0
- package/core/.formation/tools/merge-lock-heartbeat.test.js +35 -0
- package/core/.formation/tools/no-hooks.settings.json +3 -0
- package/core/.formation/tools/pool-status-push.js +121 -0
- package/core/.formation/tools/pool-status-push.test.js +165 -0
- package/core/.formation/tools/post-complete/bounded-http.js +102 -0
- package/core/.formation/tools/post-complete/bounded-http.test.js +130 -0
- package/core/.formation/tools/post-complete/cognitive.js +270 -0
- package/core/.formation/tools/post-complete/git-merge.js +2845 -0
- package/core/.formation/tools/post-complete/health.js +464 -0
- package/core/.formation/tools/post-complete/integration-gaps.js +98 -0
- package/core/.formation/tools/post-complete/outcome.js +874 -0
- package/core/.formation/tools/post-complete/staging.js +390 -0
- package/core/.formation/tools/post-complete/subagent-transcript-stats.js +460 -0
- package/core/.formation/tools/post-complete/subagent-transcript-stats.test.js +680 -0
- package/core/.formation/tools/post-complete/task1536.test.js +627 -0
- package/core/.formation/tools/post-complete/task1543.test.js +261 -0
- package/core/.formation/tools/post-complete/task1876.test.js +287 -0
- package/core/.formation/tools/post-complete/task1957.test.js +293 -0
- package/core/.formation/tools/post-complete/task1997.test.js +401 -0
- package/core/.formation/tools/post-complete/task2028.test.js +232 -0
- package/core/.formation/tools/post-complete/task2029.test.js +275 -0
- package/core/.formation/tools/post-complete/task2036.test.js +330 -0
- package/core/.formation/tools/post-complete/task2038.test.js +246 -0
- package/core/.formation/tools/post-complete/task2071.test.js +231 -0
- package/core/.formation/tools/post-complete/task2233.test.js +100 -0
- package/core/.formation/tools/post-complete/task2240.test.js +134 -0
- package/core/.formation/tools/post-complete/task2244.test.js +199 -0
- package/core/.formation/tools/post-complete/task2255.test.js +28 -0
- package/core/.formation/tools/post-complete/task2268.test.js +106 -0
- package/core/.formation/tools/post-complete/task2341.test.js +74 -0
- package/core/.formation/tools/post-complete/task2345.test.js +38 -0
- package/core/.formation/tools/post-complete/testing.js +482 -0
- package/core/.formation/tools/post-complete/wish.js +177 -0
- package/core/.formation/tools/post-complete/worktree-rescue.test.js +283 -0
- package/core/.formation/tools/post-complete.js +3660 -0
- package/core/.formation/tools/post-complete.test.js +1002 -0
- package/core/.formation/tools/pre-dispatch-snapshot.test.js +328 -0
- package/core/.formation/tools/process-state.js +33 -0
- package/core/.formation/tools/prompt.js +2183 -0
- package/core/.formation/tools/prompt.test.js +875 -0
- package/core/.formation/tools/remote-conflict.js +98 -0
- package/core/.formation/tools/revert-daemon-state.js +162 -0
- package/core/.formation/tools/route-audit.test.js +55 -0
- package/core/.formation/tools/runner.js +1332 -0
- package/core/.formation/tools/supabase-client.js +104 -0
- package/core/.formation/tools/task-sync.js +236 -0
- package/core/.formation/tools/task-utils.js +344 -0
- package/core/.formation/tools/task2028-headless-worktree.test.js +112 -0
- package/core/.formation/tools/test-drift.js +148 -0
- package/core/.formation/tools/tests/headless-mcp-args-plumbing.test.js +123 -0
- package/core/.formation/tools/tests/relay-mcp-overrides.test.js +112 -0
- package/core/.formation/tools/transcript-recorder.js +574 -0
- package/core/.formation/tools/utils-claude-cmd.test.js +28 -0
- package/core/.formation/tools/utils-worktree-config.test.js +44 -0
- package/core/.formation/tools/utils.js +1020 -0
- package/core/.formation/tools/verify-acceptance.js +585 -0
- package/core/.formation/tools/worktree-leak.test.js +162 -0
- package/core/.formation/tools/worktree-reclaim.js +259 -0
- package/core/.formation/tools/worktree-reclaim.test.js +182 -0
- package/core/.formation/tools/yggdrasil-local.js +97 -0
- package/core/.formation/unit/do.yaml +78 -0
- package/core/.formation/unit/heimdall.yaml +96 -0
- package/core/.formation/unit/plan.yaml +67 -0
- package/core/.formation/unit/think.yaml +58 -0
- package/core/.kenaz/MUNINN_SNAPSHOT9_EPISODE.json +32 -0
- package/core/.kenaz/MUNINN_SNAPSHOT9_RUNE.json +23 -0
- package/core/.kenaz/MUNINN_SNAPSHOT9_SUMMARY.md +89 -0
- package/core/.kenaz/ash_TASK_1428-20260507.json +14 -0
- package/core/.kenaz/cache/native-models/claude.json +42 -0
- package/core/.kenaz/claude-hooks-manifest.json +119 -0
- package/core/.kenaz/cortex.yaml +100 -0
- package/core/.kenaz/curator_state.json +7 -0
- package/core/.kenaz/dashboard-quick-prompts.json +9 -0
- package/core/.kenaz/designs/METAPLASTICITY_CONFIDENCE_DESIGN.md +537 -0
- package/core/.kenaz/designs/REFLEX_INITIATOR_DESIGN.md +501 -0
- package/core/.kenaz/designs/TASK_1385_handoff_mcp_design.md +426 -0
- package/core/.kenaz/designs/TASK_932_hippocampus_consolidation.md +103 -0
- package/core/.kenaz/designs/TASK_934_efe_signal_engine.md +97 -0
- package/core/.kenaz/designs/TASK_935_self_evolution_framework.md +154 -0
- package/core/.kenaz/designs/VISION_cognitive_architecture_roadmap.md +159 -0
- package/core/.kenaz/designs/metaplasticity_simulation_results.json +696 -0
- package/core/.kenaz/docs/INDEX.md +214 -0
- package/core/.kenaz/docs/README.md +290 -0
- package/core/.kenaz/docs/registry.json +962 -0
- package/core/.kenaz/docs/schema.json +144 -0
- package/core/.kenaz/docs/tools/GIT_HOOK_GUIDE.md +203 -0
- package/core/.kenaz/docs/tools/RAG_INTEGRATION_GUIDE.md +306 -0
- package/core/.kenaz/docs/tools/README.md +99 -0
- package/core/.kenaz/docs/tools/TIME_ESTIMATION_GUIDE.md +299 -0
- package/core/.kenaz/docs/tools/package-lock.json +618 -0
- package/core/.kenaz/docs/tools/package.json +34 -0
- package/core/.kenaz/docs/tools/src/cli.ts +365 -0
- package/core/.kenaz/docs/tools/src/field-extractor.ts +152 -0
- package/core/.kenaz/docs/tools/src/index.ts +14 -0
- package/core/.kenaz/docs/tools/src/registry.ts +664 -0
- package/core/.kenaz/docs/tools/src/search.ts +195 -0
- package/core/.kenaz/docs/tools/src/types.ts +88 -0
- package/core/.kenaz/docs/tools/test-git-hook.sh +79 -0
- package/core/.kenaz/docs/tools/tsconfig.json +20 -0
- package/core/.kenaz/docs/tools/verify.sh +106 -0
- package/core/.kenaz/episodes/SESSION_ansuz-prompt-1785087304784.yaml +68 -0
- package/core/.kenaz/huginn-exploration.json +8 -0
- package/core/.kenaz/knowledge/ladybug_2c51da1e_shadow_file_frame_group.patch +163 -0
- package/core/.kenaz/knowledge/ladybug_30cf85690e_shadow_page_read_during_checkpoint.patch +393 -0
- package/core/.kenaz/knowledge/ladybug_7a17858d3a_node_group_delete_lock.patch +102 -0
- package/core/.kenaz/knowledge/ladybug_926a0ba1_column_checkpoint.patch +412 -0
- package/core/.kenaz/knowledge/ladybug_a346c4c4b6_pk_index_header_pages.patch +144 -0
- package/core/.kenaz/knowledge/ladybug_ba5f38815b_csr_node_group.patch +86 -0
- package/core/.kenaz/main-memory/README.md +230 -0
- package/core/.kenaz/main-memory/kenaz/cortex/001_cortex_overview.md +168 -0
- package/core/.kenaz/main-memory/kenaz/cortex/001_rag_engine_overview.md +30 -0
- package/core/.kenaz/main-memory/kenaz/memory-system/001_three_tier_architecture.md +361 -0
- package/core/.kenaz/main-memory/kenaz/pipeline/001_task_execution_flow.md +117 -0
- package/core/.kenaz/main-memory/kenaz/pipeline/001_task_granularity.md +154 -0
- package/core/.kenaz/main-memory/kenaz/pipeline/002_team_priority.md +51 -0
- package/core/.kenaz/main-memory/kenaz/pipeline/003_feature_id_system.md +46 -0
- package/core/.kenaz/main-memory/kenaz/rules/001_gen_007_self_containment.md +108 -0
- package/core/.kenaz/main-memory/kenaz/rules/001_rule_priority_system.md +121 -0
- package/core/.kenaz/main-memory/kenaz/rules/002_agt_006_pre_check.md +0 -0
- package/core/.kenaz/main-memory/kenaz/rules/003_ppl_002_task_archival.md +48 -0
- package/core/.kenaz/main-memory/kenaz/system/001_dual_track_task_system.md +197 -0
- package/core/.kenaz/main-memory/knowledge/patterns/001_json_bom_issue.md +78 -0
- package/core/.kenaz/main-memory/knowledge/patterns/001_leader_worker_pattern.md +0 -0
- package/core/.kenaz/main-memory/knowledge/patterns/002_scope_path_conflict.md +115 -0
- package/core/.kenaz/main-memory/knowledge/patterns/002_task_dependency_resolution.md +223 -0
- package/core/.kenaz/main-memory/knowledge/patterns/003_question_protocol.md +242 -0
- package/core/.kenaz/main-memory/knowledge/patterns/004_user_insight_value.md +111 -0
- package/core/.kenaz/main-memory/knowledge/patterns/005_file_lock_pattern.md +274 -0
- package/core/.kenaz/main-memory/knowledge/references/001_ppl_rules.md +28 -0
- package/core/.kenaz/main-memory/knowledge/solutions/001_json_bom_issue.md +137 -0
- package/core/.kenaz/main-memory/knowledge/solutions/001_team_invocation.md +0 -0
- package/core/.kenaz/main-memory/knowledge/solutions/002_passive_monitoring.md +0 -0
- package/core/.kenaz/main-memory/knowledge/solutions/003_windows_file_race_condition.md +239 -0
- package/core/.kenaz/main-memory/registry.json +326 -0
- package/core/.kenaz/main-memory/version.yaml +58 -0
- package/core/.kenaz/muninn_episode_write.ps1 +17 -0
- package/core/.kenaz/muninn_snapshot11_rune_candidates.md +63 -0
- package/core/.kenaz/muninn_snapshot1_rune_candidates.md +49 -0
- package/core/.kenaz/orphan_audit_2026-05.md +181 -0
- package/core/.kenaz/ownership.yaml +155 -0
- package/core/.kenaz/peer.yaml +72 -0
- package/core/.kenaz/project.yaml +62 -0
- package/core/.kenaz/rune_ansuz_literature_validation_strategy.md +40 -0
- package/core/.kenaz/rune_efe_active_inference_validation.md +36 -0
- package/core/.kenaz/rune_yggdrasil_filesystem_scoped_project.md +41 -0
- package/core/.kenaz/rune_yggdrasil_project_identity_folder_name.md +41 -0
- package/core/.kenaz/rune_yggdrasil_relay_protocol_project_mismatch.md +39 -0
- package/core/.kenaz/runes_TASK_1428.json +57 -0
- package/core/.kenaz/specialist/ansuz_motivational_state.schema.json +138 -0
- package/core/.kenaz/specialist/ansuz_rules.yaml +241 -0
- package/core/.kenaz/specialist/ansuz_session_handoff.schema.json +128 -0
- package/core/.kenaz/specialist/chart_TASK_1657.json +50 -0
- package/core/.kenaz/specialist/cognitive-hub-e2e.test.js +494 -0
- package/core/.kenaz/specialist/daemon-manifest.yaml +168 -0
- package/core/.kenaz/specialist/empty_ac_audit_report.md +63 -0
- package/core/.kenaz/specialist/episode_muninn_completion_1785056865691.json +91 -0
- package/core/.kenaz/specialist/field_report_watermark.json +1 -0
- package/core/.kenaz/specialist/gc1826_driver.js +118 -0
- package/core/.kenaz/specialist/heimdall_proposal_1017c07f.json +13 -0
- package/core/.kenaz/specialist/heimdall_proposal_3dfaa8b9.json +12 -0
- package/core/.kenaz/specialist/heimdall_proposal_57af18f9.json +15 -0
- package/core/.kenaz/specialist/heimdall_proposal_57b1aa1b.json +14 -0
- package/core/.kenaz/specialist/heimdall_proposal_5a3c9473.json +13 -0
- package/core/.kenaz/specialist/identity_verdicts/TASK_1073.json +75 -0
- package/core/.kenaz/specialist/identity_verdicts/TASK_TEST.json +77 -0
- package/core/.kenaz/specialist/memory_guard_fired.json +1 -0
- package/core/.kenaz/specialist/memory_guard_trigger_cache.json +1 -0
- package/core/.kenaz/specialist/memory_source_priority.yaml +260 -0
- package/core/.kenaz/specialist/motivational_state.schema.json +62 -0
- package/core/.kenaz/specialist/prompt_1775.txt +317 -0
- package/core/.kenaz/specialist/prompt_1776.txt +326 -0
- package/core/.kenaz/specialist/prompt_1791.txt +320 -0
- package/core/.kenaz/specialist/prompt_1792.txt +320 -0
- package/core/.kenaz/specialist/prompt_1795.txt +281 -0
- package/core/.kenaz/specialist/prompt_1813.txt +332 -0
- package/core/.kenaz/specialist/prompt_1814.txt +401 -0
- package/core/.kenaz/specialist/prompt_1815.txt +394 -0
- package/core/.kenaz/specialist/prompt_1816.txt +437 -0
- package/core/.kenaz/specialist/prompt_1818.txt +361 -0
- package/core/.kenaz/specialist/prompt_1819.txt +421 -0
- package/core/.kenaz/specialist/prompt_1821.txt +345 -0
- package/core/.kenaz/specialist/prompt_1822.txt +313 -0
- package/core/.kenaz/specialist/prompt_1824.txt +348 -0
- package/core/.kenaz/specialist/prompt_1826.txt +388 -0
- package/core/.kenaz/specialist/retired_organs/README.md +58 -0
- package/core/.kenaz/specialist/rune_calibration_poc.md +175 -0
- package/core/.kenaz/specialist/rune_efe_salience_gap.md +21 -0
- package/core/.kenaz/specialist/rune_ember_autonomous_dispatch_gate.md +24 -0
- package/core/.kenaz/specialist/rune_post_dispatch_verification_pattern.md +31 -0
- package/core/.kenaz/specialist/rune_surprise_proxy_improvement.md +28 -0
- package/core/.kenaz/specialist/rune_worktree_dispatch_pattern.md +31 -0
- package/core/.kenaz/specialist/rune_yaml_filter_desync_fix.md +26 -0
- package/core/.kenaz/specialist/rune_yggdrasil_project_identity_folder_name.md +24 -0
- package/core/.kenaz/specialist/sessions/chart_TASK_1599.json +41 -0
- package/core/.kenaz/specialist/sessions/hmap_028aa781-aad2-48c0-9a61-5540565d4a7f.json +5 -0
- package/core/.kenaz/specialist/sessions/hmap_20210387-0c64-400c-9d0a-53042a0cbd89.json +5 -0
- package/core/.kenaz/specialist/sessions/hmap_c1375c5d-fd9f-44bd-a83e-353ecbb0392f.json +5 -0
- package/core/.kenaz/specialist/sessions/scratch_028aa781-aad2-48c0-9a61-5540565d4a7f.json +6 -0
- package/core/.kenaz/specialist/sessions/scratch_0acc0fb3-24f9-453f-9e92-6ef1cdf03a7c.json +6 -0
- package/core/.kenaz/specialist/sessions/scratch_20210387-0c64-400c-9d0a-53042a0cbd89.json +6 -0
- package/core/.kenaz/specialist/sessions/scratch_2f10623e-b7a1-4647-905e-9dc7c4d99f9c.json +6 -0
- package/core/.kenaz/specialist/sessions/scratch_5a38b62d-608a-488c-82f0-7e47e95e0905.json +6 -0
- package/core/.kenaz/specialist/sessions/scratch_5d9758ef-d9b6-4ffe-a017-3ed26d0a313b.json +6 -0
- package/core/.kenaz/specialist/sessions/scratch_c1375c5d-fd9f-44bd-a83e-353ecbb0392f.json +6 -0
- package/core/.kenaz/specialist/sessions/scratch_c9f3c711-b73d-4fcd-ad2a-7b2bc024ee77.json +6 -0
- package/core/.kenaz/specialist/sessions/scratch_e72e5274-1c81-4655-a05a-f87d1ecb2917.json +6 -0
- package/core/.kenaz/specialist/sessions/scratch_f740cdbe-f756-41fc-98fb-2b1413d51901.json +6 -0
- package/core/.kenaz/specialist/t1777_probe.txt +1 -0
- package/core/.kenaz/specialist/task1825_update.json +43 -0
- package/core/.kenaz/specialist/task1827_update.json +43 -0
- package/core/.kenaz/specialist/task1828_update.json +43 -0
- package/core/.kenaz/specialist/taskgen/consolidation_i.json +38 -0
- package/core/.kenaz/specialist/taskgen/csharp_a.json +44 -0
- package/core/.kenaz/specialist/taskgen/csharp_b.json +40 -0
- package/core/.kenaz/specialist/taskgen/embedding_e.json +34 -0
- package/core/.kenaz/specialist/taskgen/hygiene_fg.json +39 -0
- package/core/.kenaz/specialist/taskgen/pathology_h.json +36 -0
- package/core/.kenaz/specialist/taskgen/unity_noise_d.json +38 -0
- package/core/.kenaz/specialist/taskgen/visibility_c.json +38 -0
- package/core/.kenaz/specialist/verify_1837.js +302 -0
- package/core/.kenaz/specialist/verify_1838.js +124 -0
- package/core/.kenaz/tmp/heimdall_proposal_fc7e0944.json +10 -0
- package/core/.kenaz/tmp_heimdall_proposal_8d3e392.json +13 -0
- package/core/.kenaz/tmp_props.json +1 -0
- package/core/.kenaz/tmp_sounddrop_t1_prompt.txt +371 -0
- package/core/.kenaz/user_model.schema.json +107 -0
- package/core/.matrix/README.md +257 -0
- package/core/.matrix/index.matrix +5 -0
- package/core/.mcp.json +8 -0
- package/core/.prefrontal/.gitkeep +0 -0
- package/core/.prefrontal/proposals/.gitkeep +0 -0
- package/core/.rule/INDEX.yaml +99 -0
- package/core/.rule/MECHANIZED.md +61 -0
- package/core/.rule/code/README.md +211 -0
- package/core/.rule/code/backend.yaml +294 -0
- package/core/.rule/code/checklist.yaml +258 -0
- package/core/.rule/code/maintainability.yaml +227 -0
- package/core/.rule/code/naming.yaml +106 -0
- package/core/.rule/code/principles.yaml +71 -0
- package/core/.rule/code/reusability.yaml +192 -0
- package/core/.rule/code/structure.yaml +218 -0
- package/core/.rule/code/style.yaml +197 -0
- package/core/.rule/design/ui.yaml +79 -0
- package/core/.rule/general/agent-workflow.yaml +572 -0
- package/core/.rule/general/cortex-memory-recall.yaml +446 -0
- package/core/.rule/general/cortex-tools.yaml +181 -0
- package/core/.rule/general/cross-platform.yaml +107 -0
- package/core/.rule/general/ddx-synapse-stack.yaml +162 -0
- package/core/.rule/general/file-size-threshold.yaml +45 -0
- package/core/.rule/general/identity-contract.schema.yaml +251 -0
- package/core/.rule/general/memory-language.yaml +67 -0
- package/core/.rule/general/memory-source-priority.yaml +207 -0
- package/core/.rule/general/pipeline.yaml +246 -0
- package/core/.rule/general/principles.yaml +77 -0
- package/core/.rule/general/project-self-containment.yaml +253 -0
- package/core/.rule/general/rust-verify-target.yaml +80 -0
- package/core/.rule/general/specialist-identity-contract.yaml +153 -0
- package/core/.rule/general/sunny-access-control.yaml +60 -0
- package/core/.rule/general/synapse-code-intelligence.yaml +375 -0
- package/core/.rule/general/synapse-cognitive-fusion.yaml +301 -0
- package/core/.rule/general/system-invariants.yaml +248 -0
- package/core/.rule/general/task-pool-routing.yaml +102 -0
- package/core/.rule/general/worktree-isolation.yaml +79 -0
- package/core/.rule/pipeline/PPL-002-completed-task-archival.yaml +528 -0
- package/core/.rule/pipeline/auto-update.yaml +282 -0
- package/core/.rule/pipeline/task-execution.yaml +368 -0
- package/core/.rule/tools/check-permissions.js +197 -0
- package/core/.specialist/Amelia/README.md +329 -0
- package/core/.specialist/Amelia/capability.yaml +386 -0
- package/core/.specialist/Amelia/knowledge.yaml +217 -0
- package/core/.specialist/Amelia/principles.yaml +10 -0
- package/core/.specialist/Amelia/rule.yaml +79 -0
- package/core/.specialist/Amelia/workflow.yaml +241 -0
- package/core/.specialist/Ansuz/HEURISTIC_BOOT_ROUTING.md +39 -0
- package/core/.specialist/Ansuz/ROUTING.md +35 -0
- package/core/.specialist/Ansuz/RULES.md +79 -0
- package/core/.specialist/Ansuz/SYSTEM_DOC.md +611 -0
- package/core/.specialist/Ansuz/VERIFY.md +38 -0
- package/core/.specialist/Ansuz/capability.yaml +338 -0
- package/core/.specialist/Ansuz/cognitive_principles.yaml +62 -0
- package/core/.specialist/Ansuz/concepts/agent_types.yaml +22 -0
- package/core/.specialist/Ansuz/concepts/autonomous_agenda.yaml +170 -0
- package/core/.specialist/Ansuz/concepts/autonomy_contract.yaml +126 -0
- package/core/.specialist/Ansuz/concepts/boot_ritual.yaml +107 -0
- package/core/.specialist/Ansuz/concepts/boot_rules_summary.yaml +16 -0
- package/core/.specialist/Ansuz/concepts/capability_pointers.yaml +21 -0
- package/core/.specialist/Ansuz/concepts/cognitive_fluency_contract.yaml +264 -0
- package/core/.specialist/Ansuz/concepts/cognitive_systems_competence_map.yaml +14 -0
- package/core/.specialist/Ansuz/concepts/cognitive_systems_hippocampus.yaml +14 -0
- package/core/.specialist/Ansuz/concepts/cognitive_systems_overview.yaml +27 -0
- package/core/.specialist/Ansuz/concepts/cognitive_systems_serendipity.yaml +14 -0
- package/core/.specialist/Ansuz/concepts/cognitive_systems_turn_context.yaml +13 -0
- package/core/.specialist/Ansuz/concepts/commitment_layer.yaml +150 -0
- package/core/.specialist/Ansuz/concepts/completion_tracking.yaml +29 -0
- package/core/.specialist/Ansuz/concepts/deep_knowledge_pointers.yaml +28 -0
- package/core/.specialist/Ansuz/concepts/evolvable_guardrails.yaml +20 -0
- package/core/.specialist/Ansuz/concepts/fatigue_handoff.yaml +84 -0
- package/core/.specialist/Ansuz/concepts/formation_quick_ref.yaml +28 -0
- package/core/.specialist/Ansuz/concepts/guardrails_immutable.yaml +31 -0
- package/core/.specialist/Ansuz/concepts/identity.yaml +48 -0
- package/core/.specialist/Ansuz/concepts/interaction_protocol.yaml +42 -0
- package/core/.specialist/Ansuz/concepts/meta_evolvable_tier.yaml +28 -0
- package/core/.specialist/Ansuz/concepts/mindset.yaml +18 -0
- package/core/.specialist/Ansuz/concepts/phase9_verification.yaml +21 -0
- package/core/.specialist/Ansuz/concepts/phase_protocol.yaml +66 -0
- package/core/.specialist/Ansuz/concepts/principles.yaml +65 -0
- package/core/.specialist/Ansuz/concepts/self_evolution_overview.yaml +53 -0
- package/core/.specialist/Ansuz/concepts/task_first_protocol.yaml +7 -0
- package/core/.specialist/Ansuz/concepts/task_pool.yaml +119 -0
- package/core/.specialist/Ansuz/concepts/task_system.yaml +22 -0
- package/core/.specialist/Ansuz/concepts/write_verification.yaml +26 -0
- package/core/.specialist/Ansuz/core.yaml +224 -0
- package/core/.specialist/Ansuz/decisions/ADR-requirement-graph-layer.md +390 -0
- package/core/.specialist/Ansuz/elixir.yaml +70 -0
- package/core/.specialist/Ansuz/exo_cortex_tools.yaml +13 -0
- package/core/.specialist/Ansuz/experiments/boot_ablation_replay.js +197 -0
- package/core/.specialist/Ansuz/guards/blind_spot_guards.yaml +28 -0
- package/core/.specialist/Ansuz/guards/lesson_guards.yaml +203 -0
- package/core/.specialist/Ansuz/identity_contract.yaml +375 -0
- package/core/.specialist/Ansuz/knowledge.yaml +284 -0
- package/core/.specialist/Ansuz/modules/amelia_review.yaml +112 -0
- package/core/.specialist/Ansuz/modules/ddx.yaml +47 -0
- package/core/.specialist/Ansuz/modules/design_checks.yaml +47 -0
- package/core/.specialist/Ansuz/modules/identity_verification.yaml +119 -0
- package/core/.specialist/Ansuz/modules/loop_guard.yaml +36 -0
- package/core/.specialist/Ansuz/modules/prevention.yaml +84 -0
- package/core/.specialist/Ansuz/modules/prophecy.yaml +95 -0
- package/core/.specialist/Ansuz/modules/pulse_empty.yaml +36 -0
- package/core/.specialist/Ansuz/modules/qa_intake.yaml +29 -0
- package/core/.specialist/Ansuz/modules/recall.yaml +45 -0
- package/core/.specialist/Ansuz/principles.yaml +31 -0
- package/core/.specialist/Ansuz/research/EMBER_architecture_comparison.md +142 -0
- package/core/.specialist/Ansuz/rule.yaml +97 -0
- package/core/.specialist/Ansuz/self_model_seed.backup.json +100 -0
- package/core/.specialist/Ansuz/self_model_seed.json +100 -0
- package/core/.specialist/Ansuz/self_model_seed.sha256 +1 -0
- package/core/.specialist/Ansuz/tools/ansuz-handoff-snapshot.js +626 -0
- package/core/.specialist/Ansuz/tools/ansuz-handoff.js +437 -0
- package/core/.specialist/Ansuz/tools/ansuz-sdk-runner.js +1254 -0
- package/core/.specialist/Ansuz/tools/ansuz-sdk-runner.test.js +137 -0
- package/core/.specialist/Ansuz/tools/ansuz-state.js +288 -0
- package/core/.specialist/Ansuz/tools/bootstrap-anchors.js +289 -0
- package/core/.specialist/Ansuz/tools/handoff-freshness-milestone.test.js +73 -0
- package/core/.specialist/Ansuz/tools/handoff-resolver.js +207 -0
- package/core/.specialist/Ansuz/tools/handoff-session-identity.test.js +333 -0
- package/core/.specialist/Ansuz/tools/handoff-snapshot-args.test.js +25 -0
- package/core/.specialist/Ansuz/tools/install-claude-hooks.js +354 -0
- package/core/.specialist/Ansuz/tools/install-claude-hooks.test.js +110 -0
- package/core/.specialist/Ansuz/tools/package.json +16 -0
- package/core/.specialist/Ansuz/tools/preservation-coordinator.js +504 -0
- package/core/.specialist/Ansuz/tools/verify-and-land.js +1012 -0
- package/core/.specialist/Ansuz/tools/verify-and-land.test.js +1099 -0
- package/core/.specialist/Ansuz/workflow.yaml +1273 -0
- package/core/.specialist/Forseti/capability.yaml +210 -0
- package/core/.specialist/Forseti/core.yaml +176 -0
- package/core/.specialist/Forseti/principles.yaml +88 -0
- package/core/.specialist/Forseti/rule.yaml +86 -0
- package/core/.specialist/Heimdall/SKILL.md +65 -0
- package/core/.specialist/Heimdall/capability.yaml +134 -0
- package/core/.specialist/Heimdall/core.yaml +275 -0
- package/core/.specialist/Heimdall/principles.yaml +66 -0
- package/core/.specialist/Heimdall/rule.yaml +68 -0
- package/core/.specialist/Huginn/capability.yaml +234 -0
- package/core/.specialist/Huginn/core.yaml +482 -0
- package/core/.specialist/Huginn/principles.yaml +57 -0
- package/core/.specialist/Huginn/rule.yaml +121 -0
- package/core/.specialist/REFLECTION_TO_CONTROL.md +347 -0
- package/core/.specialist/ansuz_session_handoff.json +96 -0
- package/core/.specialist/experiments/rg_benchmark.js +523 -0
- package/core/.specialist/experiments/rg_benchmark_results.json +27 -0
- package/core/.specialist/shared/cognitive-primer.md +15 -0
- package/core/.specialist/shared/guard_schema.json +290 -0
- package/core/.specialist/shared/principles.yaml +213 -0
- package/core/.specialist/tests/runtime-discovery/README.md +224 -0
- package/core/.specialist/tests/runtime-discovery/active-project-polling.test.js +495 -0
- package/core/.specialist/tests/runtime-discovery/port-binding.test.js +418 -0
- package/core/.specialist/tests/runtime-discovery/resolver-priority.test.js +693 -0
- package/core/.specialist/tests/runtime-discovery/resolver-skip-on-invalid.test.js +467 -0
- package/core/.specialist/tests/runtime-discovery/resolver-symmetry.test.js +679 -0
- package/core/.specialist/tests/runtime-discovery/tail-cli-project-path.test.js +231 -0
- package/core/.specialist/tools/MEMORY_RECALL_TRIGGERS.md +156 -0
- package/core/.specialist/tools/README.md +129 -0
- package/core/.specialist/tools/__tests__/freya-cli-contract.test.js +156 -0
- package/core/.specialist/tools/__tests__/task-1863-boot-lease-reuse.test.js +99 -0
- package/core/.specialist/tools/__tests__/task-1917-orphan-detection.test.js +175 -0
- package/core/.specialist/tools/__tests__/task-1977-banner-cap.test.js +129 -0
- package/core/.specialist/tools/__tests__/task-1983-lease-project-path.test.js +96 -0
- package/core/.specialist/tools/__tests__/task-2218-boot-session-id.test.js +118 -0
- package/core/.specialist/tools/__tests__/task-2222-session-identity-interleave.test.js +203 -0
- package/core/.specialist/tools/__tests__/task-2246-reap-honesty.test.js +96 -0
- package/core/.specialist/tools/__tests__/task-2254-handoff-archive-contract.test.js +60 -0
- package/core/.specialist/tools/__tests__/task-2272-open-card-status-quote.test.js +26 -0
- package/core/.specialist/tools/__tests__/task-2374-usage-counter.test.js +34 -0
- package/core/.specialist/tools/ansuz-boot-fast.js +1120 -0
- package/core/.specialist/tools/ansuz-boot-fast.test.js +705 -0
- package/core/.specialist/tools/canary.js +501 -0
- package/core/.specialist/tools/context-injection.js +395 -0
- package/core/.specialist/tools/design-reasoning.js +493 -0
- package/core/.specialist/tools/discovery-fixtures.js +308 -0
- package/core/.specialist/tools/discovery-runner.js +460 -0
- package/core/.specialist/tools/failure-detector.js +1132 -0
- package/core/.specialist/tools/identity-scorer.js +714 -0
- package/core/.specialist/tools/jev-optional-context.js +107 -0
- package/core/.specialist/tools/jev-optional-context.test.js +152 -0
- package/core/.specialist/tools/lesson-guard.js +1084 -0
- package/core/.specialist/tools/lib/chart-path.js +159 -0
- package/core/.specialist/tools/lib/chart-path.test.js +171 -0
- package/core/.specialist/tools/lib/project-resolver.js +200 -0
- package/core/.specialist/tools/lib/project-resolver.test.js +241 -0
- package/core/.specialist/tools/memory-action-log.js +839 -0
- package/core/.specialist/tools/phase-gate.js +3754 -0
- package/core/.specialist/tools/phase-gate.test.js +85 -0
- package/core/.specialist/tools/phase9-policy.test.js +109 -0
- package/core/.specialist/tools/precompute-runner.js +444 -0
- package/core/.specialist/tools/prompt-files.test.js +169 -0
- package/core/.specialist/tools/replay-detectors.js +290 -0
- package/core/.specialist/tools/rule-engine.js +621 -0
- package/core/.specialist/tools/session-boot-ownership.test.js +117 -0
- package/core/.specialist/tools/session-project-state.test.js +65 -0
- package/core/.specialist/tools/session.js +1866 -0
- package/core/.specialist/tools/stream-lease.js +263 -0
- package/core/.specialist/tools/task-bridge-jev.test.js +170 -0
- package/core/.specialist/tools/task-bridge.js +765 -0
- package/core/.specialist/tools/verify-identity.js +453 -0
- package/core/.specialist/tools/wish-mandate-delivery.test.js +76 -0
- package/core/.system/README.md +555 -0
- package/core/.system/agent-skills/README.md +724 -0
- package/core/.system/archive/README.md +499 -0
- package/core/.system/assessment/README.md +645 -0
- package/core/.system/cli-tools/README.md +724 -0
- package/core/.system/collaboration/KNOWLEDGE.md +65 -0
- package/core/.system/collaboration/README.md +570 -0
- package/core/.system/cortex/MODULES.md +1046 -0
- package/core/.system/dashboard/FRONTEND.md +812 -0
- package/core/.system/dashboard/README.md +737 -0
- package/core/.system/external-skills/README.md +522 -0
- package/core/.system/failure/README.md +723 -0
- package/core/.system/formation/LEGACY_SKILLS.md +972 -0
- package/core/.system/formation/POST_COMPLETE.md +600 -0
- package/core/.system/formation/README.md +1092 -0
- package/core/.system/formation/TOOLS_REFERENCE.md +1145 -0
- package/core/.system/githooks/README.md +846 -0
- package/core/.system/kenaz/README.md +787 -0
- package/core/.system/memory/README.md +716 -0
- package/core/.system/pipeline/README.md +712 -0
- package/core/.system/rule/README.md +794 -0
- package/core/.system/specialist/README.md +669 -0
- package/core/.system/specialist/STRUCTURE.md +262 -0
- package/core/.system/sunny/README.md +476 -0
- package/core/.system/sunny/RULES.json +89 -0
- package/core/.system/sunny/knowledge/INDEX.md +37 -0
- package/core/.system/sunny/knowledge/agent-teams-api.md +0 -0
- package/core/.system/sunny/knowledge/ansuz-specialist.md +500 -0
- package/core/.system/sunny/knowledge/claude-cli-spawn.md +177 -0
- package/core/.system/sunny/knowledge/collaboration-api.md +925 -0
- package/core/.system/sunny/teammates/README.md +107 -0
- package/core/.system/sunny/teammates/how_to_use.yaml +101 -0
- package/core/.system/sunny/teammates/tools/headless/launcher.js +318 -0
- package/core/.system/sunny/teammates/tools/powershell/launcher.js +241 -0
- package/core/.system/sunny/teammates/tools/powershell/start.bat +50 -0
- package/core/.system/sunny/teammates/tools/utils/env.js +96 -0
- package/core/.system/sunny/teammates/tools/utils/format-output.js +329 -0
- package/core/.system/sunny/tools.json +101 -0
- package/core/.vendor/js-yaml.cjs +2795 -0
- package/core/.vendor/require-yaml.cjs +8 -0
- package/core/CLAUDE.md +172 -0
- package/core/KENAZ_CORE_VERSION +1 -0
- package/core/dev/ALAYA_FIELD_FEEDBACK_DESIGN.md +126 -0
- package/core/dev/ANSUZ_SCAFFOLD_DIET_2026-09-20.md +231 -0
- package/core/dev/ANSUZ_STARTUP_INJECTION_REVIEW.md +355 -0
- package/core/dev/ANSUZ_WORKFLOW_MODERNIZATION.md +143 -0
- package/core/dev/CORTEX_META_GRAPH_ASSESSMENT.md +99 -0
- package/core/dev/FREYA_DOWNSTREAM_BUGS_2026-09-19.md +44 -0
- package/core/dev/GLOBAL_MEMORY_IDENTITY_CONSOLIDATION.md +263 -0
- package/core/dev/GUARD_EFFECTIVENESS_DESIGN.md +180 -0
- package/core/dev/HEALTH_GATE_VARIANCE_ASSESSMENT.md +271 -0
- package/core/dev/HOOK_DIET_2026-09-21.md +126 -0
- package/core/dev/JEV_INTEGRATION_PLAN.md +189 -0
- package/core/dev/KENAZ_AGENT_CONNECT_v1_SPEC.md +139 -0
- package/core/dev/MOBILE_DESIGN_SPEC.md +569 -0
- package/core/dev/MULTI_ANSUZ_SPEC.md +136 -0
- package/core/dev/MUNINN_RETIREMENT.md +115 -0
- package/core/dev/PHASE3_ATTRIBUTION_POPULATION_DIAGNOSIS.md +211 -0
- package/core/dev/PHASE3_P3-2B_TASKLEVEL_PROBE.md +83 -0
- package/core/dev/PHASE3_P3-2_POPULATION_DISJOINTNESS.md +83 -0
- package/core/dev/PHASE3_P3-2_REMEASURE_REPORT.md +231 -0
- package/core/dev/PREDICTION_GROUNDING_DESIGN.md +376 -0
- package/core/dev/PRODUCT_SPEC.md +317 -0
- package/core/dev/PRODUCT_SPEC_FOR_AI_tepmlate.md +716 -0
- package/core/dev/PROJECT_REGISTRY_DUPLICATE_ASSESSMENT.md +86 -0
- package/core/dev/STARTUP_TIMELINE_TASK_1995.md +181 -0
- package/core/dev/SYNAPSE_WORKER_PER_PROJECT.md +881 -0
- package/core/dev/TASK_1680_P3-3_DISPATCH_SPEC.md +96 -0
- package/core/dev/TASK_1684_CALIBRATION_IMPACT_ANALYSIS.md +170 -0
- package/core/dev/TASK_1684_FORK_A_GOODHART_DESIGN.md +171 -0
- package/core/dev/TASK_1684_P3_2_REMEASURE_VALIDATION.md +262 -0
- package/core/dev/TASK_1903_SIGNAL_AUC_MEASUREMENT.md +207 -0
- package/core/dev/TASK_1904_BRANCH_INTEGRITY_AUDIT.md +146 -0
- package/core/dev/ansuz-eval/README.md +38 -0
- package/core/dev/ansuz-eval/build-fixtures.js +87 -0
- package/core/dev/ansuz-eval/grade.js +96 -0
- package/core/dev/ansuz-eval/grader.test.js +117 -0
- package/core/dev/ansuz-eval/tasks.md +32 -0
- package/core/dev/archive/ansuz/BOOT_FULL.md +141 -0
- package/core/dev/archive/ansuz/agents/ansuz-boot.md +176 -0
- package/core/dev/archive/ansuz/designs/alaya-passive-surfacing.md +84 -0
- package/core/dev/archive/ansuz/designs/cc_memory_indexing.md +307 -0
- package/core/dev/archive/ansuz/designs/check_guard.md +322 -0
- package/core/dev/archive/ansuz/designs/consequence_loop.md +227 -0
- package/core/dev/archive/ansuz/designs/mcp_kuzudb_lock_architecture.md +312 -0
- package/core/dev/archive/ansuz/designs/phase0_git_enrichment.md +278 -0
- package/core/dev/archive/ansuz/designs/refactor_mcp_tools_synapse.md +490 -0
- package/core/dev/archive/ansuz/designs/semantic_markdown_extraction.md +167 -0
- package/core/dev/archive/ansuz/designs/task_1372_prompt_injects_into.md +193 -0
- package/core/dev/archive/ansuz/designs/thought_stack.md +286 -0
- package/core/dev/archive/ansuz/investigations/reachability_unified_api_2026-04-11.md +330 -0
- package/core/dev/archive/ansuz/investigations/synapse_orphans_indexing_bug_2026-04-11.md +352 -0
- package/core/dev/archive/ansuz/investigations/synapse_orphans_reindex_verification_2026-04-11.md +48 -0
- package/core/dev/archive/ansuz/investigations/synapse_orphans_verification_2026-04-11.md +170 -0
- package/core/dev/archive/ansuz/legacy/kernel.yaml +399 -0
- package/core/dev/archive/ansuz/legacy/phases/phase_0.yaml +418 -0
- package/core/dev/archive/ansuz/legacy/phases/phase_1.yaml +376 -0
- package/core/dev/archive/ansuz/legacy/phases/phase_10.yaml +35 -0
- package/core/dev/archive/ansuz/legacy/phases/phase_11.yaml +582 -0
- package/core/dev/archive/ansuz/legacy/phases/phase_2.yaml +94 -0
- package/core/dev/archive/ansuz/legacy/phases/phase_3.yaml +274 -0
- package/core/dev/archive/ansuz/legacy/phases/phase_4.yaml +67 -0
- package/core/dev/archive/ansuz/legacy/phases/phase_5.yaml +32 -0
- package/core/dev/archive/ansuz/legacy/phases/phase_6.yaml +91 -0
- package/core/dev/archive/ansuz/legacy/phases/phase_7.yaml +58 -0
- package/core/dev/archive/ansuz/legacy/phases/phase_8.yaml +146 -0
- package/core/dev/archive/ansuz/legacy/phases/phase_9.yaml +424 -0
- package/core/dev/archive/ansuz/specs/INDEX_bifrost_hook_parity.yaml +92 -0
- package/core/dev/archive/ansuz/specs/active-inference-formation.yaml +453 -0
- package/core/dev/archive/ansuz/specs/brief_TASK_1228_userpromptsubmit.yaml +191 -0
- package/core/dev/archive/ansuz/specs/brief_TASK_1229_pretooluse_posttooluse.yaml +250 -0
- package/core/dev/archive/ansuz/specs/brief_TASK_1230_sessionstart_stop.yaml +301 -0
- package/core/dev/archive/ansuz/specs/brief_TASK_1231_verification.yaml +272 -0
- package/core/dev/design/PHASE4_DESIGN.md +559 -0
- package/core/dev/design/dashboard_docs_integration_PLAN.md +388 -0
- package/core/dev/design/matrix_format_ABBREVIATIONS.md +655 -0
- package/core/dev/design/matrix_format_DESIGN_SPEC.md +601 -0
- package/core/dev/design/matrix_format_DISCUSSION_SUMMARY.md +484 -0
- package/core/dev/design/matrix_format_EXAMPLE_memory.matrix +13 -0
- package/core/dev/design/matrix_format_EXAMPLE_project_status.matrix +9 -0
- package/core/dev/design/matrix_format_EXAMPLE_tasks.matrix +14 -0
- package/core/dev/design/matrix_format_SYNTAX_BNF.md +754 -0
- package/core/dev/design/matrix_format_TOKEN_COMPARISON.md +484 -0
- package/core/dev/design/matrix_v2_COGNITIVE_DESIGN.md +503 -0
- package/core/dev/design/matrix_v2_DISCUSSION_SUMMARY.md +414 -0
- package/core/dev/design/matrix_v2_EXAMPLE.matrix +67 -0
- package/core/dev/designs/EXPANDABLE_CARD_DESIGN_SPEC.md +509 -0
- package/core/dev/jev-eval/ACTIVE_CORRECTION.md +52 -0
- package/core/dev/jev-eval/ANNOTATION_GUIDE.md +68 -0
- package/core/dev/jev-eval/BASELINE_COMPARISON.md +45 -0
- package/core/dev/jev-eval/CONTEXT_REVIEW.md +31 -0
- package/core/dev/jev-eval/EVALUATION_STATUS.md +39 -0
- package/core/dev/jev-eval/HISTORICAL_CORPUS.md +33 -0
- package/core/dev/jev-eval/PACKAGING_VERIFICATION.md +42 -0
- package/core/dev/jev-eval/README.md +101 -0
- package/core/dev/jev-eval/THALAMUS_RANKING.md +58 -0
- package/core/dev/jev-eval/VALIDATION_PROGRESS.md +54 -0
- package/core/dev/jev-eval/cli.mjs +50 -0
- package/core/dev/jev-eval/context.mjs +183 -0
- package/core/dev/jev-eval/corpus.mjs +186 -0
- package/core/dev/jev-eval/fixtures/conversation-review.seed.jsonl +6 -0
- package/core/dev/jev-eval/fixtures/synthetic.jsonl +11 -0
- package/core/dev/jev-eval/metrics.mjs +67 -0
- package/core/dev/jev-eval/muninn-baseline.mjs +119 -0
- package/core/dev/jev-eval/providers.mjs +95 -0
- package/core/dev/jev-eval/reports/annotation-pilot-2026-09-20.json +32 -0
- package/core/dev/jev-eval/reports/context-review-2026-09-20.json +48 -0
- package/core/dev/jev-eval/reports/conversation-review.pending.json +151 -0
- package/core/dev/jev-eval/reports/history-corpus-2026-09-20.json +52 -0
- package/core/dev/jev-eval/reports/length-probe-2026-09-20.json +133 -0
- package/core/dev/jev-eval/reports/live-smoke-2026-09-20.json +616 -0
- package/core/dev/jev-eval/reports/muninn-baseline-2026-09-20.json +52 -0
- package/core/dev/jev-eval/reports/resilience-2026-09-20.json +520 -0
- package/core/dev/jev-eval/reports/rules-baseline.json +197 -0
- package/core/dev/jev-eval/reports/synthetic-review.pending.json +357 -0
- package/core/dev/jev-eval/resilience.mjs +71 -0
- package/core/dev/jev-eval/review.mjs +78 -0
- package/core/dev/jev-eval/schema.mjs +87 -0
- package/core/dev/jev-eval/test/context.test.mjs +95 -0
- package/core/dev/jev-eval/test/corpus.test.mjs +102 -0
- package/core/dev/jev-eval/test/eval.test.mjs +146 -0
- package/core/dev/jev-eval/test/muninn-baseline.test.mjs +71 -0
- package/core/dev/jev-eval/test/resilience.test.mjs +72 -0
- package/core/dev/jev-eval/test/review.test.mjs +61 -0
- package/core/dev/pipeline/LOCK_STATE.json +4 -0
- package/core/dev/pipeline/OPTIMIZATION_PROPOSALS.json +32 -0
- package/core/dev/pipeline/PHASE3_PLANNING_SUMMARY.md +338 -0
- package/core/dev/pipeline/PIPELINE_CONFIG.json +46 -0
- package/core/dev/pipeline/PROGRESS.md +113 -0
- package/core/dev/pipeline/PROGRESS_template.md +860 -0
- package/core/dev/pipeline/QA_REPORT_F008.md +431 -0
- package/core/dev/pipeline/QA_REPORT_LOCAL_CLAUDE_DIAGNOSIS.md +583 -0
- package/core/dev/pipeline/README.md +210 -0
- package/core/dev/pipeline/SELF_ENHANCEMENT_STATUS.json.bak +47 -0
- package/core/dev/pipeline/TASK_QUEUE.json +192 -0
- package/core/dev/pipeline/WORKFLOW_GUIDE.md +824 -0
- package/core/dev/pipeline/archived/TASK_015_tauri_init.yaml +53 -0
- package/core/dev/pipeline/archived/TASK_016_tauri_commands.yaml +54 -0
- package/core/dev/pipeline/archived/TASK_017_rust_pty.yaml +54 -0
- package/core/dev/pipeline/archived/TASK_018_tauri_bundle.yaml +53 -0
- package/core/dev/pipeline/archived/TASK_019_release_workflow.yaml +56 -0
- package/core/dev/pipeline/archived/TASK_020_update_ui.yaml +54 -0
- package/core/dev/pipeline/archived/TASK_021_update_notification_ui.yaml +55 -0
- package/core/dev/pipeline/archived/TASK_022_remove_node_pty.yaml +65 -0
- package/core/dev/pipeline/archived/TASK_023_api_routes_migration.yaml +86 -0
- package/core/dev/pipeline/archived/TASK_024_feature_id_system.yaml +51 -0
- package/core/dev/pipeline/archived/TASK_025_executable_acceptance.yaml +66 -0
- package/core/dev/pipeline/archived/TASK_026_spec_versioning.yaml +56 -0
- package/core/dev/pipeline/archived/TASK_027_drift_detection.yaml +60 -0
- package/core/dev/pipeline/archived/TASK_028_tauri_pty_manager.yaml +60 -0
- package/core/dev/pipeline/archived/TASK_029_tauri_pty_commands.yaml +62 -0
- package/core/dev/pipeline/archived/TASK_030_frontend_session_adapter.yaml +54 -0
- package/core/dev/pipeline/archived/TASK_031_terminal_tauri_events.yaml +56 -0
- package/core/dev/pipeline/archived/TASK_041_scheduler_data_models.yaml +54 -0
- package/core/dev/pipeline/archived/TASK_042_path_lock_manager.yaml +53 -0
- package/core/dev/pipeline/archived/TASK_043_process_manager.yaml +57 -0
- package/core/dev/pipeline/archived/TASK_044_git_integration.yaml +85 -0
- package/core/dev/pipeline/archived/TASK_045_task_queue_manager.yaml +54 -0
- package/core/dev/pipeline/archived/TASK_046_scheduler_dispatcher.yaml +60 -0
- package/core/dev/pipeline/archived/TASK_047_tauri_scheduler_commands.yaml +55 -0
- package/core/dev/pipeline/archived/TASK_048_realtime_status_push.yaml +92 -0
- package/core/dev/pipeline/archived/TASK_049_frontend_scheduler_integration.yaml +58 -0
- package/core/dev/pipeline/archived/TASK_050_error_recovery.yaml +56 -0
- package/core/dev/pipeline/archived/TASK_051_optimization_proposals_backend.yaml +53 -0
- package/core/dev/pipeline/archived/TASK_052_optimization_proposals_ui.yaml +58 -0
- package/core/dev/pipeline/archived/TASK_053_optimization_proposals_diff_view.yaml +54 -0
- package/core/dev/pipeline/archived/TASK_054_multi_project_scheduler_state.yaml +76 -0
- package/core/dev/pipeline/archived/TASK_055_scheduler_api_project_scope.yaml +64 -0
- package/core/dev/pipeline/archived/TASK_056_frontend_scheduler_project_scope.yaml +62 -0
- package/core/dev/pipeline/archived/TASK_057_scheduler_module_structure.yaml +54 -0
- package/core/dev/pipeline/archived/TASK_058_scheduler_models_extract.yaml +51 -0
- package/core/dev/pipeline/archived/TASK_059_scheduler_core_extract.yaml +51 -0
- package/core/dev/pipeline/archived/TASK_060_scheduler_commands_extract.yaml +51 -0
- package/core/dev/pipeline/archived/TASK_061_scheduler_specialized_commands.yaml +53 -0
- package/core/dev/pipeline/archived/TASK_062_process_manager_module_structure.yaml +56 -0
- package/core/dev/pipeline/archived/TASK_063_process_manager_core_extract.yaml +56 -0
- package/core/dev/pipeline/archived/TASK_064_recovery_module_structure.yaml +57 -0
- package/core/dev/pipeline/archived/TASK_065_recovery_core_extract.yaml +56 -0
- package/core/dev/pipeline/archived/TASK_066_self_enhancement_scheduler_models.yaml +60 -0
- package/core/dev/pipeline/archived/TASK_067_agents_section_quick_actions.yaml +53 -0
- package/core/dev/pipeline/archived/TASK_067_self_enhancement_scheduler_core.yaml +65 -0
- package/core/dev/pipeline/archived/TASK_068_agent_workflow_rule_enhancement.yaml +46 -0
- package/core/dev/pipeline/archived/TASK_068_self_enhancement_tauri_commands.yaml +61 -0
- package/core/dev/pipeline/archived/TASK_069_agent_wizard_responsive.yaml +46 -0
- package/core/dev/pipeline/archived/TASK_069_self_enhancement_ui.yaml +62 -0
- package/core/dev/pipeline/archived/TASK_070_preview_panel_redesign.yaml +62 -0
- package/core/dev/pipeline/archived/TASK_070_self_enhancement_integration.yaml +57 -0
- package/core/dev/pipeline/archived/TASK_071_preview_panel_qa.yaml +98 -0
- package/core/dev/pipeline/archived/TASK_071_single_agent_config.yaml +57 -0
- package/core/dev/pipeline/archived/TASK_072_preview_modal_esc_fix.yaml +71 -0
- package/core/dev/pipeline/archived/TASK_072_product_review_module.yaml +57 -0
- package/core/dev/pipeline/archived/TASK_073_agents_page_component_refactor.yaml +68 -0
- package/core/dev/pipeline/archived/TASK_073_rename_single_agent.yaml +64 -0
- package/core/dev/pipeline/archived/TASK_074_preview_mode_ui_diagnosis.yaml +71 -0
- package/core/dev/pipeline/archived/TASK_074_single_agent_ui_toggle.yaml +56 -0
- package/core/dev/pipeline/archived/TASK_075_agents_page_component_refactor.yaml +69 -0
- package/core/dev/pipeline/archived/TASK_075_single_agent_integration_test.yaml +75 -0
- package/core/dev/pipeline/archived/TASK_076_preview_mode_ui_diagnosis.yaml +70 -0
- package/core/dev/pipeline/archived/TASK_076_single_agent_continuous_mode.yaml +65 -0
- package/core/dev/pipeline/archived/TASK_077_failure_directory_structure.yaml +51 -0
- package/core/dev/pipeline/archived/TASK_077_single_agent_typescript_types.yaml +59 -0
- package/core/dev/pipeline/archived/TASK_078_fail_001_agent_no_output.yaml +53 -0
- package/core/dev/pipeline/archived/TASK_078_single_agent_ui_simplify.yaml +74 -0
- package/core/dev/pipeline/archived/TASK_079_dashboard_rwd_responsive.yaml +63 -0
- package/core/dev/pipeline/archived/TASK_079_fail_002_json_bom.yaml +56 -0
- package/core/dev/pipeline/archived/TASK_080_fail_003_queue_pollution.yaml +56 -0
- package/core/dev/pipeline/archived/TASK_080_http_server_module.yaml +55 -0
- package/core/dev/pipeline/archived/TASK_081_failure_logging_tools.yaml +57 -0
- package/core/dev/pipeline/archived/TASK_081_http_api_routes.yaml +62 -0
- package/core/dev/pipeline/archived/TASK_082_frontend_api_adapter.yaml +51 -0
- package/core/dev/pipeline/archived/TASK_082_integrate_failure_to_workflow.yaml +60 -0
- package/core/dev/pipeline/archived/TASK_083_cleanup_nextjs_api.yaml +48 -0
- package/core/dev/pipeline/archived/TASK_083_task_queue_cleanup.yaml +67 -0
- package/core/dev/pipeline/archived/TASK_084_rust_dead_code_cleanup.yaml +66 -0
- package/core/dev/pipeline/archived/TASK_084_scheduler_sync_logic_fix.yaml +68 -0
- package/core/dev/pipeline/archived/TASK_085_http_api_web_mode_fixes.yaml +46 -0
- package/core/dev/pipeline/archived/TASK_085_memory_consolidation_0204_0205.yaml +98 -0
- package/core/dev/pipeline/archived/TASK_086_collapsible_preview_panel.yaml +161 -0
- package/core/dev/pipeline/archived/TASK_086_web_mode_feature_parity.yaml +62 -0
- package/core/dev/pipeline/archived/TASK_087_manual_memory_archival.yaml +163 -0
- package/core/dev/pipeline/archived/TASK_087_mobile_http_control.yaml +68 -0
- package/core/dev/pipeline/archived/TASK_088_fail_003_to_ppl_002_rule.yaml +63 -0
- package/core/dev/pipeline/archived/TASK_088_mobile_http_qa.yaml +121 -0
- package/core/dev/pipeline/archived/TASK_089_agent_collaboration_topic.yaml +60 -0
- package/core/dev/pipeline/archived/TASK_089_web_mode_monitor_fix.yaml +58 -0
- package/core/dev/pipeline/archived/TASK_090_cli_detection_fix.yaml +61 -0
- package/core/dev/pipeline/archived/TASK_090_ui_ux_lessons_topic.yaml +63 -0
- package/core/dev/pipeline/archived/TASK_091_expandable_card_design.yaml +56 -0
- package/core/dev/pipeline/archived/TASK_091_move_agent_section_components.yaml +65 -0
- package/core/dev/pipeline/archived/TASK_092_expandable_card_component.yaml +60 -0
- package/core/dev/pipeline/archived/TASK_092_refactor_agent_create_wizard.yaml +84 -0
- package/core/dev/pipeline/archived/TASK_093_taskcard_detail_integration.yaml +57 -0
- package/core/dev/pipeline/archived/TASK_093_update_barrel_exports_test.yaml +84 -0
- package/core/dev/pipeline/archived/TASK_094_ai_agent_generation_enhancement.yaml +115 -0
- package/core/dev/pipeline/archived/TASK_094_proposalcard_detail_integration.yaml +55 -0
- package/core/dev/pipeline/archived/TASK_095_preview_fixes.yaml +129 -0
- package/core/dev/pipeline/archived/TASK_095_single_agent_task_selector.yaml +60 -0
- package/core/dev/pipeline/archived/TASK_096_agents_page_ux_improvements.yaml +163 -0
- package/core/dev/pipeline/archived/TASK_096_single_agent_status_sync.yaml +60 -0
- package/core/dev/pipeline/archived/TASK_097_local_claude_error_logging.yaml +59 -0
- package/core/dev/pipeline/archived/TASK_097_single_agent_monitor_events.yaml +59 -0
- package/core/dev/pipeline/archived/TASK_098_product_manager_team_phase2.yaml +60 -0
- package/core/dev/pipeline/archived/TASK_098_single_agent_refactor_test.yaml +58 -0
- package/core/dev/pipeline/archived/TASK_099_backend_team_creation.yaml +258 -0
- package/core/dev/pipeline/archived/TASK_100_frontend_team_creation.yaml +61 -0
- package/core/dev/pipeline/archived/TASK_101_orchestrator_system.yaml +403 -0
- package/core/dev/pipeline/archived/TASK_102_designer_sre_teams.yaml +90 -0
- package/core/dev/pipeline/archived/TASK_103_integration_testing.yaml +86 -0
- package/core/dev/pipeline/archived/TASK_128_integration_testing.yaml +83 -0
- package/core/dev/pipeline/archived/TASK_134_cortex_v2_phase3_file_watcher.yaml +65 -0
- package/core/dev/pipeline/archived/TASK_134_team_http_api.yaml +96 -0
- package/core/dev/pipeline/archived/TASK_135_cortex_v2_phase3_git_monitor.yaml +63 -0
- package/core/dev/pipeline/archived/TASK_136_cortex_v2_phase3_change_analyzer.yaml +69 -0
- package/core/dev/pipeline/archived/TASK_137_cortex_v2_phase3_cache_invalidator.yaml +67 -0
- package/core/dev/pipeline/archived/TASK_137_team_orchestrator_integration.yaml +93 -0
- package/core/dev/pipeline/archived/TASK_138_cortex_v2_phase3_distributed_cache.yaml +68 -0
- package/core/dev/pipeline/archived/TASK_138_matrix_folder_structure.yaml +61 -0
- package/core/dev/pipeline/archived/TASK_139_cortex_v2_phase3_cache_prewarming.yaml +65 -0
- package/core/dev/pipeline/archived/TASK_146_unified_documentation.yaml +141 -0
- package/core/dev/pipeline/archived/TASK_147_pipeline_execution_rules.yaml +76 -0
- package/core/dev/pipeline/archived/TASK_148_update_claude_md.yaml +77 -0
- package/core/dev/pipeline/archived/TASK_149_fix_nextjs_mdx_serialization.yaml +63 -0
- package/core/dev/pipeline/archived/TASK_149_update_team_docs.yaml +77 -0
- package/core/dev/pipeline/archived/TASK_150_pipeline_workflow_guide.yaml +82 -0
- package/core/dev/pipeline/archived/TASK_164_fix_smart_context_switch.yaml +49 -0
- package/core/dev/pipeline/archived/TASK_165_ctags_symbol_index.yaml +53 -0
- package/core/dev/pipeline/archived/TASK_166_symbol_search_mcp_tool.yaml +48 -0
- package/core/dev/pipeline/archived/TASK_167_llm_module_summary.yaml +55 -0
- package/core/dev/pipeline/archived/TASK_168_map_reduce_context.yaml +51 -0
- package/core/dev/pipeline/archived/TASK_169_v2_integration_testing.yaml +52 -0
- package/core/dev/pipeline/backups/archive_2026-02-04T22-07-22/TASK_QUEUE_backup.json +95 -0
- package/core/dev/pipeline/docs/multi-agent-coordination.md +446 -0
- package/core/dev/pipeline/docs/overview.md +406 -0
- package/core/dev/pipeline/docs/task-management.md +412 -0
- package/core/dev/pipeline/docs/workflows.md +32 -0
- package/core/dev/pipeline/orchestrator/schemas/task_queue_schema.json +58 -0
- package/core/dev/pipeline/orchestrator/schemas/task_schema.json +139 -0
- package/core/dev/pipeline/plans/PLAN_task_cli_refactor.md +281 -0
- package/core/dev/pipeline/tasks/.gitkeep +1 -0
- package/core/dev/pipeline/test_results/TASK_TEST_PARALLEL_002_result.txt +27 -0
- package/core/dev/plans/CLI_FIRST_INSTALL_FLOW.md +128 -0
- package/core/dev/plans/FORMATION_RETIREMENT_PLAN.md +313 -0
- package/core/dev/plans/KUZU_REPLACEMENT_PLAN.md +126 -0
- package/core/dev/schemas/PRODUCT_SPEC.example.yaml +382 -0
- package/core/dev/schemas/PRODUCT_SPEC.schema.json +800 -0
- package/core/dev/schemas/README.md +517 -0
- package/core/dev/schemas/TASK.schema.json +226 -0
- package/core/dev/schemas/dataflows_ground_truth.yaml +173 -0
- package/core/dev/schemas/dataflows_spec.yaml +160 -0
- package/core/dev/schemas/extends_ground_truth.yaml +66 -0
- package/core/dev/schemas/extends_spec.yaml +121 -0
- package/core/dev/schemas/implements_ground_truth.yaml +77 -0
- package/core/dev/schemas/implements_spec.yaml +140 -0
- package/core/dev/scripts/CRASH_DIAGNOSIS.md +47 -0
- package/core/dev/scripts/README.md +142 -0
- package/core/dev/scripts/RUN_ONCE.bat +40 -0
- package/core/dev/scripts/START_DEV_AGENT.bat +63 -0
- package/core/dev/scripts/START_MULTI_AGENT.bat +80 -0
- package/core/dev/scripts/check-alaya-report-isolation.js +255 -0
- package/core/dev/scripts/check-file-size.js +268 -0
- package/core/dev/scripts/ci-feedback.js +251 -0
- package/core/dev/scripts/clean-verify-targets.js +132 -0
- package/core/dev/scripts/cleanup-queue.js +184 -0
- package/core/dev/scripts/cleanup_queue.js +86 -0
- package/core/dev/scripts/dev_agent_scheduler.ps1 +536 -0
- package/core/dev/scripts/dispatch-stats.js +384 -0
- package/core/dev/scripts/dispatch-stats.test.js +162 -0
- package/core/dev/scripts/gc-agent-worktrees.js +461 -0
- package/core/dev/scripts/gc-agent-worktrees.test.js +48 -0
- package/core/dev/scripts/hooks/README.md +148 -0
- package/core/dev/scripts/init_git.ps1 +396 -0
- package/core/dev/scripts/init_git.sh +337 -0
- package/core/dev/scripts/init_project.ps1 +851 -0
- package/core/dev/scripts/init_project.sh +477 -0
- package/core/dev/scripts/js-yaml-resolution.test.js +48 -0
- package/core/dev/scripts/kenaz-session.js +354 -0
- package/core/dev/scripts/kenaz-session.test.js +234 -0
- package/core/dev/scripts/legacy/README.md +39 -0
- package/core/dev/scripts/legacy/dev_agent_scheduler.ps1.bak +536 -0
- package/core/dev/scripts/legacy/multi_agent_scheduler.ps1.bak +1978 -0
- package/core/dev/scripts/matrix/CLI_README.md +214 -0
- package/core/dev/scripts/matrix/README.md +310 -0
- package/core/dev/scripts/matrix/package-lock.json +4266 -0
- package/core/dev/scripts/matrix/package.json +55 -0
- package/core/dev/scripts/matrix/src/abbreviations.ts +295 -0
- package/core/dev/scripts/matrix/src/cli/commands/convert.ts +211 -0
- package/core/dev/scripts/matrix/src/cli/commands/create.ts +95 -0
- package/core/dev/scripts/matrix/src/cli/commands/delete.ts +102 -0
- package/core/dev/scripts/matrix/src/cli/commands/list-tags.ts.wip +140 -0
- package/core/dev/scripts/matrix/src/cli/commands/manage-tags.ts.wip +173 -0
- package/core/dev/scripts/matrix/src/cli/commands/query.ts +261 -0
- package/core/dev/scripts/matrix/src/cli/commands/read.ts +77 -0
- package/core/dev/scripts/matrix/src/cli/commands/stats.ts.wip +168 -0
- package/core/dev/scripts/matrix/src/cli/commands/tokens.ts.wip +126 -0
- package/core/dev/scripts/matrix/src/cli/commands/update.ts +147 -0
- package/core/dev/scripts/matrix/src/cli/commands/validate.ts +275 -0
- package/core/dev/scripts/matrix/src/cli/index.ts +350 -0
- package/core/dev/scripts/matrix/src/cli/utils/file-handler.ts +72 -0
- package/core/dev/scripts/matrix/src/cli/utils/logger.ts +65 -0
- package/core/dev/scripts/matrix/src/index.ts +62 -0
- package/core/dev/scripts/matrix/src/indexer/tag-indexer.ts +165 -0
- package/core/dev/scripts/matrix/src/parser.ts +281 -0
- package/core/dev/scripts/matrix/src/serializer.ts +151 -0
- package/core/dev/scripts/matrix/src/validator.ts +301 -0
- package/core/dev/scripts/matrix/tests/abbreviations.test.ts +122 -0
- package/core/dev/scripts/matrix/tests/cli.test.ts +177 -0
- package/core/dev/scripts/matrix/tests/convert.test.ts +143 -0
- package/core/dev/scripts/matrix/tests/parser.test.ts +203 -0
- package/core/dev/scripts/matrix/tests/query.test.ts +85 -0
- package/core/dev/scripts/matrix/tests/serializer.test.ts +197 -0
- package/core/dev/scripts/matrix/tests/validate.test.ts +141 -0
- package/core/dev/scripts/matrix/tests/validator.test.ts +167 -0
- package/core/dev/scripts/matrix/tsconfig.json +20 -0
- package/core/dev/scripts/matrix/types/index.d.ts +111 -0
- package/core/dev/scripts/matrix/types/index.d.ts.map +1 -0
- package/core/dev/scripts/matrix/types/index.js +8 -0
- package/core/dev/scripts/matrix/types/index.js.map +1 -0
- package/core/dev/scripts/matrix/types/index.ts +124 -0
- package/core/dev/scripts/memory-guard-eval.js +330 -0
- package/core/dev/scripts/memory-usage-report.js +152 -0
- package/core/dev/scripts/migrate-task-dependencies.js +198 -0
- package/core/dev/scripts/multi_agent_scheduler.ps1 +2021 -0
- package/core/dev/scripts/multi_agent_scheduler.sh +1344 -0
- package/core/dev/scripts/probe/ansuz-scaffold-ablation.js +579 -0
- package/core/dev/scripts/probe/ansuz-scaffold-ablation.test.js +244 -0
- package/core/dev/scripts/probe/hippocampus-concurrency.js +247 -0
- package/core/dev/scripts/probe/hook-latency-probe.js +315 -0
- package/core/dev/scripts/probe/hook-latency-probe.test.js +105 -0
- package/core/dev/scripts/probe/prediction-signal-auc.js +483 -0
- package/core/dev/scripts/probe/prediction-signal-auc.test.js +200 -0
- package/core/dev/scripts/reset_tasks.js +99 -0
- package/core/dev/scripts/run-rust-tests.js +207 -0
- package/core/dev/scripts/run-rust-tests.test.js +154 -0
- package/core/dev/scripts/run_once.sh +47 -0
- package/core/dev/scripts/rust-verify-worktree.js +591 -0
- package/core/dev/scripts/rust-verify-worktree.test.js +574 -0
- package/core/dev/scripts/seh_probe.rs +26 -0
- package/core/dev/scripts/setup_mcp.ps1 +192 -0
- package/core/dev/scripts/setup_mcp.sh +159 -0
- package/core/dev/scripts/setup_rag.ps1 +304 -0
- package/core/dev/scripts/setup_rag.sh +230 -0
- package/core/dev/scripts/start_dev_agent.sh +137 -0
- package/core/dev/scripts/start_multi_agent.sh +41 -0
- package/core/dev/scripts/sync_task_queue.ps1 +505 -0
- package/core/dev/scripts/sync_task_queue.sh +392 -0
- package/core/dev/scripts/task1961/RUNBOOK.md +300 -0
- package/core/dev/scripts/task1961/fixtures/never-listens.server.js +54 -0
- package/core/dev/scripts/task1961/fixtures/slow-serve.server.js +134 -0
- package/core/dev/scripts/task1961/run-fixture.js +659 -0
- package/core/dev/scripts/task1961/selftest.js +247 -0
- package/core/dev/scripts/test-pty-ws-tunnel.js +229 -0
- package/core/dev/scripts/validate_pipeline.js +197 -0
- package/core/dev/scripts/verify-isbar-capture.js +100 -0
- package/core/dev/scripts/verify-target-dir.js +69 -0
- package/core/dev/scripts/verify-task-1839.js +141 -0
- package/core/dev/specs/agent-connect/PROTOCOL.md +177 -0
- package/core/dev/specs/agent-connect/SDK_GUIDE.md +915 -0
- package/core/dev/specs/agent-connect/examples/minimal-site/README.md +137 -0
- package/core/dev/specs/agent-connect/examples/minimal-site/package.json +12 -0
- package/core/dev/specs/agent-connect/examples/minimal-site/public/index.html +116 -0
- package/core/dev/specs/agent-connect/examples/minimal-site/public/install-redirect.js +73 -0
- package/core/dev/specs/agent-connect/examples/minimal-site/server.js +516 -0
- package/core/dev/specs/agent-connect/examples/minimal-site/test/smoke.test.mjs +263 -0
- package/core/dev/specs/agent-connect/history/DEFECT_REPORT_kenaz-agent-hub_2026-09-09_v0.4-empty-prompt-no-first-turn.md +77 -0
- package/core/dev/specs/agent-connect/history/DEFECT_REPORT_kenaz-agent-hub_2026-09-09_v0.4-prompt-mojibake.md +90 -0
- package/core/dev/specs/agent-connect/history/FEATURE_REQUEST_kenaz-agent-hub_2026-09-07.md +61 -0
- package/core/dev/specs/agent-connect/history/FEATURE_REQUEST_kenaz-agent-hub_2026-09-08_relay-v1-conformance.md +76 -0
- package/core/dev/specs/agent-connect/history/FEATURE_REQUEST_kenaz-agent-hub_2026-09-09_v0.4-session-channel.md +87 -0
- package/core/dev/specs/agent-connect/history/FLOWPIX_REPLY_agent-hub_2026-09-08_relay-v1-answers.md +68 -0
- package/core/dev/specs/agent-connect/history/FLOWPIX_bridge_CONTRACT.md +642 -0
- package/core/dev/specs/agent-connect/history/FLOWPIX_spikes_relay_spike_relay.mjs +244 -0
- package/core/dev/specs/agent-connect/history/KENAZ_RESPONSE_agent-hub_2026-09-07.md +77 -0
- package/core/dev/specs/agent-connect/history/KENAZ_RESPONSE_agent-hub_2026-09-08_direction-change-v0.3.md +44 -0
- package/core/dev/specs/agent-connect/history/KENAZ_RESPONSE_agent-hub_2026-09-08_relay-v1-answers-ack.md +37 -0
- package/core/dev/specs/agent-connect/history/KENAZ_RESPONSE_agent-hub_2026-09-08_relay-v1-conformance.md +56 -0
- package/core/dev/specs/agent-connect/history/KENAZ_RESPONSE_agent-hub_2026-09-09_annotations-install-coldstart.md +44 -0
- package/core/dev/specs/agent-connect/history/KENAZ_RESPONSE_agent-hub_2026-09-09_empty-prompt-first-turn.md +56 -0
- package/core/dev/specs/agent-connect/history/KENAZ_RESPONSE_agent-hub_2026-09-09_prompt-mojibake-fixed.md +48 -0
- package/core/dev/specs/agent-connect/history/KENAZ_RESPONSE_agent-hub_2026-09-09_session-channel.md +57 -0
- package/core/dev/specs/agent-connect/history/PROTOCOL_v0.3_snapshot.md +379 -0
- package/core/dev/specs/agent-connect/history/README.md +47 -0
- package/core/dev/specs/peer/CODEX_INTERACTIVE_PUSH.md +65 -0
- package/core/dev/specs/peer/CODEX_PEER_PULL_SPIKE.md +54 -0
- package/core/dev/specs/peer/MODS_SPIKE.md +133 -0
- package/core/dev/specs/peer/PER_PROJECT_ADDRESSING.md +143 -0
- package/core/dev/specs/peer/SWARM_PROTOCOLS.md +256 -0
- package/core/dev/specs/peer/codex-hook-shim-peer.test.js +101 -0
- package/core/dev/specs/peer/codex-push-launcher.test.js +142 -0
- package/core/dev/specs/peer/setup-codex-hooks.test.js +22 -0
- package/core/dev/specs/peer-ansuz/DELIVERY_SPIKE.md +397 -0
- package/core/dev/specs/peer-ansuz/DESIGN.md +109 -0
- package/core/dev/specs/peer-ansuz/spike/claude_poke.js +129 -0
- package/core/dev/specs/peer-ansuz/spike/claude_session_start_hook.js +37 -0
- package/core/dev/specs/peer-ansuz/spike/claude_settings_hook.json +14 -0
- package/core/dev/specs/peer-ansuz/spike/codex_appserver_client.js +105 -0
- package/core/dev/specs/peer-ansuz/spike/codex_appserver_query.js +29 -0
- package/core/dev/specs/peer-ansuz/spike/extract_timeline.js +26 -0
- package/core/dev/specs/synapse/SYMBOL_IDENTITY.md +305 -0
- package/core/dev/spikes/A4-cypher-varlen.md +176 -0
- package/core/dev/spikes/bloat-rounds.sh +25 -0
- package/core/dev/spikes/mods/clean-claude.js +9 -0
- package/core/dev/spikes/mods/drive-probe.js +29 -0
- package/core/dev/spikes/mods/e2e-peer.js +71 -0
- package/core/dev/spikes/mods/evidence/e2e-peer-control.json +17 -0
- package/core/dev/spikes/mods/evidence/e2e-peer-mod.json +17 -0
- package/core/dev/spikes/mods/evidence/probe-006a6e65-d807-4bc1-b648-fd7d1edfe0b4.jsonl +4 -0
- package/core/dev/spikes/mods/evidence/probe-cebdf1f7-f9c4-47a8-83cd-7c0786177404.jsonl +12 -0
- package/core/dev/spikes/mods/evidence/probe-eb21147d-10ce-4c32-93ed-37ca37d88d5a.jsonl +11 -0
- package/core/dev/spikes/mods/evidence/stream-cebdf1f7.jsonl +18 -0
- package/core/dev/spikes/mods/kenaz-mod-probe/.claude-plugin/plugin.json +1 -0
- package/core/dev/spikes/mods/kenaz-mod-probe/hooks/hooks.json +1 -0
- package/core/dev/spikes/mods/kenaz-mod-probe/hooks/register.ts +65 -0
- package/core/dev/spikes/mods/kenaz-mod-probe/tsconfig.json +3 -0
- package/core/k-cli/README.md +423 -0
- package/core/k-cli/package.json +21 -0
- package/core/k-cli/templates/k-cli.md +91 -0
- package/core/k-cli/test/TEST_SPEC.md +134 -0
- package/core/k-cli/test/run.sh +469 -0
- package/core/plugins/kenaz/.claude-plugin/plugin.json +1 -0
- package/core/plugins/kenaz/.mcp.json +5 -0
- package/core/plugins/kenaz/INVENTORY.md +48 -0
- package/core/plugins/kenaz/README.md +55 -0
- package/core/plugins/kenaz/commands/Amelia.md +5 -0
- package/core/plugins/kenaz/commands/Ansuz.md +38 -0
- package/core/plugins/kenaz/commands/architect.md +24 -0
- package/core/plugins/kenaz/commands/incident.md +15 -0
- package/core/plugins/kenaz/commands/kenaz.md +12 -0
- package/core/plugins/kenaz/commands/review.md +14 -0
- package/core/plugins/kenaz/commands/security.md +15 -0
- package/core/plugins/kenaz/commands/spec.md +22 -0
- package/core/plugins/kenaz/commands/strategy.md +141 -0
- package/core/plugins/kenaz/commands//347/224/242/345/223/201.md +15 -0
- package/core/plugins/kenaz/commands//350/250/255/350/250/210.md +14 -0
- package/core/plugins/kenaz/commands//350/251/225/344/274/260.md +16 -0
- package/core/plugins/kenaz/guidance.md +5 -0
- package/core/plugins/kenaz/hooks/core-resolve.js +230 -0
- package/core/plugins/kenaz/hooks/hooks.json +31 -0
- package/core/plugins/kenaz/hooks/kenaz-hook.js +112 -0
- package/core/plugins/kenaz/hooks/mode.js +39 -0
- package/core/plugins/kenaz/scripts/kenaz-mode.js +46 -0
- package/core/plugins/kenaz/scripts/kenaz.test.js +123 -0
- package/core/plugins/kenaz/scripts/sync.js +45 -0
- package/core/plugins/kenaz/scripts/ygg.js +157 -0
- package/core/plugins/kenaz/skills/adapt/SKILL.md +199 -0
- package/core/plugins/kenaz/skills/animate/SKILL.md +190 -0
- package/core/plugins/kenaz/skills/architect_agent/SKILL.md +408 -0
- package/core/plugins/kenaz/skills/assessment_agent/SKILL.md +289 -0
- package/core/plugins/kenaz/skills/audit/SKILL.md +129 -0
- package/core/plugins/kenaz/skills/backend_agent/SKILL.md +407 -0
- package/core/plugins/kenaz/skills/backend_engineer/SKILL.md +788 -0
- package/core/plugins/kenaz/skills/bolder/SKILL.md +132 -0
- package/core/plugins/kenaz/skills/clarify/SKILL.md +180 -0
- package/core/plugins/kenaz/skills/code_reviewer/SKILL.md +305 -0
- package/core/plugins/kenaz/skills/code_reviewer/patterns.yaml +85 -0
- package/core/plugins/kenaz/skills/colorize/SKILL.md +158 -0
- package/core/plugins/kenaz/skills/critique/SKILL.md +118 -0
- package/core/plugins/kenaz/skills/delight/SKILL.md +317 -0
- package/core/plugins/kenaz/skills/designer/SKILL.md +845 -0
- package/core/plugins/kenaz/skills/dev_agent/SKILL.md +503 -0
- package/core/plugins/kenaz/skills/developer/SKILL.md +792 -0
- package/core/plugins/kenaz/skills/distill/SKILL.md +137 -0
- package/core/plugins/kenaz/skills/extract/SKILL.md +95 -0
- package/core/plugins/kenaz/skills/feature_agent/SKILL.md +303 -0
- package/core/plugins/kenaz/skills/frontend-design/SKILL.md +127 -0
- package/core/plugins/kenaz/skills/frontend-design/reference/color-and-contrast.md +132 -0
- package/core/plugins/kenaz/skills/frontend-design/reference/interaction-design.md +123 -0
- package/core/plugins/kenaz/skills/frontend-design/reference/motion-design.md +99 -0
- package/core/plugins/kenaz/skills/frontend-design/reference/responsive-design.md +114 -0
- package/core/plugins/kenaz/skills/frontend-design/reference/spatial-design.md +100 -0
- package/core/plugins/kenaz/skills/frontend-design/reference/typography.md +131 -0
- package/core/plugins/kenaz/skills/frontend-design/reference/ux-writing.md +107 -0
- package/core/plugins/kenaz/skills/frontend_agent/SKILL.md +327 -0
- package/core/plugins/kenaz/skills/harden/SKILL.md +358 -0
- package/core/plugins/kenaz/skills/incident_response/SKILL.md +315 -0
- package/core/plugins/kenaz/skills/normalize/SKILL.md +67 -0
- package/core/plugins/kenaz/skills/onboard/SKILL.md +243 -0
- package/core/plugins/kenaz/skills/optimize/SKILL.md +269 -0
- package/core/plugins/kenaz/skills/polish/SKILL.md +202 -0
- package/core/plugins/kenaz/skills/product_manager/SKILL.md +1091 -0
- package/core/plugins/kenaz/skills/qa_engineer/SKILL.md +1269 -0
- package/core/plugins/kenaz/skills/quieter/SKILL.md +118 -0
- package/core/plugins/kenaz/skills/security_agent/SKILL.md +312 -0
- package/core/plugins/kenaz/skills/spec_optimizer/SKILL.md +299 -0
- package/core/plugins/kenaz/skills/sre_agent/SKILL.md +1347 -0
- package/core/plugins/kenaz/skills/ui-ux-pro-max/SKILL.md +377 -0
- package/core/plugins/kenaz/skills/ui-ux-pro-max/data/charts.csv +26 -0
- package/core/plugins/kenaz/skills/ui-ux-pro-max/data/colors.csv +97 -0
- package/core/plugins/kenaz/skills/ui-ux-pro-max/data/icons.csv +101 -0
- package/core/plugins/kenaz/skills/ui-ux-pro-max/data/landing.csv +31 -0
- package/core/plugins/kenaz/skills/ui-ux-pro-max/data/products.csv +97 -0
- package/core/plugins/kenaz/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
- package/core/plugins/kenaz/skills/ui-ux-pro-max/data/stacks/astro.csv +54 -0
- package/core/plugins/kenaz/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
- package/core/plugins/kenaz/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
- package/core/plugins/kenaz/skills/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
- package/core/plugins/kenaz/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
- package/core/plugins/kenaz/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
- package/core/plugins/kenaz/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
- package/core/plugins/kenaz/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
- package/core/plugins/kenaz/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
- package/core/plugins/kenaz/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
- package/core/plugins/kenaz/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
- package/core/plugins/kenaz/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
- package/core/plugins/kenaz/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
- package/core/plugins/kenaz/skills/ui-ux-pro-max/data/styles.csv +68 -0
- package/core/plugins/kenaz/skills/ui-ux-pro-max/data/typography.csv +58 -0
- package/core/plugins/kenaz/skills/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
- package/core/plugins/kenaz/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
- package/core/plugins/kenaz/skills/ui-ux-pro-max/data/web-interface.csv +31 -0
- package/core/plugins/kenaz/skills/ui-ux-pro-max/scripts/core.py +253 -0
- package/core/plugins/kenaz/skills/ui-ux-pro-max/scripts/design_system.py +1067 -0
- package/core/plugins/kenaz/skills/ui-ux-pro-max/scripts/search.py +106 -0
- package/core/plugins/kenaz-peer/.claude-plugin/plugin.json +1 -0
- package/core/plugins/kenaz-peer/hooks/hooks.json +1 -0
- package/core/plugins/kenaz-peer/hooks/register.test.ts +62 -0
- package/core/plugins/kenaz-peer/hooks/register.ts +146 -0
- package/core/plugins/kenaz-peer/tsconfig.json +3 -0
- package/lib/cli.js +251 -0
- package/lib/cli.test.js +59 -0
- package/lib/dashboard.js +80 -0
- package/lib/dashboard.test.js +59 -0
- package/package.json +28 -4
- package/vendor/install-kenaz-cli.js +268 -0
- package/README.md +0 -3
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { createHash, randomUUID } from 'node:crypto';
|
|
2
|
+
import { readFile, stat, writeFile, link, unlink } from 'node:fs/promises';
|
|
3
|
+
import { resolve } from 'node:path';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
import { check, keys, identity, stateHash, readJsonl, validateDataset, MAX_FILE_BYTES } from './schema.mjs';
|
|
6
|
+
|
|
7
|
+
export const REVIEW_VERSION = 'jev-review-v1';
|
|
8
|
+
const canonical = value => JSON.stringify(value, function (key, item) {
|
|
9
|
+
return item && typeof item === 'object' && !Array.isArray(item) ? Object.fromEntries(Object.keys(item).sort().map(k => [k, item[k]])) : item;
|
|
10
|
+
});
|
|
11
|
+
export const datasetHash = rows => createHash('sha256').update(canonical(rows)).digest('hex');
|
|
12
|
+
export function exportReview(rows) {
|
|
13
|
+
validateDataset(rows);
|
|
14
|
+
return { schema_version: 1, review_version: REVIEW_VERSION, dataset_hash: datasetHash(rows), items: rows.map(row => ({
|
|
15
|
+
...identity(row), state_hash: stateHash(row), purpose: row.purpose, language: row.language, context: structuredClone(row.state),
|
|
16
|
+
...(row.purpose === 'relevance' ? { candidates: row.candidates.map(({ id, text }) => ({ id, text })) } : {}),
|
|
17
|
+
decision: row.purpose === 'correction' ? { correction: null } : { grades: row.candidates.map(c => ({ id: c.id, grade: null })) },
|
|
18
|
+
reviewed: false, reviewer: null, reviewed_at: null,
|
|
19
|
+
})) };
|
|
20
|
+
}
|
|
21
|
+
function validTime(value) {
|
|
22
|
+
if (typeof value !== 'string' || !/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{3})?Z$/.test(value)) return false;
|
|
23
|
+
const time = Date.parse(value);
|
|
24
|
+
return Number.isFinite(time) && new Date(time).toISOString() === value.replace(/(?<!\.\d{3})Z$/, '.000Z');
|
|
25
|
+
}
|
|
26
|
+
export function applyReview(rows, review) {
|
|
27
|
+
const expected = exportReview(rows);
|
|
28
|
+
keys(review, ['schema_version', 'review_version', 'dataset_hash', 'items']);
|
|
29
|
+
check(review.schema_version === 1 && review.review_version === REVIEW_VERSION, 'invalid_review_version');
|
|
30
|
+
check(review.dataset_hash === expected.dataset_hash, 'stale_dataset');
|
|
31
|
+
check(Array.isArray(review.items) && review.items.length === rows.length, 'incomplete_review');
|
|
32
|
+
const byId = new Map();
|
|
33
|
+
for (const item of review.items) { check(item && !byId.has(item.id), 'duplicate_review'); byId.set(item.id, item); }
|
|
34
|
+
const result = rows.map((row, index) => {
|
|
35
|
+
const item = byId.get(row.id), base = expected.items[index]; keys(item, Object.keys(base));
|
|
36
|
+
for (const key of Object.keys(base).filter(k => !['decision', 'reviewed', 'reviewer', 'reviewed_at'].includes(k))) check(canonical(item[key]) === canonical(base[key]), 'review_identity_mismatch');
|
|
37
|
+
check(item.reviewed === true, 'unreviewed_item');
|
|
38
|
+
check(typeof item.reviewer === 'string' && item.reviewer.trim().length > 0 && item.reviewer.length <= 160, 'invalid_reviewer');
|
|
39
|
+
check(validTime(item.reviewed_at), 'invalid_review_date');
|
|
40
|
+
const out = structuredClone(row);
|
|
41
|
+
if (row.purpose === 'correction') { keys(item.decision, ['correction']); check(typeof item.decision.correction === 'boolean', 'invalid_review_decision'); out.labels.correction = item.decision.correction; }
|
|
42
|
+
else {
|
|
43
|
+
keys(item.decision, ['grades']);
|
|
44
|
+
check(Array.isArray(item.decision.grades) && item.decision.grades.length === row.candidates.length, 'incomplete_grades');
|
|
45
|
+
const grades = new Map();
|
|
46
|
+
for (const c of item.decision.grades) { keys(c, ['id', 'grade']); check(!grades.has(c.id) && row.candidates.some(x => x.id === c.id) && Number.isInteger(c.grade) && c.grade >= 0 && c.grade <= 3, 'invalid_review_grade'); grades.set(c.id, c.grade); }
|
|
47
|
+
for (const c of out.candidates) c.grade = grades.get(c.id);
|
|
48
|
+
}
|
|
49
|
+
out.provenance = { ...out.provenance, annotation: 'human_verified', reviewer: item.reviewer, reviewed_at: item.reviewed_at };
|
|
50
|
+
return out;
|
|
51
|
+
});
|
|
52
|
+
return validateDataset(result);
|
|
53
|
+
}
|
|
54
|
+
export async function main(args = process.argv.slice(2)) {
|
|
55
|
+
const [command, ...rest] = args; check(['export', 'apply'].includes(command), 'invalid_command');
|
|
56
|
+
const options = {};
|
|
57
|
+
for (let i = 0; i < rest.length; i += 2) { check(['--dataset', '--out', ...(command === 'apply' ? ['--reviews'] : [])].includes(rest[i]) && typeof rest[i + 1] === 'string' && !rest[i + 1].startsWith('--') && !Object.hasOwn(options, rest[i]), 'invalid_arguments'); options[rest[i]] = rest[i + 1]; }
|
|
58
|
+
check(options['--dataset'] && options['--out'] && (command !== 'apply' || options['--reviews']), 'missing_argument');
|
|
59
|
+
check(resolve(options['--dataset']).toLowerCase() !== resolve(options['--out']).toLowerCase() && (!options['--reviews'] || resolve(options['--reviews']).toLowerCase() !== resolve(options['--out']).toLowerCase()), 'overwrite_forbidden');
|
|
60
|
+
const rows = validateDataset(await readJsonl(options['--dataset']));
|
|
61
|
+
let output;
|
|
62
|
+
if (command === 'export') output = JSON.stringify(exportReview(rows), null, 2) + '\n';
|
|
63
|
+
else {
|
|
64
|
+
check((await stat(options['--reviews'])).size <= MAX_FILE_BYTES, 'file_budget_exceeded');
|
|
65
|
+
const text = await readFile(options['--reviews'], 'utf8'); check(Buffer.byteLength(text) <= MAX_FILE_BYTES, 'file_budget_exceeded');
|
|
66
|
+
let review; try { review = JSON.parse(text.replace(/^\uFEFF/, '')); } catch { throw new Error('invalid_review_json'); }
|
|
67
|
+
output = applyReview(rows, review).map(r => JSON.stringify(r)).join('\n') + '\n';
|
|
68
|
+
}
|
|
69
|
+
check(Buffer.byteLength(output) <= MAX_FILE_BYTES, 'file_budget_exceeded');
|
|
70
|
+
// A same-directory hard link publishes only the complete file, and fails if out exists.
|
|
71
|
+
const temporary = `${options['--out']}.${randomUUID()}.tmp`;
|
|
72
|
+
try { await writeFile(temporary, output, { flag: 'wx', encoding: 'utf8' }); await link(temporary, options['--out']); }
|
|
73
|
+
finally { await unlink(temporary).catch(() => {}); }
|
|
74
|
+
return { schema_version: 1, operation: command, count: rows.length, promotion_eligible: false, human_review_is_attestation_not_proof: true };
|
|
75
|
+
}
|
|
76
|
+
if (process.argv[1] && resolve(process.argv[1]) === fileURLToPath(import.meta.url)) main().then(r => console.log(JSON.stringify(r, null, 2))).catch(error => {
|
|
77
|
+
console.error(JSON.stringify({ error: /^[a-z_]{1,80}$/.test(error.message) ? error.message : error.code === 'EEXIST' ? 'output_exists' : 'operation_failed' })); process.exitCode = 1;
|
|
78
|
+
});
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { readFile, stat } from 'node:fs/promises';
|
|
2
|
+
import { createHash } from 'node:crypto';
|
|
3
|
+
|
|
4
|
+
export const MAX_FILE_BYTES = 8 * 1024 * 1024;
|
|
5
|
+
export const MAX_RECORD_BYTES = 64 * 1024;
|
|
6
|
+
export const SPLITS = ['development', 'calibration', 'held_out'];
|
|
7
|
+
export function check(condition, code = 'invalid_data') { if (!condition) throw new Error(code); }
|
|
8
|
+
export const object = x => x !== null && typeof x === 'object' && !Array.isArray(x);
|
|
9
|
+
export const number = (x, min, max) => typeof x === 'number' && Number.isFinite(x) && x >= min && x <= max;
|
|
10
|
+
const string = x => typeof x === 'string' && x.trim().length > 0 && x.length <= 16384;
|
|
11
|
+
const identifier = x => typeof x === 'string' && /^[\w.:/-]{1,160}$/.test(x);
|
|
12
|
+
export function keys(x, names) {
|
|
13
|
+
check(object(x) && Object.keys(x).length === names.length && names.every(k => Object.hasOwn(x, k)), 'invalid_fields');
|
|
14
|
+
}
|
|
15
|
+
export async function readJsonl(path) {
|
|
16
|
+
check((await stat(path)).size <= MAX_FILE_BYTES, 'file_budget_exceeded');
|
|
17
|
+
const text = await readFile(path, 'utf8');
|
|
18
|
+
check(Buffer.byteLength(text) <= MAX_FILE_BYTES, 'file_budget_exceeded');
|
|
19
|
+
try { return text.replace(/^\uFEFF/, '').split(/\r?\n/).filter(x => x.trim()).map(x => {
|
|
20
|
+
check(Buffer.byteLength(x) <= MAX_RECORD_BYTES, 'record_budget_exceeded');
|
|
21
|
+
return JSON.parse(x);
|
|
22
|
+
}); } catch { throw new Error('invalid_jsonl'); }
|
|
23
|
+
}
|
|
24
|
+
export function inputState(row) {
|
|
25
|
+
return { purpose: row.purpose, ...row.state, ...(row.purpose === 'relevance' ? { candidates: row.candidates.map(({ id, text }) => ({ id, text })) } : {}) };
|
|
26
|
+
}
|
|
27
|
+
export const stateHash = row => createHash('sha256').update(JSON.stringify(inputState(row))).digest('hex');
|
|
28
|
+
export function identity(row) {
|
|
29
|
+
return Object.fromEntries(['id', 'project_id', 'session_id', 'task_id', 'event_id', 'event_seq', 'task_revision'].map(k => [k, row[k]]));
|
|
30
|
+
}
|
|
31
|
+
export function validateDataset(rows) {
|
|
32
|
+
check(Array.isArray(rows) && rows.length > 0 && rows.length <= 10000, 'invalid_dataset_size');
|
|
33
|
+
const ids = new Set(), events = new Set(), splits = new Map(), texts = new Map();
|
|
34
|
+
for (const row of rows) {
|
|
35
|
+
check(Buffer.byteLength(JSON.stringify(row)) <= MAX_RECORD_BYTES, 'record_budget_exceeded');
|
|
36
|
+
keys(row, ['schema_version', 'id', 'project_id', 'session_id', 'group_id', 'task_id', 'event_id', 'event_seq', 'task_revision', 'purpose', 'language', 'split', 'provenance', 'state', row.purpose === 'correction' ? 'labels' : 'candidates']);
|
|
37
|
+
check(row.schema_version === 1, 'invalid_schema_version');
|
|
38
|
+
for (const k of ['id', 'project_id', 'session_id', 'group_id', 'task_id', 'event_id']) check(identifier(row[k]), 'invalid_identifier');
|
|
39
|
+
for (const k of ['event_seq', 'task_revision']) check(Number.isSafeInteger(row[k]) && row[k] >= 0, 'invalid_revision');
|
|
40
|
+
check(['correction', 'relevance'].includes(row.purpose) && ['en', 'zh', 'mixed'].includes(row.language) && SPLITS.includes(row.split), 'invalid_enum');
|
|
41
|
+
keys(row.provenance, ['source', 'annotation', 'reviewer', 'reviewed_at']);
|
|
42
|
+
check(['synthetic', 'real'].includes(row.provenance.source) && ['agent_proposed', 'human_verified'].includes(row.provenance.annotation), 'invalid_provenance');
|
|
43
|
+
check(row.provenance.annotation === 'human_verified' ? string(row.provenance.reviewer) : row.provenance.reviewer === null, 'invalid_reviewer');
|
|
44
|
+
check(row.provenance.annotation === 'human_verified' ? typeof row.provenance.reviewed_at === 'string' && /^\d{4}-\d{2}-\d{2}T/.test(row.provenance.reviewed_at) && Number.isFinite(Date.parse(row.provenance.reviewed_at)) : row.provenance.reviewed_at === null, 'invalid_review_date');
|
|
45
|
+
keys(row.state, ['goal', 'assumptions', 'message']);
|
|
46
|
+
check(string(row.state.goal) && string(row.state.message) && Array.isArray(row.state.assumptions) && row.state.assumptions.length <= 20 && row.state.assumptions.every(string), 'invalid_state');
|
|
47
|
+
if (row.purpose === 'correction') { keys(row.labels, ['correction']); check(typeof row.labels.correction === 'boolean', 'invalid_label'); }
|
|
48
|
+
else {
|
|
49
|
+
check(Array.isArray(row.candidates) && row.candidates.length >= 2 && row.candidates.length <= 12, 'invalid_candidates');
|
|
50
|
+
const candidateIds = new Set();
|
|
51
|
+
for (const c of row.candidates) { keys(c, ['id', 'text', 'grade']); check(identifier(c.id) && string(c.text) && Number.isInteger(c.grade) && number(c.grade, 0, 3) && !candidateIds.has(c.id), 'invalid_candidate'); candidateIds.add(c.id); }
|
|
52
|
+
}
|
|
53
|
+
check(!ids.has(row.id), 'duplicate_id'); ids.add(row.id);
|
|
54
|
+
const event = JSON.stringify([row.project_id, row.session_id, row.event_id, row.purpose]);
|
|
55
|
+
check(!events.has(event), 'duplicate_event'); events.add(event);
|
|
56
|
+
for (const group of [`session:${row.project_id}:${row.session_id}`, `group:${row.group_id}`]) {
|
|
57
|
+
check(!splits.has(group) || splits.get(group) === row.split, 'split_leakage'); splits.set(group, row.split);
|
|
58
|
+
}
|
|
59
|
+
const hash = stateHash(row);
|
|
60
|
+
check(!texts.has(hash) || texts.get(hash) === row.split, 'content_split_leakage'); texts.set(hash, row.split);
|
|
61
|
+
}
|
|
62
|
+
return rows;
|
|
63
|
+
}
|
|
64
|
+
export function validatePrediction(row, prediction) {
|
|
65
|
+
keys(prediction, [...Object.keys(identity(row)), 'state_hash', 'model', 'question_set_version', 'status', 'failure_reason', 'http_status', 'usage', 'latency_ms', row.purpose === 'correction' ? 'correction_probability' : 'scores']);
|
|
66
|
+
for (const [k, v] of Object.entries(identity(row))) check(prediction[k] === v, 'prediction_identity_mismatch');
|
|
67
|
+
check(prediction.state_hash === stateHash(row), 'stale_prediction');
|
|
68
|
+
check(['jev-1.13.0', 'rules-v1'].includes(prediction.model) && prediction.question_set_version === 'jev-eval-v1', 'invalid_prediction_version');
|
|
69
|
+
check(['ok', 'abstain', 'timeout', 'unavailable', 'invalid'].includes(prediction.status), 'invalid_status');
|
|
70
|
+
check(number(prediction.latency_ms, 0, 3600000), 'invalid_latency');
|
|
71
|
+
check(prediction.http_status === null || Number.isInteger(prediction.http_status) && number(prediction.http_status, 100, 599), 'invalid_http_status');
|
|
72
|
+
check(prediction.status === 'ok' ? prediction.failure_reason === null : ['timeout', 'http_failure', 'transport_failure', 'invalid_response', 'abstain'].includes(prediction.failure_reason), 'invalid_failure_reason');
|
|
73
|
+
if (prediction.usage !== null) { keys(prediction.usage, ['input_tokens', 'output_tokens']); for (const n of Object.values(prediction.usage)) check(Number.isSafeInteger(n) && n >= 0, 'invalid_usage'); }
|
|
74
|
+
if (row.purpose === 'correction') {
|
|
75
|
+
check(prediction.status === 'ok' ? number(prediction.correction_probability, 0, 1) : prediction.correction_probability === null, 'invalid_probability');
|
|
76
|
+
} else {
|
|
77
|
+
check(Array.isArray(prediction.scores) && prediction.scores.length === row.candidates.length, 'invalid_scores');
|
|
78
|
+
const expected = new Set(row.candidates.map(c => c.id));
|
|
79
|
+
for (const item of prediction.scores) {
|
|
80
|
+
keys(item, ['id', 'score']); check(expected.delete(item.id), 'invalid_score_id');
|
|
81
|
+
check(item.score === null || number(item.score, 0, 3), 'invalid_score');
|
|
82
|
+
if (prediction.status !== 'ok') check(item.score === null, 'failure_with_score');
|
|
83
|
+
}
|
|
84
|
+
if (prediction.status === 'ok') check(prediction.scores.some(s => s.score !== null), 'empty_ok_prediction');
|
|
85
|
+
}
|
|
86
|
+
return prediction;
|
|
87
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import test from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { mkdtemp, writeFile, symlink, readdir, unlink, rmdir, lstat } from 'node:fs/promises';
|
|
4
|
+
import { createHash } from 'node:crypto';
|
|
5
|
+
import { tmpdir } from 'node:os';
|
|
6
|
+
import { join } from 'node:path';
|
|
7
|
+
import { enrich, resolveSource, renderHtml } from '../context.mjs';
|
|
8
|
+
import { normalizeMessage, redactHomePaths, credentialBearing } from '../corpus.mjs';
|
|
9
|
+
|
|
10
|
+
const hash = text => createHash('sha256').update(text).digest('hex'), cwd = 'C:/Users/test/Documents/GitHub/KenazAI';
|
|
11
|
+
const c = (uuid, parentUuid, role, text, extra = {}) => ({ uuid, parentUuid, sessionId: 's1', cwd, type: role, message: { role, content: [{ type: 'text', text }] }, ...extra });
|
|
12
|
+
async function fixture(t, kind, records, targetLine, overrides = {}) {
|
|
13
|
+
const dir = await mkdtemp(join(tmpdir(), 'jev-context-test-'));
|
|
14
|
+
t.after(async () => { for (const name of await readdir(dir)) { const p = join(dir, name), s = await lstat(p); if (s.isSymbolicLink() && process.platform === 'win32') await rmdir(p); else await unlink(p); } await rmdir(dir); });
|
|
15
|
+
const path = join(dir, 'source.jsonl'), bytes = records.map(r => JSON.stringify(r) + '\n').join(''); await writeFile(path, bytes);
|
|
16
|
+
const source = { kind, relative_path: 'source.jsonl', source_id: hash(`${kind}:source.jsonl`) };
|
|
17
|
+
const target = records[targetLine - 1], message = normalizeMessage(redactHomePaths(kind === 'claude' ? target.message.content[0].text : target.payload.message));
|
|
18
|
+
const row = { kind: 'pending_historical_review', id: hash(`${source.source_id}:${targetLine}:${hash(message.toLowerCase())}`), source_id: source.source_id, session_id: hash(`${kind}:s1`), group_id: 'group', message, review_status: 'pending', provenance: { source: 'real', annotation: 'unreviewed' }, ...overrides };
|
|
19
|
+
return { dir, path, bytes, row, source, manifest: { schema_version: 1, sources: [source], items: [{ id: row.id, source_id: source.source_id, line: targetLine }] }, options: { sourceRoots: { claude: dir, codex: dir }, cwdRoots: [cwd] } };
|
|
20
|
+
}
|
|
21
|
+
test('Claude ancestry follows parent UUID rather than neighboring branch, skips thinking/tools/future', async t => {
|
|
22
|
+
const records = [c('u1', null, 'user', 'Start'), c('a1', 'u1', 'assistant', 'Correct branch'), c('wrong', 'u1', 'assistant', 'Other branch'), c('tool', 'a1', 'user', '', { message: { role: 'user', content: [{ type: 'tool_result', content: 'secret tool output' }] } }), c('thinking', 'tool', 'assistant', '', { message: { role: 'assistant', content: [{ type: 'thinking', thinking: 'hidden reasoning' }] } }), c('target', 'thinking', 'user', 'Please revise'), c('future', 'target', 'assistant', 'Future answer')];
|
|
23
|
+
const f = await fixture(t, 'claude', records, 6), before = JSON.stringify(f.row), result = await enrich([f.row], f.manifest, f.options), row = result.rows[0];
|
|
24
|
+
assert.equal(row.status, 'restored'); assert.deepEqual(row.observed_context.map(c => c.text), ['Start', 'Correct branch']);
|
|
25
|
+
assert.ok(row.observed_context.every(c => c.source_line < row.target_line)); assert.equal(JSON.stringify(row).includes('hidden reasoning'), false); assert.equal(JSON.stringify(row).includes('Other branch'), false);
|
|
26
|
+
assert.equal(row.source_prefix_sha256, hash(records.slice(0, 6).map(r => JSON.stringify(r) + '\n').join(''))); assert.equal(JSON.stringify(f.row), before); assert.equal(row.decision.correction, null);
|
|
27
|
+
});
|
|
28
|
+
test('stale targets and wrong session rejected without dropping IDs', async t => {
|
|
29
|
+
const f = await fixture(t, 'claude', [c('a', null, 'assistant', 'Context'), c('u', 'a', 'user', 'Target')], 2);
|
|
30
|
+
for (const change of [r => r.message = 'Changed', r => r.session_id = hash('other'), r => r.review_status = 'human_verified']) {
|
|
31
|
+
const row = structuredClone(f.row); change(row); const result = await enrich([row], f.manifest, f.options); assert.equal(result.rows[0].id, row.id); assert.equal(result.rows[0].status, 'rejected'); assert.equal(result.rows[0].observed_context, undefined);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
test('source paths reject traversal absolute paths hash mismatch and symlink escape', async t => {
|
|
35
|
+
const f = await fixture(t, 'claude', [c('u', null, 'user', 'Target')], 1);
|
|
36
|
+
for (const relative_path of ['../outside', '/absolute', 'C:\\absolute', 'nested/../../outside']) await assert.rejects(resolveSource({ kind: 'claude', relative_path, source_id: hash(`claude:${relative_path}`) }, f.options.sourceRoots), /unsafe_source_path/);
|
|
37
|
+
await assert.rejects(resolveSource({ ...f.source, source_id: 'wrong' }, f.options.sourceRoots), /source_id_mismatch/);
|
|
38
|
+
const outside = await fixture(t, 'claude', [c('u', null, 'user', 'Other')], 1), link = join(f.dir, 'escape');
|
|
39
|
+
await symlink(outside.dir, link, process.platform === 'win32' ? 'junction' : 'dir');
|
|
40
|
+
await assert.rejects(resolveSource({ kind: 'claude', relative_path: 'escape/source.jsonl', source_id: hash('claude:escape/source.jsonl') }, f.options.sourceRoots), /source_path_escape/);
|
|
41
|
+
});
|
|
42
|
+
test('credential context dropped as whole message and gaps remain explicit', async t => {
|
|
43
|
+
const f = await fixture(t, 'claude', [c('a1', null, 'assistant', 'Safe context'), c('a2', 'a1', 'assistant', 'Use apikey_abcdefgh12345 now'), c('u', 'a2', 'user', 'Continue')], 3);
|
|
44
|
+
const row = (await enrich([f.row], f.manifest, f.options)).rows[0]; assert.equal(row.status, 'partial'); assert.deepEqual(row.observed_context.map(c => c.text), ['Safe context']); assert.ok(row.context_gaps.includes('credential_context')); assert.equal(JSON.stringify(row).includes('apikey_'), false);
|
|
45
|
+
});
|
|
46
|
+
test('normalization and JSON quote escaping cannot hide credential context', async t => {
|
|
47
|
+
const escaped = 'API_KEY="abcd1234"'; assert.equal(credentialBearing(escaped), true); assert.equal(credentialBearing(JSON.stringify(escaped)), false);
|
|
48
|
+
for (const text of [escaped, 'The config is {"API_KEY":"abc12345"}', 'Use API_KEY=abc12345 locally', 'APIKEY_abcdefgh12345']) {
|
|
49
|
+
assert.equal(credentialBearing(normalizeMessage(text)), true);
|
|
50
|
+
const f = await fixture(t, 'claude', [c('safe', null, 'assistant', 'Safe earlier text'), c('secret', 'safe', 'assistant', text), c('target', 'secret', 'user', 'Continue')], 3);
|
|
51
|
+
const row = (await enrich([f.row], f.manifest, f.options)).rows[0];
|
|
52
|
+
assert.deepEqual(row.observed_context.map(c => c.text), ['Safe earlier text']);
|
|
53
|
+
assert.ok(row.context_gaps.includes('credential_context')); assert.ok(row.observed_context.every(c => !credentialBearing(c.text)));
|
|
54
|
+
}
|
|
55
|
+
const target = await fixture(t, 'claude', [c('user', null, 'user', 'API_KEY=abc12345')], 1);
|
|
56
|
+
assert.equal((await enrich([target.row], target.manifest, target.options)).rows[0].status, 'rejected');
|
|
57
|
+
});
|
|
58
|
+
const meta = { type: 'session_meta', payload: { id: 's1', cwd, source: 'cli' } };
|
|
59
|
+
const assistant = text => ({ type: 'response_item', payload: { type: 'message', role: 'assistant', phase: 'final_answer', content: [{ type: 'output_text', text }] } });
|
|
60
|
+
const user = text => ({ type: 'event_msg', payload: { type: 'user_message', message: text } });
|
|
61
|
+
test('Codex compaction/scope resets context and event assistant duplicates are ignored', async t => {
|
|
62
|
+
const list = [meta, assistant('Before reset'), { type: 'compacted', payload: {} }, assistant('After reset'), { type: 'event_msg', payload: { type: 'agent_message', message: 'Event duplicate' } }, user('Target'), assistant('Future')];
|
|
63
|
+
const f = await fixture(t, 'codex', list, 6), row = (await enrich([f.row], f.manifest, f.options)).rows[0];
|
|
64
|
+
assert.deepEqual(row.observed_context.map(c => c.text), ['After reset']); assert.ok(row.context_gaps.includes('compaction_or_rollback'));
|
|
65
|
+
const scoped = await fixture(t, 'codex', [meta, assistant('Original cwd'), { type: 'turn_context', payload: { cwd: 'C:/Other' } }, assistant('Foreign'), { type: 'turn_context', payload: { cwd } }, user('Return')], 6);
|
|
66
|
+
assert.equal((await enrich([scoped.row], scoped.manifest, scoped.options)).rows[0].status, 'missing');
|
|
67
|
+
});
|
|
68
|
+
test('bounded context marks truncation, missing ancestry never uses nearest neighbor', async t => {
|
|
69
|
+
const long = await fixture(t, 'claude', [c('a', null, 'assistant', 'Long visible text '.repeat(500)), c('u', 'a', 'user', 'Target')], 2);
|
|
70
|
+
const row = (await enrich([long.row], long.manifest, long.options)).rows[0]; assert.equal(row.status, 'partial'); assert.equal(row.observed_context[0].text.length, 3000); assert.equal(row.observed_context[0].truncated, true);
|
|
71
|
+
const missing = await fixture(t, 'claude', [c('a', null, 'assistant', 'Not ancestor'), c('u', 'unknown', 'user', 'Target')], 2);
|
|
72
|
+
const m = (await enrich([missing.row], missing.manifest, missing.options)).rows[0]; assert.equal(m.status, 'missing'); assert.ok(m.context_gaps.includes('missing_ancestor'));
|
|
73
|
+
});
|
|
74
|
+
test('static HTML escapes raw content and has no scripts or external resources', () => {
|
|
75
|
+
const html = renderHtml([{ id: 'case', status: 'restored', message: '<script>fetch("https://evil")</script>', observed_context: [{ role: 'assistant', source_line: 1, text: '<img src=x onerror=alert(1)>' }] }]);
|
|
76
|
+
assert.equal(html.includes('<script>'), false); assert.equal(html.includes('<img'), false); assert.ok(html.includes('<script>')); assert.ok(html.includes("default-src 'none'"));
|
|
77
|
+
});
|
|
78
|
+
test('metadata-only duplicate UUID tolerated; conflicting text identity rejected', async t => {
|
|
79
|
+
const first = c('a', null, 'assistant', 'Actual context');
|
|
80
|
+
const attachment = { uuid: 'attachment', type: 'attachment', parentUuid: 'a', sessionId: 's1', cwd, arbitraryMetadata: 1 };
|
|
81
|
+
const f = await fixture(t, 'claude', [first, attachment, { ...attachment, arbitraryMetadata: 2 }, c('u', 'a', 'user', 'Target')], 4);
|
|
82
|
+
assert.equal((await enrich([f.row], f.manifest, f.options)).rows[0].status, 'restored');
|
|
83
|
+
const bad = await fixture(t, 'claude', [first, c('a', null, 'assistant', 'Conflicting context'), c('u', 'a', 'user', 'Target')], 3);
|
|
84
|
+
assert.equal((await enrich([bad.row], bad.manifest, bad.options)).rows[0].status, 'rejected');
|
|
85
|
+
});
|
|
86
|
+
test('ancestry walk and Codex history window are bounded with explicit gaps', async t => {
|
|
87
|
+
const list = [c('a', null, 'assistant', 'Ancient context')];
|
|
88
|
+
for (let i = 0; i < 6; i++) list.push({ uuid: `tool${i}`, parentUuid: i ? `tool${i - 1}` : 'a', sessionId: 's1', cwd, type: 'user', message: { role: 'user', content: [{ type: 'tool_result', content: 'omitted' }] } });
|
|
89
|
+
list.push(c('u', 'tool5', 'user', 'Target'));
|
|
90
|
+
const f = await fixture(t, 'claude', list, list.length); f.options.limits = { maxAncestorSteps: 3 };
|
|
91
|
+
const row = (await enrich([f.row], f.manifest, f.options)).rows[0]; assert.ok(row.context_gaps.includes('ancestry_budget')); assert.equal(row.status, 'missing');
|
|
92
|
+
const history = [meta, ...Array.from({ length: 25 }, (_, i) => assistant(`Turn ${i}`)), user('Target')];
|
|
93
|
+
const g = await fixture(t, 'codex', history, history.length), restored = (await enrich([g.row], g.manifest, g.options)).rows[0];
|
|
94
|
+
assert.equal(restored.observed_context.length, 6); assert.ok(restored.context_gaps.includes('history_window')); assert.ok(renderHtml([restored]).includes('history_window'));
|
|
95
|
+
});
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import test from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { mkdtemp, mkdir, writeFile, readdir, unlink, rmdir } from 'node:fs/promises';
|
|
4
|
+
import { tmpdir } from 'node:os';
|
|
5
|
+
import { join } from 'node:path';
|
|
6
|
+
import { credentialBearing, generatedMessage, automationSeed, redactHomePaths, userText, withinRoots, extractFile, sampleCandidates, records, discover, inventory, main } from '../corpus.mjs';
|
|
7
|
+
|
|
8
|
+
async function temp(t) {
|
|
9
|
+
const dir = await mkdtemp(join(tmpdir(), 'jev-corpus-test-'));
|
|
10
|
+
async function cleanup(path) { for (const entry of await readdir(path, { withFileTypes: true })) { const child = join(path, entry.name); if (entry.isDirectory()) await cleanup(child); else await unlink(child); } await rmdir(path); }
|
|
11
|
+
t.after(() => cleanup(dir)); return dir;
|
|
12
|
+
}
|
|
13
|
+
const roots = ['C:/Users/test/Documents/GitHub/KenazAI'];
|
|
14
|
+
const claude = (text, extra = {}) => ({ type: 'user', sessionId: 's1', cwd: roots[0], message: { role: 'user', content: text }, ...extra });
|
|
15
|
+
const meta = (extra = {}) => ({ type: 'session_meta', payload: { id: 's1', cwd: roots[0], source: 'cli', ...extra } });
|
|
16
|
+
const event = text => ({ type: 'event_msg', payload: { type: 'user_message', message: text } });
|
|
17
|
+
const response = text => ({ type: 'response_item', payload: { type: 'message', role: 'user', content: [{ type: 'input_text', text }] } });
|
|
18
|
+
async function extract(t, items, kind = 'claude', limits = {}) {
|
|
19
|
+
const dir = await temp(t), path = join(dir, 's.jsonl'); await writeFile(path, items.map(r => JSON.stringify(r)).join('\n'));
|
|
20
|
+
const stats = {}, candidates = await extractFile({ path, kind, relative_path: 's.jsonl' }, roots, stats, limits); return { candidates, stats };
|
|
21
|
+
}
|
|
22
|
+
test('credential detection quarantines whole message and home paths are removed', () => {
|
|
23
|
+
for (const text of ['apikey_abcdefgh123456', 'sk-abcdefgh-123456', 'Authorization: Bearer abcdefgh123', '$env:TYPESAFE_API_KEY="abc123456"', 'export API_KEY=abc12345', 'password: hunter22', 'https://user:secret@site.test', '-----BEGIN PRIVATE KEY-----', 'github_pat_abcde12345678']) assert.equal(credentialBearing(text), true);
|
|
24
|
+
assert.equal(credentialBearing('Please configure the API key locally.'), false);
|
|
25
|
+
const clean = redactHomePaths('C:\\Users\\someone\\repo /home/someone/repo /Users/someone/file'); assert.equal(clean.includes('someone'), false);
|
|
26
|
+
});
|
|
27
|
+
test('generated and non-user records are excluded without fabricated labels', async t => {
|
|
28
|
+
for (const text of ['# AGENTS.md instructions for repo', '<environment_context>cwd</environment_context>', '[CANARY:v2]', '<system-reminder>generated</system-reminder>', '<subagent_notification>done</subagent_notification>']) assert.equal(generatedMessage(text), true);
|
|
29
|
+
assert.equal(userText(claude([{ type: 'tool_result', content: 'not user' }]), 'claude'), null);
|
|
30
|
+
const { candidates } = await extract(t, [claude('Real request'), claude('internal', { isMeta: true }), claude('render-only', { isVisibleInTranscriptOnly: true }), { type: 'assistant', message: { role: 'assistant', content: 'not user' } }, claude('<environment_context>private</environment_context>'), claude('Another request')]);
|
|
31
|
+
assert.equal(candidates.length, 2);
|
|
32
|
+
for (const { row } of candidates) { for (const field of ['labels', 'goal', 'assumptions', 'grade']) assert.equal(Object.hasOwn(row, field), false); assert.equal(row.review_status, 'pending'); assert.equal(row.incomplete_context_for_correction, true); }
|
|
33
|
+
});
|
|
34
|
+
test('secret message cannot survive as later preceding context', async t => {
|
|
35
|
+
const { candidates, stats } = await extract(t, [claude('First'), claude('Use apikey_abcdefgh1234 now'), claude('Next request')]);
|
|
36
|
+
assert.equal(candidates.length, 2); assert.equal(stats.credential_message, 1); assert.equal(candidates[1].row.context_missing, true);
|
|
37
|
+
assert.equal(JSON.stringify(candidates).includes('apikey_'), false);
|
|
38
|
+
});
|
|
39
|
+
test('Codex exact cwd boundaries and subagent metadata fail closed', async t => {
|
|
40
|
+
assert.equal(withinRoots(roots[0] + '/dashboard', roots), true); assert.equal(withinRoots(roots[0] + 'Else', roots), false); assert.equal(withinRoots(roots[0] + '/../Other', roots), false);
|
|
41
|
+
for (const metadata of [meta({ cwd: 'C:/Other' }), meta({ source: { subagent: { parent_thread_id: 'parent' } } })]) assert.equal((await extract(t, [metadata, event('Request')], 'codex')).candidates.length, 0);
|
|
42
|
+
assert.equal((await extract(t, [event('No metadata')], 'codex')).candidates.length, 0);
|
|
43
|
+
const proper = await extract(t, [meta(), response('Replayed old text'), event('Actual text'), response('Actual text')], 'codex');
|
|
44
|
+
assert.equal(proper.candidates.length, 1); assert.equal(proper.candidates[0].row.message, 'Actual text'); assert.equal(proper.candidates[0].row.context_missing, true);
|
|
45
|
+
const fallback = await extract(t, [meta(), response('Fallback text')], 'codex'); assert.equal(fallback.candidates.length, 1); assert.equal(fallback.stats.response_fallback_candidates, 1);
|
|
46
|
+
});
|
|
47
|
+
test('whole Claude sidechain file rejected even after first candidate', async t => {
|
|
48
|
+
const { candidates } = await extract(t, [claude('Earlier request'), claude('Subagent request', { isSidechain: true })]); assert.equal(candidates.length, 0);
|
|
49
|
+
});
|
|
50
|
+
test('automation seeds exclude entire session while genuine TASK references remain', async t => {
|
|
51
|
+
const seeds = ['- ## Automated Dispatch Context\nThis prompt was machine-assembled by the Kenaz orchestration system.', 'This prompt was machine-assembled by the Kenaz orchestration system.', '- Extract key technical insights from this conversation chunk. Output in English only. Be concise, 1-3 sentences.', '[HEADLESS MODE] 你已被 Formation Lead 指派任務', 'You have access to MCP tools from kenaz-dashboard. Call the synapse_status tool now.'];
|
|
52
|
+
for (const seed of seeds) {
|
|
53
|
+
assert.equal(automationSeed(seed), true);
|
|
54
|
+
const result = await extract(t, [claude('Prior automated followup'), claude(seed), claude('Continue automatically')]);
|
|
55
|
+
assert.equal(result.candidates.length, 0); assert.equal(result.stats.automation_seed, 1);
|
|
56
|
+
}
|
|
57
|
+
assert.equal(automationSeed('Please investigate TASK_35 and explain the Automated Dispatch Context header.'), false);
|
|
58
|
+
const genuine = await extract(t, [claude('Please investigate TASK_35'), claude('[Request interrupted by user for tool use]'), claude('<turn_aborted>The user interrupted the previous turn</turn_aborted>'), claude('Continue my investigation')]);
|
|
59
|
+
assert.equal(genuine.candidates.length, 2);
|
|
60
|
+
const smoke = await extract(t, [meta(), event(seeds.at(-1)), event('Continue')], 'codex'); assert.equal(smoke.candidates.length, 0);
|
|
61
|
+
});
|
|
62
|
+
test('automation discovered in one source excludes same session in another source', async t => {
|
|
63
|
+
const dir = await temp(t), claudeRoot = join(dir, 'claude'), codexRoot = join(dir, 'codex'), project = join(claudeRoot, 'C-KenazAI');
|
|
64
|
+
await mkdir(project, { recursive: true }); await mkdir(codexRoot);
|
|
65
|
+
await writeFile(join(project, 'a.jsonl'), JSON.stringify(claude('Earlier inherited automated turn')));
|
|
66
|
+
await writeFile(join(project, 'b.jsonl'), JSON.stringify(claude('[HEADLESS MODE] 你已被 Formation Lead 指派任務')));
|
|
67
|
+
const result = await inventory({ claudeRoot, codexRoot, roots }); assert.equal(result.rows.length, 0); assert.equal(result.summary.exclusions.cross_file_automation_candidates, 1);
|
|
68
|
+
});
|
|
69
|
+
test('Claude foreign/missing cwd excluded; changing session identity rejects entire file', async t => {
|
|
70
|
+
const foreign = await extract(t, [claude('Allowed first'), claude('Foreign', { cwd: 'C:/Other' }), claude('Allowed return'), claude('Missing', { cwd: undefined })]);
|
|
71
|
+
assert.equal(foreign.candidates.length, 2); assert.equal(foreign.candidates[1].row.context_missing, true);
|
|
72
|
+
const mixed = await extract(t, [claude('First'), claude('Other session', { sessionId: 's2' })]); assert.equal(mixed.candidates.length, 0); assert.equal(mixed.stats.session_identity_change, 1);
|
|
73
|
+
const reentry = await extract(t, [meta(), event('First'), { type: 'turn_context', payload: { cwd: 'C:/Other' } }, { type: 'turn_context', payload: { cwd: roots[0] } }, event('Return')], 'codex');
|
|
74
|
+
assert.equal(reentry.candidates[1].row.context_missing, true);
|
|
75
|
+
});
|
|
76
|
+
test('dedup and balanced sampling deterministic; generic duplicates do not merge families', async t => {
|
|
77
|
+
const { candidates: a } = await extract(t, [claude('Continue'), claude('Unique A1'), claude('Unique A2')]);
|
|
78
|
+
const { candidates: b } = await extract(t, [claude(' continue ', { sessionId: 's2' }), claude('Unique B1', { sessionId: 's2' }), claude('Unique B2', { sessionId: 's2' })]);
|
|
79
|
+
const input = [...a, ...b], sample = sampleCandidates(input, 4);
|
|
80
|
+
assert.equal(sample.unique_count, 5); assert.equal(sample.duplicate_count, 1); assert.equal(sample.group_count, 2);
|
|
81
|
+
assert.deepEqual(sampleCandidates([...input].reverse(), 4), sample); assert.equal(new Set(sample.selected.map(c => c.row.session_id)).size, 2);
|
|
82
|
+
const lengthy = 'Copied historical context '.repeat(10);
|
|
83
|
+
const c = await extract(t, [claude(lengthy)]), d = await extract(t, [claude(lengthy, { sessionId: 's2' })]);
|
|
84
|
+
assert.equal(sampleCandidates([...c.candidates, ...d.candidates]).group_count, 1);
|
|
85
|
+
});
|
|
86
|
+
test('stream bounds discard oversized lines then recover next JSON record', async t => {
|
|
87
|
+
const dir = await temp(t), path = join(dir, 'big.jsonl'); await writeFile(path, 'x'.repeat(200000) + '\n' + JSON.stringify({ ok: true }) + '\n');
|
|
88
|
+
const stats = {}, output = []; for await (const item of records(path, stats, { maxLineBytes: 100 })) output.push(item);
|
|
89
|
+
assert.equal(stats.oversize_line, 1); assert.deepEqual(output, [{ value: { ok: true }, line: 2 }]);
|
|
90
|
+
});
|
|
91
|
+
test('discovery excludes non-Kenaz Claude and nested subagents; summary only dry output', async t => {
|
|
92
|
+
const dir = await temp(t), claudeRoot = join(dir, 'claude'), codexRoot = join(dir, 'codex');
|
|
93
|
+
for (const path of [join(claudeRoot, 'C-KenazAI'), join(claudeRoot, 'C-Other'), join(claudeRoot, 'C-KenazAI', 'subagents'), codexRoot]) await mkdir(path, { recursive: true });
|
|
94
|
+
await writeFile(join(claudeRoot, 'C-KenazAI', 's.jsonl'), JSON.stringify(claude('Kept real user text')));
|
|
95
|
+
await writeFile(join(claudeRoot, 'C-KenazAI', 'agent-1.jsonl'), JSON.stringify(claude('Agent')));
|
|
96
|
+
await writeFile(join(claudeRoot, 'C-Other', 's.jsonl'), JSON.stringify(claude('Other')));
|
|
97
|
+
await writeFile(join(claudeRoot, 'C-KenazAI', 'subagents', 'a.jsonl'), JSON.stringify(claude('Nested')));
|
|
98
|
+
assert.equal((await discover({ claudeRoot, codexRoot })).length, 1);
|
|
99
|
+
const result = await inventory({ claudeRoot, codexRoot, roots, target: 500 }); assert.equal(result.summary.shortfall, 499);
|
|
100
|
+
const report = await main(['--claude-root', claudeRoot, '--codex-root', codexRoot]); assert.equal(report.written, false); assert.equal(JSON.stringify(report).includes('Kept real'), false);
|
|
101
|
+
await assert.rejects(main(['--target', 'NaN']), /invalid_target/);
|
|
102
|
+
});
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import test from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { createServer } from 'node:http';
|
|
4
|
+
import { once } from 'node:events';
|
|
5
|
+
import { spawnSync } from 'node:child_process';
|
|
6
|
+
import { template, main } from '../cli.mjs';
|
|
7
|
+
import { readJsonl, validateDataset, validatePrediction, stateHash, inputState } from '../schema.mjs';
|
|
8
|
+
import { MODEL, RUBRIC, prediction, rules, replayProvider, liveProvider, buildRequest, parseAnswers } from '../providers.mjs';
|
|
9
|
+
import { report } from '../metrics.mjs';
|
|
10
|
+
|
|
11
|
+
const fixture = new URL('../fixtures/synthetic.jsonl', import.meta.url);
|
|
12
|
+
const rows = validateDataset(await readJsonl(fixture));
|
|
13
|
+
const clone = x => structuredClone(x);
|
|
14
|
+
const row = () => template();
|
|
15
|
+
function correctionResponse(noul = 0.9) { return { model: MODEL, answers: { correction: { type: 'noul', noul } }, usage: { input_tokens: 30, output_tokens: 2 } }; }
|
|
16
|
+
async function server(t, handler) {
|
|
17
|
+
const http = createServer(handler); http.listen(0, '127.0.0.1'); await once(http, 'listening');
|
|
18
|
+
t.after(() => { http.closeAllConnections(); http.close(); });
|
|
19
|
+
return `http://127.0.0.1:${http.address().port}/v1/systemone`;
|
|
20
|
+
}
|
|
21
|
+
const live = (endpoint, extra = {}) => liveProvider({ apiKey: 'test-only-secret', endpoint, allowLoopbackForTests: true, timeoutMs: 2000, ...extra });
|
|
22
|
+
|
|
23
|
+
test('varied synthetic fixtures are strict, immutable and never promotion eligible', async () => {
|
|
24
|
+
const before = JSON.stringify(rows);
|
|
25
|
+
assert.equal(rows.length, 11);
|
|
26
|
+
const result = report(rows, rows.map(rules), { provider: 'rules' });
|
|
27
|
+
assert.equal(result.promotion_eligible, false);
|
|
28
|
+
assert.equal(result.provenance.annotation.agent_proposed, rows.length);
|
|
29
|
+
assert.equal(result.metrics.relevance.zero_relevance_queries_excluded, 1);
|
|
30
|
+
assert.equal(JSON.stringify(rows), before);
|
|
31
|
+
assert.equal(JSON.stringify(result).includes(rows[0].state.message), false);
|
|
32
|
+
assert.equal((await main(['validate', '--dataset', fixture.pathname.replace(/^\/([A-Z]:)/i, '$1')])).valid, true);
|
|
33
|
+
});
|
|
34
|
+
test('schema rejects unknown fields, invalid labels, duplicates and dishonest review metadata', () => {
|
|
35
|
+
for (const mutate of [r => r.extra = true, r => r.labels.correction = 1, r => r.provenance.annotation = 'human_verified', r => r.state.message = '', r => r.event_seq = -1]) {
|
|
36
|
+
const r = row(); mutate(r); assert.throws(() => validateDataset([r]));
|
|
37
|
+
}
|
|
38
|
+
const valid = row(); valid.provenance = { source: 'real', annotation: 'human_verified', reviewer: 'reviewer-a', reviewed_at: '2026-09-20T00:00:00Z' };
|
|
39
|
+
assert.doesNotThrow(() => validateDataset([valid]));
|
|
40
|
+
assert.throws(() => validateDataset([row(), row()]));
|
|
41
|
+
});
|
|
42
|
+
test('group, session and exact-content split leakage rejected', () => {
|
|
43
|
+
for (const kind of ['group', 'session', 'content']) {
|
|
44
|
+
const a = row(), b = row(); b.id = 'other'; b.event_id = 'other'; b.split = 'held_out';
|
|
45
|
+
if (kind !== 'session') b.session_id = 'other';
|
|
46
|
+
if (kind !== 'group') b.group_id = 'other';
|
|
47
|
+
if (kind !== 'content') b.state.message = 'Different message';
|
|
48
|
+
assert.throws(() => validateDataset([a, b]), /leakage/);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
test('model input and hash exclude ground truth and provenance', () => {
|
|
52
|
+
const r = clone(rows.find(r => r.purpose === 'relevance')), hash = stateHash(r);
|
|
53
|
+
r.candidates[0].grade = 0; r.provenance.reviewer = 'changed'; r.split = 'held_out';
|
|
54
|
+
assert.equal(stateHash(r), hash);
|
|
55
|
+
const input = JSON.stringify(inputState(r));
|
|
56
|
+
for (const forbidden of ['grade', 'provenance', 'reviewer', 'split', 'labels']) assert.equal(input.includes(`"${forbidden}"`), false);
|
|
57
|
+
r.state.message += ' revised'; assert.notEqual(stateHash(r), hash);
|
|
58
|
+
});
|
|
59
|
+
test('replay rejects wrong project/session/task, stale revision/hash, unknown IDs and aliases', () => {
|
|
60
|
+
const r = row(), p = prediction(r, 'ok', 0.8);
|
|
61
|
+
for (const field of ['project_id', 'session_id', 'task_id', 'event_id', 'task_revision', 'state_hash', 'model', 'question_set_version']) {
|
|
62
|
+
const bad = clone(p); bad[field] = 'wrong'; assert.throws(() => replayProvider([r], [bad]));
|
|
63
|
+
}
|
|
64
|
+
assert.throws(() => replayProvider([r], []));
|
|
65
|
+
assert.throws(() => replayProvider([r], [p, p]));
|
|
66
|
+
assert.equal(replayProvider([r], [p])(r), p);
|
|
67
|
+
});
|
|
68
|
+
test('correction metrics include failed positives, preserve unanswered Brier denominator', () => {
|
|
69
|
+
const data = [true, true, false, false].map((label, i) => ({ ...row(), id: `m${i}`, labels: { correction: label } }));
|
|
70
|
+
const preds = [prediction(data[0], 'ok', 0.8), prediction(data[1], 'timeout'), prediction(data[2], 'ok', 0.6), prediction(data[3], 'ok', 0.1)];
|
|
71
|
+
const result = report(data, preds, { provider: 'replay' }), m = result.metrics.correction;
|
|
72
|
+
assert.deepEqual(m.confusion, { tp: 1, fp: 1, tn: 1, fn: 0 });
|
|
73
|
+
assert.equal(m.coverage, 0.75); assert.equal(m.recall_including_abstentions, 0.5); assert.equal(m.recall_answered_only, 1);
|
|
74
|
+
assert.equal(m.precision, 0.5); assert.equal(m.accuracy_including_abstentions, 0.5);
|
|
75
|
+
assert.ok(Math.abs(m.brier_answered_only - 0.41 / 3) < 1e-12); assert.equal(m.brier_count, 3);
|
|
76
|
+
const empty = report([data[1]], [prediction(data[1], 'abstain')], { provider: 'replay' }).metrics.correction;
|
|
77
|
+
assert.equal(empty.precision, null); assert.equal(empty.brier_answered_only, null); assert.equal(empty.recall_including_abstentions, 0);
|
|
78
|
+
});
|
|
79
|
+
test('ranking uses full ideal, tracks partial scores and handles zero relevance', () => {
|
|
80
|
+
const r = clone(rows.find(r => r.purpose === 'relevance'));
|
|
81
|
+
const partial = prediction(r, 'ok', { [r.candidates[1].id]: 3 });
|
|
82
|
+
const m = report([r], [partial], { provider: 'replay', k: 1 }).metrics.relevance;
|
|
83
|
+
assert.equal(m.ndcg_at_k, 1 / 7); assert.equal(m.recall_at_k, 0.5); assert.equal(m.query_coverage, 0); assert.equal(m.candidate_coverage, 0.25); assert.equal(m.ndcg_complete_queries_only, null);
|
|
84
|
+
const failed = report([r], [prediction(r, 'timeout')], { provider: 'replay' }).metrics.relevance;
|
|
85
|
+
assert.equal(failed.ndcg_at_k, 0); assert.equal(failed.recall_at_k, 0);
|
|
86
|
+
const zero = rows.at(-1), z = report([zero], [rules(zero)], { provider: 'rules' }).metrics.relevance;
|
|
87
|
+
assert.equal(z.ndcg_at_k, null); assert.equal(z.zero_relevance_queries_excluded, 1);
|
|
88
|
+
partial.scores[0].id = 'wrong'; assert.throws(() => validatePrediction(r, partial));
|
|
89
|
+
});
|
|
90
|
+
test('missing/blank key and unsafe URL rejected before any network', () => {
|
|
91
|
+
let calls = 0; const fetchImpl = () => { calls++; throw new Error('unexpected'); };
|
|
92
|
+
for (const apiKey of ['', ' ', '\r\n']) assert.throws(() => liveProvider({ apiKey, fetchImpl }), /api_key/);
|
|
93
|
+
for (const endpoint of ['http://evil.example', 'https://api.typesafe.ai.evil.example/v1/systemone', 'https://api.typesafe.ai/v1/systemone?key=x', 'http://localhost:1234']) assert.throws(() => liveProvider({ apiKey: 'fake', endpoint, fetchImpl }), /unsafe_endpoint/);
|
|
94
|
+
assert.equal(calls, 0);
|
|
95
|
+
const child = spawnSync(process.execPath, ['dev/jev-eval/cli.mjs', 'evaluate', '--dataset', 'dev/jev-eval/fixtures/synthetic.jsonl', '--provider', 'live'], { env: { ...process.env, TYPESAFE_API_KEY: '' }, encoding: 'utf8' });
|
|
96
|
+
assert.equal(child.status, 1); assert.deepEqual(JSON.parse(child.stderr), { error: 'missing_or_invalid_api_key' });
|
|
97
|
+
});
|
|
98
|
+
test('successful HTTP batches by row and tracks usage without gold leakage', async t => {
|
|
99
|
+
const endpoint = await server(t, async (req, res) => {
|
|
100
|
+
const parts = []; for await (const chunk of req) parts.push(chunk);
|
|
101
|
+
const request = JSON.parse(Buffer.concat(parts));
|
|
102
|
+
assert.equal(request.model, MODEL); assert.equal(request.state.labels, undefined); assert.equal(req.headers.authorization, 'Bearer test-only-secret');
|
|
103
|
+
res.setHeader('Content-Type', 'application/json'); res.end(JSON.stringify(correctionResponse()));
|
|
104
|
+
});
|
|
105
|
+
const p = await live(endpoint)(row()); assert.equal(p.status, 'ok'); assert.equal(p.correction_probability, 0.9); assert.equal(p.usage.input_tokens, 30); validatePrediction(row(), p);
|
|
106
|
+
});
|
|
107
|
+
test('HTTP error statuses abstain without leaking raw provider errors', async t => {
|
|
108
|
+
for (const status of [401, 422, 429, 529]) {
|
|
109
|
+
const endpoint = await server(t, (req, res) => { res.writeHead(status); res.end('secret-body test-only-secret'); });
|
|
110
|
+
const p = await live(endpoint)(row()); assert.equal(p.status, 'unavailable'); assert.equal(p.http_status, status); assert.equal(p.correction_probability, null); assert.equal(JSON.stringify(p).includes('secret'), false);
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
test('redirect rejected without contacting target', async t => {
|
|
114
|
+
let targetCalls = 0;
|
|
115
|
+
const target = await server(t, (req, res) => { targetCalls++; res.end('{}'); });
|
|
116
|
+
const endpoint = await server(t, (req, res) => { res.writeHead(302, { Location: target }); res.end(); });
|
|
117
|
+
const p = await live(endpoint)(row()); assert.equal(p.status, 'unavailable'); assert.equal(targetCalls, 0);
|
|
118
|
+
});
|
|
119
|
+
test('timeout remains active across response body and also covers stalled transport', async t => {
|
|
120
|
+
const endpoint = await server(t, (req, res) => { res.writeHead(200, { 'Content-Type': 'application/json' }); res.flushHeaders(); res.write('{'); });
|
|
121
|
+
const start = Date.now(), p = await live(endpoint, { timeoutMs: 80 })(row());
|
|
122
|
+
assert.equal(p.status, 'timeout'); assert.ok(Date.now() - start < 3000);
|
|
123
|
+
const stalled = await liveProvider({ apiKey: 'fake', timeoutMs: 20, fetchImpl: () => new Promise(() => {}) })(row());
|
|
124
|
+
assert.equal(stalled.status, 'timeout');
|
|
125
|
+
});
|
|
126
|
+
test('invalid JSON, oversized response and malformed answers fail closed', async t => {
|
|
127
|
+
const invalids = ['{', 'x'.repeat(65537), JSON.stringify(correctionResponse(1.1)), JSON.stringify({ ...correctionResponse(), answers: { wrong: { type: 'noul', noul: 0.9 } } }), JSON.stringify({ ...correctionResponse(), usage: null })];
|
|
128
|
+
for (const body of invalids) {
|
|
129
|
+
const endpoint = await server(t, (req, res) => res.end(body));
|
|
130
|
+
const p = await live(endpoint)(row()); assert.equal(p.status, 'invalid'); assert.equal(p.correction_probability, null);
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
test('score answers enforce distributions, legends, bounds, confidence and exact IDs', () => {
|
|
134
|
+
const r = rows.find(r => r.purpose === 'relevance'), request = buildRequest(r);
|
|
135
|
+
const answer = { type: 'score', score: 2, legend: Object.fromEntries(RUBRIC.map((v, i) => [i, v])), probabilities: { 0: 0, 1: 0, 2: 1, 3: 0 }, confidence: 1 };
|
|
136
|
+
const body = { model: MODEL, answers: Object.fromEntries(Object.keys(request.questions).map(k => [k, clone(answer)])), usage: { input_tokens: 100, output_tokens: 8 } };
|
|
137
|
+
assert.equal(Object.keys(parseAnswers(r, body, request)).length, r.candidates.length);
|
|
138
|
+
for (const mutate of [a => a.score = NaN, a => a.probabilities[2] = 0.3, a => a.legend[0] = 'wrong', a => a.confidence = 2, a => a.probabilities[4] = 0, a => a.type = 'noul']) {
|
|
139
|
+
const bad = clone(body); mutate(bad.answers.candidate_0); assert.throws(() => parseAnswers(r, bad, request));
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
test('CLI defaults offline, rejects ambiguous options, and preflight prints no key', async () => {
|
|
143
|
+
assert.equal((await main(['preflight'])).network_attempted, false);
|
|
144
|
+
assert.equal((await main(['template'])).schema_version, 1);
|
|
145
|
+
for (const args of [['evaluate', '--endpoint', 'http://evil'], ['evaluate', '--dataset', 'a', '--dataset', 'b'], ['preflight', '--provider', 'live']]) await assert.rejects(main(args));
|
|
146
|
+
});
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import test from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { readFile } from 'node:fs/promises';
|
|
4
|
+
import { createHash } from 'node:crypto';
|
|
5
|
+
import { resolve } from 'node:path';
|
|
6
|
+
import { readJsonl } from '../schema.mjs';
|
|
7
|
+
import { runBaseline, strictAnswers, safeInvocation, nativeTransport, main } from '../muninn-baseline.mjs';
|
|
8
|
+
|
|
9
|
+
const source = await readFile(new URL('../../../.formation/tools/muninn.js', import.meta.url), 'utf8');
|
|
10
|
+
const rows = await readJsonl(new URL('../fixtures/synthetic.jsonl', import.meta.url));
|
|
11
|
+
const corrections = rows.filter(r => r.purpose === 'correction');
|
|
12
|
+
const answers = () => corrections.map((r, idx) => ({ idx, translated: `Synthetic translation ${idx}`, labels: r.labels.correction ? ['correction'] : [] }));
|
|
13
|
+
const response = items => ({ status: 0, stdout: JSON.stringify({ result: JSON.stringify(items), modelUsage: { 'claude-haiku-test': { inputTokens: 20 } } }) });
|
|
14
|
+
|
|
15
|
+
test('offline default captures actual source prompt/parser without model quality claim', async () => {
|
|
16
|
+
const result = await main([]);
|
|
17
|
+
assert.equal(result.live, false); assert.equal(result.promotion_eligible, false); assert.equal(result.status, 'ok');
|
|
18
|
+
assert.equal(result.batch_count, 8); assert.equal(result.translation_present, 8); assert.equal(result.correction_confusion, null);
|
|
19
|
+
assert.equal(result.source_sha256, createHash('sha256').update(source).digest('hex'));
|
|
20
|
+
assert.equal(result.source_requested_permission_bypass, true); assert.equal(result.actual_permission_bypass, false);
|
|
21
|
+
});
|
|
22
|
+
test('isolated source passes exact indexed messages, single transport and stable confusion', () => {
|
|
23
|
+
let calls = 0; const before = JSON.stringify(rows);
|
|
24
|
+
const result = runBaseline(rows, { source, live: true, transport: input => {
|
|
25
|
+
calls++; assert.ok(input.startsWith('For each numbered message, output a JSON array'));
|
|
26
|
+
assert.ok(input.includes('length_too_short')); assert.ok(!input.includes('Development startup also fails'));
|
|
27
|
+
corrections.forEach((r, idx) => assert.ok(input.includes(`[${idx}] ${r.state.message.replace(/\r?\n/g, ' ')}`)));
|
|
28
|
+
return response(answers());
|
|
29
|
+
} });
|
|
30
|
+
assert.equal(calls, 1); assert.equal(result.status, 'ok'); assert.equal(JSON.stringify(rows), before);
|
|
31
|
+
assert.deepEqual(result.correction_confusion, { tp: 4, fp: 0, tn: 4, fn: 0, precision: 1, recall: 1 });
|
|
32
|
+
assert.deepEqual(result.observed_model_metadata, ['claude-haiku-test']);
|
|
33
|
+
assert.equal(JSON.stringify(result).includes(corrections[0].state.message), false);
|
|
34
|
+
});
|
|
35
|
+
test('strict raw checking rejects identities and labels before permissive source filters them', () => {
|
|
36
|
+
const changes = [a => a.pop(), a => a[1].idx = a[0].idx, a => a.reverse(), a => a[0].idx = 0.5, a => a[0].translated = ' ', a => a[0].labels = ['invented'], a => a[0].labels = ['correction', 'correction'], a => a[0].extra = true];
|
|
37
|
+
for (const change of changes) {
|
|
38
|
+
const items = answers(); change(items); assert.throws(() => strictAnswers(JSON.stringify(items), corrections.length));
|
|
39
|
+
const result = runBaseline(rows, { source, live: true, transport: () => response(items) });
|
|
40
|
+
assert.notEqual(result.status, 'ok'); assert.equal(result.correction_confusion, null); assert.equal(result.translation_present, 0);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
test('failures timeouts malformed envelopes and oversize output remain sanitized failures', () => {
|
|
44
|
+
for (const transport of [() => ({ status: 1, stdout: 'private-error' }), () => ({ status: null, error: { code: 'ETIMEDOUT' } }), () => ({ status: 0, stdout: '{' }), () => ({ status: 0, stdout: 'x'.repeat(1048577) }), () => { throw 'private-error'; }, () => ({ status: 0, stdout: JSON.stringify({ is_error: true, result: 'private-error' }) })]) {
|
|
45
|
+
const result = runBaseline(rows, { source, live: true, transport });
|
|
46
|
+
assert.notEqual(result.status, 'ok'); assert.equal(result.correction_confusion, null); assert.equal(JSON.stringify(result).includes('private-error'), false);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
test('real data rejected before transport including irrelevant purpose rows', () => {
|
|
50
|
+
let calls = 0; const real = structuredClone(rows); real.at(-1).provenance.source = 'real';
|
|
51
|
+
assert.throws(() => runBaseline(real, { source, live: true, transport: () => { calls++; } }), /synthetic_only/); assert.equal(calls, 0);
|
|
52
|
+
});
|
|
53
|
+
test('VM denies filesystem/network and unrelated module calls; empty environment', () => {
|
|
54
|
+
for (const expression of ["require('fs').readFileSync('x')", "require('http').request('x')", "require('os').homedir()", "require('net')", "require('./log-reader').findTaskLog()"])
|
|
55
|
+
assert.throws(() => runBaseline(rows, { source: source + '\n' + expression }), /blocked_vm/);
|
|
56
|
+
const checked = source + '\nif (Object.keys(process.env).length || require.main === module) throw new Error("unexpected_environment");';
|
|
57
|
+
assert.equal(runBaseline(rows, { source: checked }).status, 'ok');
|
|
58
|
+
});
|
|
59
|
+
test('safe subprocess uses explicit executable argv no shell and bounded output/time', () => {
|
|
60
|
+
const exe = resolve('test-claude.exe'), invocation = safeInvocation(exe);
|
|
61
|
+
for (const flag of ['--safe-mode', '--tools', '--disable-slash-commands', '--no-session-persistence']) assert.ok(invocation.args.includes(flag));
|
|
62
|
+
assert.equal(invocation.args[invocation.args.indexOf('--tools') + 1], '');
|
|
63
|
+
assert.equal(invocation.args.includes('--dangerously-skip-permissions'), false);
|
|
64
|
+
let calls = 0;
|
|
65
|
+
nativeTransport(exe, '/isolated', (command, args, options) => {
|
|
66
|
+
calls++; assert.equal(command, exe); assert.deepEqual(args, invocation.args); assert.equal(options.shell, false);
|
|
67
|
+
assert.equal(options.timeout, 30000); assert.equal(options.maxBuffer, 1048576); assert.equal(options.windowsHide, true);
|
|
68
|
+
assert.equal(Object.hasOwn(options.env, 'TYPESAFE_API_KEY'), false); return { status: 0, stdout: '{}' };
|
|
69
|
+
})('synthetic prompt'); assert.equal(calls, 1);
|
|
70
|
+
for (const bad of ['claude', resolve('claude.cmd'), resolve('claude.bat')]) assert.throws(() => safeInvocation(bad), /invalid_claude_cli/);
|
|
71
|
+
});
|