@kal-elsam/kairo-runtime 0.1.0
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/README.md +937 -0
- package/bin/harness.js +11 -0
- package/bin/kairo-runtime.js +11 -0
- package/bin/kairo.js +11 -0
- package/global-template/components/catalog.json +25 -0
- package/global-template/components/orchestrator/orchestrator.md +55 -0
- package/global-template/components/sdd-core/handoff.md +38 -0
- package/global-template/components/sdd-core/spec-sizing.md +38 -0
- package/global-template/components/sdd-core/workflow.md +31 -0
- package/global-template/core/orchestrator.md +55 -0
- package/package.json +64 -0
- package/prompts/HARNESS_ENFORCEMENT_UPGRADE.md +11 -0
- package/prompts/HARNESS_ENTERPRISE.md +33 -0
- package/prompts/HARNESS_INSTALLER_MASTER.md +853 -0
- package/prompts/HARNESS_MINIMAL.md +30 -0
- package/prompts/HARNESS_SPEC_SIZING_UPGRADE.md +41 -0
- package/prompts/HARNESS_STANDARD.md +35 -0
- package/prompts/HARNESS_UNIVERSAL_PARITY.md +56 -0
- package/repo-template/.claude/agents/adapter-parity-reviewer.md +17 -0
- package/repo-template/.claude/agents/architect.md +17 -0
- package/repo-template/.claude/agents/eval-engineer.md +17 -0
- package/repo-template/.claude/agents/reviewer.md +17 -0
- package/repo-template/.claude/agents/sdd-reviewer.md +17 -0
- package/repo-template/.claude/agents/sdd-spec-writer.md +17 -0
- package/repo-template/.claude/skills/checkpoint/SKILL.md +13 -0
- package/repo-template/.claude/skills/eval-design/SKILL.md +3 -0
- package/repo-template/.claude/skills/evals/SKILL.md +13 -0
- package/repo-template/.claude/skills/loop-engineering/SKILL.md +16 -0
- package/repo-template/.claude/skills/maintainability-review/SKILL.md +3 -0
- package/repo-template/.claude/skills/quality-gate-review/SKILL.md +3 -0
- package/repo-template/.claude/skills/sdd/SKILL.md +13 -0
- package/repo-template/.claude/skills/spec-complexity-classifier/SKILL.md +10 -0
- package/repo-template/.claude/skills/spec-escalation-review/SKILL.md +10 -0
- package/repo-template/.claude/skills/spec-intake/SKILL.md +10 -0
- package/repo-template/.claude/skills/tdd/SKILL.md +13 -0
- package/repo-template/.claude/skills/trust-review/SKILL.md +3 -0
- package/repo-template/.codex/skills/adapter-parity/SKILL.md +29 -0
- package/repo-template/.codex/skills/checkpoint/SKILL.md +36 -0
- package/repo-template/.codex/skills/eval-design/SKILL.md +3 -0
- package/repo-template/.codex/skills/evals/SKILL.md +28 -0
- package/repo-template/.codex/skills/loop-engineering/SKILL.md +24 -0
- package/repo-template/.codex/skills/maintainability-review/SKILL.md +3 -0
- package/repo-template/.codex/skills/quality-gate-review/SKILL.md +3 -0
- package/repo-template/.codex/skills/sdd/SKILL.md +30 -0
- package/repo-template/.codex/skills/spec-complexity-classifier/SKILL.md +10 -0
- package/repo-template/.codex/skills/spec-escalation-review/SKILL.md +10 -0
- package/repo-template/.codex/skills/spec-intake/SKILL.md +10 -0
- package/repo-template/.codex/skills/tdd/SKILL.md +27 -0
- package/repo-template/.codex/skills/trust-review/SKILL.md +3 -0
- package/repo-template/.cursor/agents/adapter-parity-reviewer.md +29 -0
- package/repo-template/.cursor/agents/architect.md +27 -0
- package/repo-template/.cursor/agents/context-engineer.md +27 -0
- package/repo-template/.cursor/agents/debugger.md +27 -0
- package/repo-template/.cursor/agents/eval-engineer.md +27 -0
- package/repo-template/.cursor/agents/harness-orchestrator.md +27 -0
- package/repo-template/.cursor/agents/loop-controller.md +17 -0
- package/repo-template/.cursor/agents/loop-debugger.md +16 -0
- package/repo-template/.cursor/agents/reviewer.md +27 -0
- package/repo-template/.cursor/agents/sdd/sdd-acceptance-reviewer.md +31 -0
- package/repo-template/.cursor/agents/sdd/sdd-implementation-guardian.md +31 -0
- package/repo-template/.cursor/agents/sdd/sdd-intake-analyst.md +31 -0
- package/repo-template/.cursor/agents/sdd/sdd-orchestrator.md +31 -0
- package/repo-template/.cursor/agents/sdd/sdd-spec-reviewer.md +31 -0
- package/repo-template/.cursor/agents/sdd/sdd-spec-writer.md +31 -0
- package/repo-template/.cursor/agents/sdd/sdd-task-breakdown.md +31 -0
- package/repo-template/.cursor/agents/sdd/sdd-technical-planner.md +31 -0
- package/repo-template/.cursor/agents/sdd/sdd-test-planner.md +31 -0
- package/repo-template/.cursor/agents/spec-intake-analyst.md +14 -0
- package/repo-template/.cursor/agents/test-engineer.md +27 -0
- package/repo-template/.cursor/commands/adapter-parity.md +34 -0
- package/repo-template/.cursor/commands/checkpoint.md +30 -0
- package/repo-template/.cursor/commands/debug.md +13 -0
- package/repo-template/.cursor/commands/init-eval.md +12 -0
- package/repo-template/.cursor/commands/init-feature.md +12 -0
- package/repo-template/.cursor/commands/init-harness.md +13 -0
- package/repo-template/.cursor/commands/loop-debug.md +3 -0
- package/repo-template/.cursor/commands/loop-review.md +3 -0
- package/repo-template/.cursor/commands/loop-run.md +5 -0
- package/repo-template/.cursor/commands/review.md +21 -0
- package/repo-template/.cursor/commands/sdd-intake.md +18 -0
- package/repo-template/.cursor/commands/sdd-plan.md +18 -0
- package/repo-template/.cursor/commands/sdd-spec.md +18 -0
- package/repo-template/.cursor/commands/sdd-tasks.md +18 -0
- package/repo-template/.cursor/commands/sdd-validate.md +18 -0
- package/repo-template/.cursor/commands/spec-escalate.md +9 -0
- package/repo-template/.cursor/commands/spec-intake.md +10 -0
- package/repo-template/.cursor/commands/spec-size.md +21 -0
- package/repo-template/.cursor/rules/adapter-parity.mdc +20 -0
- package/repo-template/.cursor/rules/api.mdc +12 -0
- package/repo-template/.cursor/rules/core.mdc +21 -0
- package/repo-template/.cursor/rules/enforcement.mdc +16 -0
- package/repo-template/.cursor/rules/evals.mdc +10 -0
- package/repo-template/.cursor/rules/git.mdc +19 -0
- package/repo-template/.cursor/rules/harness.mdc +14 -0
- package/repo-template/.cursor/rules/loops.mdc +17 -0
- package/repo-template/.cursor/rules/testing.mdc +13 -0
- package/repo-template/.cursor/rules/ui.mdc +13 -0
- package/repo-template/.cursor/skills/api-design/SKILL.md +23 -0
- package/repo-template/.cursor/skills/architecture/SKILL.md +23 -0
- package/repo-template/.cursor/skills/code-review/SKILL.md +23 -0
- package/repo-template/.cursor/skills/context-graph/SKILL.md +23 -0
- package/repo-template/.cursor/skills/debugging/SKILL.md +23 -0
- package/repo-template/.cursor/skills/evals/SKILL.md +23 -0
- package/repo-template/.cursor/skills/git-workflow/SKILL.md +23 -0
- package/repo-template/.cursor/skills/testing/SKILL.md +23 -0
- package/repo-template/.cursor/skills/ui-design/SKILL.md +23 -0
- package/repo-template/.gentle-ai/README.md +37 -0
- package/repo-template/.gentle-ai/loops/README.md +27 -0
- package/repo-template/.gentle-ai/loops/sdd-tdd-repair.loop.md +27 -0
- package/repo-template/.gentle-ai/model-routing.md +25 -0
- package/repo-template/.github/copilot-instructions.md +37 -0
- package/repo-template/.github/dependabot.yml +11 -0
- package/repo-template/.github/instructions/harness.instructions.md +11 -0
- package/repo-template/.github/workflows/harness-quality-gate.yml +67 -0
- package/repo-template/.github/workflows/harness-security-gate.yml +32 -0
- package/repo-template/.harness/spec-sizing.json +33 -0
- package/repo-template/.opencode/README.md +71 -0
- package/repo-template/.opencode/agents/adapter-parity-reviewer.md +23 -0
- package/repo-template/.opencode/agents/architect.md +38 -0
- package/repo-template/.opencode/agents/checkpoint-reviewer.md +38 -0
- package/repo-template/.opencode/agents/eval-engineer.md +38 -0
- package/repo-template/.opencode/agents/loop-controller.md +38 -0
- package/repo-template/.opencode/agents/loop-debugger.md +38 -0
- package/repo-template/.opencode/agents/model-router.md +38 -0
- package/repo-template/.opencode/agents/sdd-orchestrator.md +38 -0
- package/repo-template/.opencode/agents/sdd-spec-reviewer.md +38 -0
- package/repo-template/.opencode/agents/spec-intake-analyst.md +19 -0
- package/repo-template/.opencode/agents/tdd-engineer.md +38 -0
- package/repo-template/.opencode/commands/checkpoint.md +3 -0
- package/repo-template/.opencode/commands/eval-design.md +3 -0
- package/repo-template/.opencode/commands/maintainability-review.md +3 -0
- package/repo-template/.opencode/commands/quality-gate.md +3 -0
- package/repo-template/.opencode/commands/spec-escalate.md +9 -0
- package/repo-template/.opencode/commands/spec-intake.md +10 -0
- package/repo-template/.opencode/commands/spec-size.md +21 -0
- package/repo-template/.opencode/commands/trust-review.md +3 -0
- package/repo-template/.opencode/loops/ai-behavior-improvement.loop.md +15 -0
- package/repo-template/.opencode/loops/bug-repair.loop.md +16 -0
- package/repo-template/.opencode/loops/documentation-sync.loop.md +13 -0
- package/repo-template/.opencode/loops/feature-development.loop.md +25 -0
- package/repo-template/.opencode/skills/spec-complexity-classifier/SKILL.md +10 -0
- package/repo-template/.opencode/skills/spec-escalation-review/SKILL.md +10 -0
- package/repo-template/.opencode/skills/spec-intake/SKILL.md +10 -0
- package/repo-template/.pi/README.md +21 -0
- package/repo-template/.pi/prompts/checkpoint.md +11 -0
- package/repo-template/.pi/prompts/loop-run.md +10 -0
- package/repo-template/.pi/prompts/sdd-plan.md +11 -0
- package/repo-template/.pi/prompts/sdd-spec.md +13 -0
- package/repo-template/.pi/prompts/spec-escalate.md +9 -0
- package/repo-template/.pi/prompts/spec-intake.md +10 -0
- package/repo-template/.pi/prompts/spec-size.md +21 -0
- package/repo-template/.pi/skills/adapter-parity/SKILL.md +7 -0
- package/repo-template/.pi/skills/checkpoint/SKILL.md +7 -0
- package/repo-template/.pi/skills/eval-design/SKILL.md +3 -0
- package/repo-template/.pi/skills/evals/SKILL.md +7 -0
- package/repo-template/.pi/skills/loop-engineering/SKILL.md +7 -0
- package/repo-template/.pi/skills/maintainability-review/SKILL.md +3 -0
- package/repo-template/.pi/skills/quality-gate-review/SKILL.md +3 -0
- package/repo-template/.pi/skills/sdd/SKILL.md +7 -0
- package/repo-template/.pi/skills/spec-complexity-classifier/SKILL.md +10 -0
- package/repo-template/.pi/skills/spec-escalation-review/SKILL.md +10 -0
- package/repo-template/.pi/skills/spec-intake/SKILL.md +10 -0
- package/repo-template/.pi/skills/tdd/SKILL.md +7 -0
- package/repo-template/.pi/skills/trust-review/SKILL.md +3 -0
- package/repo-template/AGENT.md +8 -0
- package/repo-template/AGENTS.md +165 -0
- package/repo-template/CLAUDE.md +9 -0
- package/repo-template/GEMINI.md +9 -0
- package/repo-template/docs/ai/adapter-parity.md +135 -0
- package/repo-template/docs/ai/agent-workflow.md +45 -0
- package/repo-template/docs/ai/api.md +28 -0
- package/repo-template/docs/ai/architecture.md +53 -0
- package/repo-template/docs/ai/context-budget.md +54 -0
- package/repo-template/docs/ai/context-graph.md +39 -0
- package/repo-template/docs/ai/conventions.md +34 -0
- package/repo-template/docs/ai/decision-log.md +5 -0
- package/repo-template/docs/ai/enforcement.md +63 -0
- package/repo-template/docs/ai/eval-strategy.md +42 -0
- package/repo-template/docs/ai/evals.md +44 -0
- package/repo-template/docs/ai/git-workflow.md +35 -0
- package/repo-template/docs/ai/governance.md +61 -0
- package/repo-template/docs/ai/harness.md +49 -0
- package/repo-template/docs/ai/installer-cli.md +34 -0
- package/repo-template/docs/ai/loop-log.md +5 -0
- package/repo-template/docs/ai/loop-observability.md +57 -0
- package/repo-template/docs/ai/loop-policy.md +86 -0
- package/repo-template/docs/ai/loops.md +95 -0
- package/repo-template/docs/ai/maintainability-gates.md +26 -0
- package/repo-template/docs/ai/memory.md +71 -0
- package/repo-template/docs/ai/model-policy.md +105 -0
- package/repo-template/docs/ai/observability-runtime.md +48 -0
- package/repo-template/docs/ai/provider-routing.md +138 -0
- package/repo-template/docs/ai/quality-gates.md +48 -0
- package/repo-template/docs/ai/rollback-runtime.md +25 -0
- package/repo-template/docs/ai/security.md +12 -0
- package/repo-template/docs/ai/spec-driven-development.md +124 -0
- package/repo-template/docs/ai/spec-escalation.md +44 -0
- package/repo-template/docs/ai/spec-intake.md +46 -0
- package/repo-template/docs/ai/spec-sizing.md +207 -0
- package/repo-template/docs/ai/test-driven-development.md +35 -0
- package/repo-template/docs/ai/testing.md +28 -0
- package/repo-template/docs/ai/tool-adapters.md +186 -0
- package/repo-template/docs/ai/trust-allowlist.md +5 -0
- package/repo-template/docs/ai/trust-policy.md +41 -0
- package/repo-template/docs/ai/ui.md +17 -0
- package/repo-template/docs/skills/adapter-parity-review.md +46 -0
- package/repo-template/docs/skills/api-design.md +37 -0
- package/repo-template/docs/skills/architecture.md +37 -0
- package/repo-template/docs/skills/code-review.md +37 -0
- package/repo-template/docs/skills/context-graph.md +38 -0
- package/repo-template/docs/skills/debugging.md +37 -0
- package/repo-template/docs/skills/eval-design.md +12 -0
- package/repo-template/docs/skills/evals.md +37 -0
- package/repo-template/docs/skills/git-workflow.md +37 -0
- package/repo-template/docs/skills/look-trust-review.md +12 -0
- package/repo-template/docs/skills/loop-debugging.md +16 -0
- package/repo-template/docs/skills/loop-design.md +39 -0
- package/repo-template/docs/skills/loop-retrospective.md +15 -0
- package/repo-template/docs/skills/loop-review.md +16 -0
- package/repo-template/docs/skills/maintainability-review.md +12 -0
- package/repo-template/docs/skills/model-selection.md +36 -0
- package/repo-template/docs/skills/quality-gate-review.md +12 -0
- package/repo-template/docs/skills/spec-complexity-classifier.md +41 -0
- package/repo-template/docs/skills/spec-escalation-review.md +34 -0
- package/repo-template/docs/skills/spec-intake.md +25 -0
- package/repo-template/docs/skills/testing.md +37 -0
- package/repo-template/docs/skills/tool-adapter-sync.md +36 -0
- package/repo-template/docs/skills/ui-design.md +37 -0
- package/repo-template/docs/specs/README.md +9 -0
- package/repo-template/docs/specs/templates/basic-spec.md +41 -0
- package/repo-template/docs/specs/templates/complex-spec.md +145 -0
- package/repo-template/docs/specs/templates/standard-spec.md +58 -0
- package/repo-template/evals/README.md +11 -0
- package/repo-template/evals/golden/sample-golden.json +12 -0
- package/repo-template/evals/loop-regression/README.md +11 -0
- package/repo-template/evals/regression/sample-regression.json +12 -0
- package/repo-template/evals/schema/sample-schema.json +12 -0
- package/repo-template/evals/tool-calls/sample-tool-calls.json +12 -0
- package/repo-template/opencode.json.sample +29 -0
- package/repo-template/scripts/harness/backup.mjs +7 -0
- package/repo-template/scripts/harness/doctor.mjs +20 -0
- package/repo-template/scripts/harness/run-evals.mjs +27 -0
- package/repo-template/setup-agent-links.sh +54 -0
- package/scripts/check-published-release.mjs +127 -0
- package/scripts/check-release-commit.mjs +32 -0
- package/scripts/install.sh +225 -0
- package/scripts/installer-smoke-test.sh +155 -0
- package/scripts/lib/attribution-guard.mjs +59 -0
- package/scripts/registry-smoke-test.sh +149 -0
- package/scripts/smoke-test.sh +197 -0
- package/scripts/ux-smoke-test.sh +140 -0
- package/src/cli.js +625 -0
- package/src/doctor.js +68 -0
- package/src/global/adapter-context.js +27 -0
- package/src/global/adapter-matrix.js +38 -0
- package/src/global/adapters/claude.js +8 -0
- package/src/global/adapters/codex.js +8 -0
- package/src/global/adapters/cursor.js +8 -0
- package/src/global/adapters/opencode.js +8 -0
- package/src/global/agents.js +7 -0
- package/src/global/apply-confirmation.js +62 -0
- package/src/global/backups.js +54 -0
- package/src/global/brand/cli.js +52 -0
- package/src/global/brand/index.js +85 -0
- package/src/global/clack/setup-preview.js +48 -0
- package/src/global/clack/setup-wizard-constants.js +6 -0
- package/src/global/clack/setup-wizard.js +207 -0
- package/src/global/clack/theme.js +145 -0
- package/src/global/component-authoring.js +121 -0
- package/src/global/component-builders.js +43 -0
- package/src/global/component-distribution.js +270 -0
- package/src/global/component-installer.js +106 -0
- package/src/global/component-paths.js +22 -0
- package/src/global/component-registry.js +89 -0
- package/src/global/components/orchestrator.js +14 -0
- package/src/global/components/sdd-core.js +17 -0
- package/src/global/diff.js +233 -0
- package/src/global/drift.js +264 -0
- package/src/global/explain.js +144 -0
- package/src/global/global-cli.js +1145 -0
- package/src/global/global-doctor.js +67 -0
- package/src/global/global-installer.js +284 -0
- package/src/global/history.js +313 -0
- package/src/global/ink/run-setup-ink.js +77 -0
- package/src/global/ink/setup-app.js +278 -0
- package/src/global/ink/setup-routing.js +51 -0
- package/src/global/ink/setup-state.js +180 -0
- package/src/global/ink/terminal.js +13 -0
- package/src/global/json-output.js +22 -0
- package/src/global/load-component-catalog.js +41 -0
- package/src/global/load-workspace-component-catalog.js +123 -0
- package/src/global/managed-body.js +28 -0
- package/src/global/managed-config-adapter.js +134 -0
- package/src/global/managed-section.js +73 -0
- package/src/global/npm-registry.js +25 -0
- package/src/global/paths.js +22 -0
- package/src/global/policy.js +344 -0
- package/src/global/preflight.js +65 -0
- package/src/global/registry.js +79 -0
- package/src/global/report.js +110 -0
- package/src/global/rollback.js +126 -0
- package/src/global/setup.js +284 -0
- package/src/global/state-migration.js +65 -0
- package/src/global/state.js +50 -0
- package/src/global/status.js +94 -0
- package/src/global/sync.js +129 -0
- package/src/global/upgrade.js +145 -0
- package/src/harness-files.js +145 -0
- package/src/harness-updater.js +120 -0
- package/src/hash.js +5 -0
- package/src/manifest.js +36 -0
- package/src/project-detection.js +105 -0
- package/src/template-installer.js +72 -0
- package/src/text-template.js +24 -0
- package/src/workspace-cli.js +115 -0
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
5
|
+
WORKDIR="$(mktemp -d)"
|
|
6
|
+
FAKE_HOME="$(mktemp -d)"
|
|
7
|
+
TARBALL=""
|
|
8
|
+
|
|
9
|
+
cleanup() {
|
|
10
|
+
rm -rf "$WORKDIR" "$FAKE_HOME"
|
|
11
|
+
if [ -n "$TARBALL" ] && [ -f "$ROOT/$TARBALL" ]; then
|
|
12
|
+
rm -f "$ROOT/$TARBALL"
|
|
13
|
+
fi
|
|
14
|
+
}
|
|
15
|
+
trap cleanup EXIT
|
|
16
|
+
|
|
17
|
+
assert_file_equals() {
|
|
18
|
+
local file="$1"
|
|
19
|
+
local expected="$2"
|
|
20
|
+
local label="${3:-$file}"
|
|
21
|
+
|
|
22
|
+
if [ "$(cat "$file")" != "$expected" ]; then
|
|
23
|
+
echo "Assertion failed: $label content mismatch" >&2
|
|
24
|
+
exit 1
|
|
25
|
+
fi
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
assert_harness_home_isolated() {
|
|
29
|
+
if [ -z "${HARNESS_HOME:-}" ]; then
|
|
30
|
+
echo "HARNESS_HOME must be set for smoke tests" >&2
|
|
31
|
+
exit 1
|
|
32
|
+
fi
|
|
33
|
+
|
|
34
|
+
if [ "$HARNESS_HOME" = "$HOME" ] || [ "$HARNESS_HOME" = "${HOME}/.harness" ]; then
|
|
35
|
+
echo "Smoke must not use the real home directory" >&2
|
|
36
|
+
exit 1
|
|
37
|
+
fi
|
|
38
|
+
|
|
39
|
+
if [ -d "$HOME/.harness" ] && [ "$HARNESS_HOME" = "$HOME/.harness" ]; then
|
|
40
|
+
echo "Smoke must not touch real ~/.harness" >&2
|
|
41
|
+
exit 1
|
|
42
|
+
fi
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
echo "Packing $(node -p "require('$ROOT/package.json').name") from $ROOT"
|
|
46
|
+
TARBALL="$(cd "$ROOT" && npm pack --silent)"
|
|
47
|
+
|
|
48
|
+
echo "Installing tarball in $WORKDIR"
|
|
49
|
+
cd "$WORKDIR"
|
|
50
|
+
npm init -y >/dev/null
|
|
51
|
+
npm install "$ROOT/$TARBALL" >/dev/null
|
|
52
|
+
|
|
53
|
+
mkdir -p "$FAKE_HOME/.cursor" "$FAKE_HOME/.codex"
|
|
54
|
+
printf '%s\n' "SMOKE_USER_MARKER=before-install" >"$FAKE_HOME/.cursor/AGENTS.md"
|
|
55
|
+
export HARNESS_HOME="$FAKE_HOME"
|
|
56
|
+
assert_harness_home_isolated
|
|
57
|
+
|
|
58
|
+
echo
|
|
59
|
+
echo "== kairo setup --dry-run =="
|
|
60
|
+
npx --no-install kairo setup --dry-run
|
|
61
|
+
|
|
62
|
+
echo
|
|
63
|
+
echo "== kairo status (before install) =="
|
|
64
|
+
if npx --no-install kairo status; then
|
|
65
|
+
echo "Expected status to fail before install" >&2
|
|
66
|
+
exit 1
|
|
67
|
+
fi
|
|
68
|
+
|
|
69
|
+
echo
|
|
70
|
+
echo "== kairo install --dry-run (agent-global) =="
|
|
71
|
+
npx --no-install kairo install --dry-run
|
|
72
|
+
|
|
73
|
+
echo
|
|
74
|
+
echo "== kairo install (agent-global) =="
|
|
75
|
+
npx --no-install kairo install
|
|
76
|
+
|
|
77
|
+
echo
|
|
78
|
+
echo "== kairo status (after install) =="
|
|
79
|
+
npx --no-install kairo status
|
|
80
|
+
|
|
81
|
+
SNAPSHOT="$(ls -A "$FAKE_HOME/.harness/backups" | head -1)"
|
|
82
|
+
BACKUP_FILE="$(ls -A "$FAKE_HOME/.harness/backups/$SNAPSHOT" | head -1)"
|
|
83
|
+
|
|
84
|
+
if [ -z "$SNAPSHOT" ] || [ -z "$BACKUP_FILE" ]; then
|
|
85
|
+
echo "Expected install to create a backup snapshot with files" >&2
|
|
86
|
+
exit 1
|
|
87
|
+
fi
|
|
88
|
+
|
|
89
|
+
EXPECTED_BACKUP_CONTENT="$(cat "$FAKE_HOME/.harness/backups/$SNAPSHOT/$BACKUP_FILE")"
|
|
90
|
+
|
|
91
|
+
echo
|
|
92
|
+
echo "== kairo doctor (agent-global) =="
|
|
93
|
+
npx --no-install kairo doctor
|
|
94
|
+
|
|
95
|
+
echo
|
|
96
|
+
echo "== simulate drift + doctor detects it =="
|
|
97
|
+
rm -f "$FAKE_HOME/.harness/components/sdd-core/workflow.md"
|
|
98
|
+
node -e "
|
|
99
|
+
const fs = require('node:fs');
|
|
100
|
+
const path = require('node:path');
|
|
101
|
+
const config = path.join(process.env.HARNESS_HOME, '.cursor', 'AGENTS.md');
|
|
102
|
+
const content = fs.readFileSync(config, 'utf8');
|
|
103
|
+
fs.writeFileSync(config, content.replace('### SDD Core', '### Broken'));
|
|
104
|
+
"
|
|
105
|
+
if npx --no-install kairo doctor; then
|
|
106
|
+
echo "Expected doctor to fail after drift simulation" >&2
|
|
107
|
+
exit 1
|
|
108
|
+
fi
|
|
109
|
+
|
|
110
|
+
echo
|
|
111
|
+
echo "== kairo sync repairs drift =="
|
|
112
|
+
npx --no-install kairo sync --yes
|
|
113
|
+
|
|
114
|
+
echo
|
|
115
|
+
echo "== kairo status after sync =="
|
|
116
|
+
npx --no-install kairo status
|
|
117
|
+
|
|
118
|
+
echo
|
|
119
|
+
echo "== kairo doctor after repair =="
|
|
120
|
+
npx --no-install kairo doctor
|
|
121
|
+
|
|
122
|
+
echo
|
|
123
|
+
echo "== kairo history after sync =="
|
|
124
|
+
npx --no-install kairo history --json | node -e "
|
|
125
|
+
const fs = require('node:fs');
|
|
126
|
+
let input = '';
|
|
127
|
+
process.stdin.on('data', (chunk) => { input += chunk; });
|
|
128
|
+
process.stdin.on('end', () => {
|
|
129
|
+
const parsed = JSON.parse(input.trim());
|
|
130
|
+
if (!Array.isArray(parsed.events) || parsed.events.length < 1) {
|
|
131
|
+
console.error('Expected history events after managed operations');
|
|
132
|
+
process.exit(1);
|
|
133
|
+
}
|
|
134
|
+
const commands = new Set(parsed.events.map((event) => event.command));
|
|
135
|
+
if (!commands.has('sync')) {
|
|
136
|
+
console.error('Expected sync event in history');
|
|
137
|
+
process.exit(1);
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
"
|
|
141
|
+
|
|
142
|
+
echo
|
|
143
|
+
echo "== kairo backups =="
|
|
144
|
+
npx --no-install kairo backups
|
|
145
|
+
|
|
146
|
+
printf '%s\n' "SMOKE_USER_MARKER=corrupted" >"$FAKE_HOME/.cursor/AGENTS.md"
|
|
147
|
+
BEFORE_PREVIEW="$(cat "$FAKE_HOME/.cursor/AGENTS.md")"
|
|
148
|
+
|
|
149
|
+
echo
|
|
150
|
+
echo "== kairo rollback preview (dry-run) =="
|
|
151
|
+
npx --no-install kairo rollback --to "$SNAPSHOT"
|
|
152
|
+
AFTER_PREVIEW="$(cat "$FAKE_HOME/.cursor/AGENTS.md")"
|
|
153
|
+
|
|
154
|
+
if [ "$BEFORE_PREVIEW" != "$AFTER_PREVIEW" ]; then
|
|
155
|
+
echo "Rollback preview mutated files" >&2
|
|
156
|
+
exit 1
|
|
157
|
+
fi
|
|
158
|
+
|
|
159
|
+
if [ "$AFTER_PREVIEW" = "$EXPECTED_BACKUP_CONTENT" ]; then
|
|
160
|
+
echo "Rollback preview unexpectedly restored content" >&2
|
|
161
|
+
exit 1
|
|
162
|
+
fi
|
|
163
|
+
|
|
164
|
+
SNAPSHOT_COUNT_BEFORE="$(ls -A "$FAKE_HOME/.harness/backups" | wc -l | tr -d ' ')"
|
|
165
|
+
|
|
166
|
+
echo
|
|
167
|
+
echo "== kairo rollback apply =="
|
|
168
|
+
npx --no-install kairo rollback --to "$SNAPSHOT" --apply
|
|
169
|
+
|
|
170
|
+
assert_file_equals "$FAKE_HOME/.cursor/AGENTS.md" "$EXPECTED_BACKUP_CONTENT" "rollback target"
|
|
171
|
+
|
|
172
|
+
SNAPSHOT_COUNT_AFTER="$(ls -A "$FAKE_HOME/.harness/backups" | wc -l | tr -d ' ')"
|
|
173
|
+
if [ "$SNAPSHOT_COUNT_AFTER" -le "$SNAPSHOT_COUNT_BEFORE" ]; then
|
|
174
|
+
echo "Expected rollback apply to create a safety backup snapshot" >&2
|
|
175
|
+
exit 1
|
|
176
|
+
fi
|
|
177
|
+
|
|
178
|
+
echo
|
|
179
|
+
echo "== kairo uninstall (agent-global) =="
|
|
180
|
+
npx --no-install kairo uninstall
|
|
181
|
+
|
|
182
|
+
unset HARNESS_HOME
|
|
183
|
+
|
|
184
|
+
echo
|
|
185
|
+
echo "== kairo install --scope=workspace --mode enterprise =="
|
|
186
|
+
npx --no-install kairo install --scope=workspace --mode enterprise
|
|
187
|
+
|
|
188
|
+
echo
|
|
189
|
+
echo "== kairo doctor --scope=workspace =="
|
|
190
|
+
npx --no-install kairo doctor --scope=workspace
|
|
191
|
+
|
|
192
|
+
echo
|
|
193
|
+
echo "== kairo update --scope=workspace --dry-run =="
|
|
194
|
+
npx --no-install kairo update --scope=workspace --dry-run
|
|
195
|
+
|
|
196
|
+
echo
|
|
197
|
+
echo "Smoke test passed."
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# UX smoke — read-only terminal output checks for clarity and copy consistency.
|
|
3
|
+
set -euo pipefail
|
|
4
|
+
|
|
5
|
+
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
6
|
+
HARNESS_BIN="$ROOT/bin/harness.js"
|
|
7
|
+
FAKE_HOME="$(mktemp -d)"
|
|
8
|
+
CAPTURE_DIR="$(mktemp -d)"
|
|
9
|
+
|
|
10
|
+
cleanup() {
|
|
11
|
+
rm -rf "$FAKE_HOME" "$CAPTURE_DIR"
|
|
12
|
+
}
|
|
13
|
+
trap cleanup EXIT
|
|
14
|
+
|
|
15
|
+
export HARNESS_HOME="$FAKE_HOME"
|
|
16
|
+
|
|
17
|
+
run_capture() {
|
|
18
|
+
local label="$1"
|
|
19
|
+
shift
|
|
20
|
+
local outfile="$CAPTURE_DIR/${label}.txt"
|
|
21
|
+
local errfile="$CAPTURE_DIR/${label}.stderr.txt"
|
|
22
|
+
local status=0
|
|
23
|
+
|
|
24
|
+
set +e
|
|
25
|
+
node "$HARNESS_BIN" "$@" >"$outfile" 2>"$errfile"
|
|
26
|
+
status=$?
|
|
27
|
+
set -e
|
|
28
|
+
|
|
29
|
+
echo "$status" >"$CAPTURE_DIR/${label}.exit"
|
|
30
|
+
echo "== $label =="
|
|
31
|
+
cat "$outfile"
|
|
32
|
+
if [ -s "$errfile" ]; then
|
|
33
|
+
cat "$errfile" >&2
|
|
34
|
+
fi
|
|
35
|
+
return 0
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
assert_contains() {
|
|
39
|
+
local file="$1"
|
|
40
|
+
local needle="$2"
|
|
41
|
+
local label="${3:-$file}"
|
|
42
|
+
|
|
43
|
+
if ! grep -Fq "$needle" "$file"; then
|
|
44
|
+
echo "UX smoke failed: expected '$needle' in $label" >&2
|
|
45
|
+
exit 1
|
|
46
|
+
fi
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
assert_not_contains() {
|
|
50
|
+
local file="$1"
|
|
51
|
+
local needle="$2"
|
|
52
|
+
local label="${3:-$file}"
|
|
53
|
+
|
|
54
|
+
if grep -Fq "$needle" "$file"; then
|
|
55
|
+
echo "UX smoke failed: did not expect '$needle' in $label" >&2
|
|
56
|
+
exit 1
|
|
57
|
+
fi
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
assert_exit() {
|
|
61
|
+
local label="$1"
|
|
62
|
+
local expected="$2"
|
|
63
|
+
local actual
|
|
64
|
+
|
|
65
|
+
actual="$(cat "$CAPTURE_DIR/${label}.exit")"
|
|
66
|
+
if [ "$actual" != "$expected" ]; then
|
|
67
|
+
echo "UX smoke failed: $label exit $actual, expected $expected" >&2
|
|
68
|
+
exit 1
|
|
69
|
+
fi
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
mkdir -p "$FAKE_HOME/.cursor" "$FAKE_HOME/.codex"
|
|
73
|
+
printf '%s\n' "# user content" >"$FAKE_HOME/.cursor/AGENTS.md"
|
|
74
|
+
|
|
75
|
+
echo "Kairo Runtime UX smoke — capturing terminal output to $CAPTURE_DIR"
|
|
76
|
+
echo
|
|
77
|
+
|
|
78
|
+
run_capture help help
|
|
79
|
+
assert_contains "$CAPTURE_DIR/help.txt" "JSON output (--json on supported commands):"
|
|
80
|
+
assert_contains "$CAPTURE_DIR/help.txt" "report"
|
|
81
|
+
assert_contains "$CAPTURE_DIR/help.txt" "More examples: README.md"
|
|
82
|
+
assert_not_contains "$CAPTURE_DIR/help.txt" "Stable fields: ok, overall"
|
|
83
|
+
assert_exit help 0
|
|
84
|
+
|
|
85
|
+
run_capture setup-dry-run setup --dry-run
|
|
86
|
+
assert_contains "$CAPTURE_DIR/setup-dry-run.txt" "Dry run: nothing was written."
|
|
87
|
+
assert_contains "$CAPTURE_DIR/setup-dry-run.txt" "Backups planned:"
|
|
88
|
+
assert_not_contains "$CAPTURE_DIR/setup-dry-run.txt" "Local Agent Operating System"
|
|
89
|
+
assert_exit setup-dry-run 0
|
|
90
|
+
|
|
91
|
+
run_capture status-missing status
|
|
92
|
+
assert_contains "$CAPTURE_DIR/status-missing.txt" "Overall: MISSING"
|
|
93
|
+
assert_exit status-missing 1
|
|
94
|
+
|
|
95
|
+
run_capture setup-yes setup --yes --agents cursor
|
|
96
|
+
assert_exit setup-yes 0
|
|
97
|
+
|
|
98
|
+
run_capture status-ok status
|
|
99
|
+
assert_contains "$CAPTURE_DIR/status-ok.txt" "Overall: OK"
|
|
100
|
+
assert_exit status-ok 0
|
|
101
|
+
|
|
102
|
+
rm -f "$FAKE_HOME/.harness/components/sdd-core/workflow.md"
|
|
103
|
+
|
|
104
|
+
run_capture status-drift status
|
|
105
|
+
assert_contains "$CAPTURE_DIR/status-drift.txt" "Overall: DRIFT"
|
|
106
|
+
assert_exit status-drift 1
|
|
107
|
+
|
|
108
|
+
run_capture sync-dry-run sync --dry-run --yes
|
|
109
|
+
assert_contains "$CAPTURE_DIR/sync-dry-run.txt" "Planned repairs:"
|
|
110
|
+
assert_contains "$CAPTURE_DIR/sync-dry-run.txt" "Backups planned:"
|
|
111
|
+
assert_exit sync-dry-run 1
|
|
112
|
+
|
|
113
|
+
run_capture history history
|
|
114
|
+
assert_contains "$CAPTURE_DIR/history.txt" "Kairo Runtime history"
|
|
115
|
+
assert_exit history 0
|
|
116
|
+
|
|
117
|
+
run_capture history-last history last
|
|
118
|
+
assert_contains "$CAPTURE_DIR/history-last.txt" "Kairo Runtime history last"
|
|
119
|
+
assert_exit history-last 0
|
|
120
|
+
|
|
121
|
+
run_capture report report
|
|
122
|
+
assert_contains "$CAPTURE_DIR/report.txt" "Kairo Runtime report"
|
|
123
|
+
assert_contains "$CAPTURE_DIR/report.txt" "Diff:"
|
|
124
|
+
assert_exit report 1
|
|
125
|
+
|
|
126
|
+
run_capture invalid-command not-a-command
|
|
127
|
+
assert_contains "$CAPTURE_DIR/invalid-command.stderr.txt" 'Unknown command "not-a-command"'
|
|
128
|
+
assert_exit invalid-command 1
|
|
129
|
+
|
|
130
|
+
run_capture invalid-limit history --limit 0
|
|
131
|
+
assert_contains "$CAPTURE_DIR/invalid-limit.stderr.txt" "Invalid --limit"
|
|
132
|
+
assert_exit invalid-limit 1
|
|
133
|
+
|
|
134
|
+
run_capture consent-missing setup --agents cursor
|
|
135
|
+
assert_contains "$CAPTURE_DIR/consent-missing.stderr.txt" "Non-interactive setup requires"
|
|
136
|
+
assert_not_contains "$CAPTURE_DIR/consent-missing.txt" "Local Agent Operating System"
|
|
137
|
+
assert_exit consent-missing 1
|
|
138
|
+
|
|
139
|
+
echo
|
|
140
|
+
echo "UX smoke passed. Captures kept in $CAPTURE_DIR until exit."
|