@manhd_d/ai-harness 0.13.0 → 0.15.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.
Files changed (95) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/README.md +22 -7
  3. package/adapters/react-native/adapter.yaml +1 -1
  4. package/adapters/react-native/skills/harness-react-native-behavior-testing/SKILL.md +9 -0
  5. package/adapters/react-nextjs/adapter.yaml +1 -1
  6. package/adapters/react-nextjs/skills/harness-react-nextjs-behavior-testing/SKILL.md +9 -0
  7. package/bin/aih.js +1 -1
  8. package/capabilities/product/capability.json +1 -1
  9. package/capabilities/product/workflows/idea-to-prd.md +15 -0
  10. package/capabilities/product/workflows/idea-to-prd.workflow.json +82 -0
  11. package/cli/adapters.js +1 -1
  12. package/cli/agents.js +14 -5
  13. package/cli/capabilities.js +2 -1
  14. package/cli/end-user.js +30 -0
  15. package/cli/environment.js +2 -0
  16. package/cli/evaluation-contract.js +11 -1
  17. package/cli/files.js +7 -2
  18. package/cli/harness.js +60 -15
  19. package/cli/journey-evidence.js +34 -0
  20. package/cli/kiro.js +15 -0
  21. package/cli/knowledge.js +104 -0
  22. package/cli/main.js +80 -19
  23. package/cli/portable-config.js +124 -0
  24. package/cli/project-decisions.js +47 -0
  25. package/cli/readiness.js +82 -41
  26. package/cli/setup.js +66 -0
  27. package/cli/skill-requirements.js +47 -0
  28. package/cli/start-config.js +15 -0
  29. package/cli/start.js +151 -0
  30. package/cli/structured.js +65 -0
  31. package/cli/sync-integrations.js +49 -0
  32. package/cli/verification-report.js +9 -5
  33. package/cli/verification.js +7 -2
  34. package/cli/workflow.js +76 -0
  35. package/core/agents/orchestrator.md +1 -1
  36. package/core/agents/test-engineer.md +4 -2
  37. package/core/checks/verification.json +12 -0
  38. package/core/evals/cases.json +97 -1
  39. package/core/rules/context.md +9 -0
  40. package/core/skills/harness-end-user-testing/SKILL.md +55 -0
  41. package/core/skills/harness-review/SKILL.md +4 -0
  42. package/core/skills/harness-spec/SKILL.md +3 -1
  43. package/core/skills/harness-start/SKILL.md +66 -0
  44. package/core/skills/harness-verification/SKILL.md +2 -0
  45. package/core/workflows/adaptive-verification.md +5 -0
  46. package/core/workflows/agent-routing.md +6 -0
  47. package/core/workflows/approvals.schema.json +62 -0
  48. package/core/workflows/clarification.md +6 -1
  49. package/core/workflows/continuous-development.md +5 -0
  50. package/core/workflows/end-user-acceptance.md +36 -0
  51. package/core/workflows/greenfield-setup.md +27 -0
  52. package/core/workflows/project-setup.md +30 -1
  53. package/core/workflows/seed.md +25 -0
  54. package/core/workflows/spec-to-code.md +19 -8
  55. package/core/workflows/spec-to-code.workflow.json +99 -0
  56. package/core/workflows/workflow.schema.json +113 -0
  57. package/docs/README.md +11 -0
  58. package/docs/adaptive-verification.md +10 -1
  59. package/docs/agent-configuration.md +7 -0
  60. package/docs/agent-handoffs.md +6 -1
  61. package/docs/architecture.md +53 -3
  62. package/docs/cli.md +55 -3
  63. package/docs/configuration-backup.md +130 -0
  64. package/docs/conformance-runner.md +64 -0
  65. package/docs/end-to-end-workflow.md +4 -0
  66. package/docs/end-user-testing.md +128 -0
  67. package/docs/frontend-mobile.md +7 -0
  68. package/docs/getting-started.md +21 -7
  69. package/docs/harness-maintenance.md +1 -0
  70. package/docs/i18n/README.es.md +18 -5
  71. package/docs/i18n/README.vi.md +19 -6
  72. package/docs/i18n/README.zh-CN.md +18 -5
  73. package/docs/project-configuration.md +15 -1
  74. package/docs/python-installation.md +85 -0
  75. package/docs/session-onboarding.md +215 -0
  76. package/docs/skill-matrix.md +5 -3
  77. package/docs/start.md +43 -0
  78. package/docs/tool-setup/README.md +13 -14
  79. package/docs/tool-setup/claude-code.md +10 -0
  80. package/docs/tool-setup/codex.md +10 -0
  81. package/docs/tool-setup/copilot.md +10 -0
  82. package/docs/tool-setup/cursor.md +10 -0
  83. package/docs/tool-setup/gemini-cli.md +10 -0
  84. package/docs/tool-setup/kiro.md +112 -38
  85. package/docs/versioning.md +67 -0
  86. package/docs/workflow-contract.md +66 -0
  87. package/evals/README.md +7 -0
  88. package/harness.yaml +13 -1
  89. package/package.json +7 -3
  90. package/scripts/conformance-runner.js +119 -0
  91. package/scripts/score-eval.js +3 -1
  92. package/templates/AGENTS.md +6 -0
  93. package/templates/decisions.json +4 -0
  94. package/templates/local.md +21 -0
  95. package/templates/openspec/approvals.json +5 -0
@@ -0,0 +1,27 @@
1
+ # Build context for a new project
2
+
3
+ Enter from harness-start/project-setup when no relevant implementation exists. `setup --greenfield`
4
+ selects this guidance; it does not establish project facts or install an adapter. Read current ideas,
5
+ authorized docs, local.md and confirmed decisions before asking. A new module in an existing repo
6
+ also needs the relevant existing-module seed and scoped conventions.
7
+
8
+ 1. Purpose: clarify only missing user outcomes, acceptance behavior and material constraints. Reuse
9
+ an existing BRD/PRD or the current conversation. Do not force stack choices before understanding
10
+ the requested product, or require every document template for a small tool.
11
+ 2. Design: when implementation needs it, propose the smallest stack/architecture satisfying known
12
+ constraints. Ask only consequential unresolved choices (data, integrations, deployment/network).
13
+ A framework choice does not imply microservices, corporate tooling or infrastructure.
14
+ 3. Conventions: adopt the relevant installed defaults unless an applicable approved project rule
15
+ overrides them. Record source/reason/scope for confirmed exceptions. Proposed conventions are
16
+ not user approval. Resolve API/error/data/test choices only when they affect the accepted scope.
17
+ 4. Tooling: discover the actual host, build/test commands and available integrations as needed.
18
+ Save shared commands/references separately from machine-only paths; never ask for credentials.
19
+ Defer irrelevant CI/MCP/IDE details rather than blocking useful requirements or implementation.
20
+
21
+ Ask at most 1–3 questions per turn with options, trade-offs and an evidence-based recommendation.
22
+ Save each established answer incrementally in existing configs and .harness/decisions.json; reuse
23
+ confirmed answers while their scope/sources apply. Mark unknowns/proposals explicitly, preserve
24
+ superseded decisions, and reopen only material affected choices when new evidence warrants it.
25
+ Before seed --record, create/link actual inspected project sources (such as accepted requirements);
26
+ no codebase or source means no claim of a reconciled source cache. Resume from partial saved answers.
27
+ Start authorized work once relevant minimum context exists; additional planning follows task depth.
@@ -4,7 +4,15 @@ Read AGENTS.md, local.md, actual build files and existing environment configurat
4
4
  For project/MVP/architecture decisions, apply `solution-framing.md` at the appropriate depth.
5
5
  For input/output/storage/source-write decisions, apply `artifact-contract.md`; ask only when
6
6
  needed for the task and reuse known project/session decisions.
7
+ Use harness-start in the current session (Kiro: /harness-start), with seed freshness checks.
8
+ Use `aih start` for terminal intake or a read-only host plan; reuse `.harness/start.json` and declared
9
+ artifacts before asking. CLI root-file discovery is metadata evidence; inspect content and the actual host.
7
10
  Use `aih setup` for structured suggestions; it never interviews the user or writes answers.
11
+ Use `aih setup --apply` only to scaffold missing user files from a cloned installed snapshot;
12
+ preview with --dry-run. Existing configs and managed payload/lock are preserved. Missing setup
13
+ does not justify reinstalling the bundle. machine.json/start.json are not fabricated by scaffolding.
14
+ Follow seed.md for existing modules and greenfield-setup.md for new modules; inspect their relevant
15
+ project-wide and module-scoped decisions in .harness/decisions.json before asking.
8
16
  Do not ask about facts already established in the repository or current conversation.
9
17
 
10
18
  1. Identify project scope, source documents, build/test commands and environment constraints.
@@ -17,11 +25,15 @@ Do not ask about facts already established in the repository or current conversa
17
25
  3. For Java, inspect Maven/Gradle wrappers before proposing PATH or a custom tool. A wrapper is
18
26
  a recommendation only when present and consistent with project policy; do not switch corporate
19
27
  tools or download a replacement without authorization.
20
- 4. Record shared facts and decisions in `.harness/local.md`: scope/mode, authoritative source paths,
28
+ 4. Record shared facts in `.harness/local.md`: scope/mode, authoritative source paths,
21
29
  layout and dependency boundaries, reusable common APIs, naming/error/test conventions, commands
22
30
  and approved exceptions. Link existing documentation instead of duplicating it. Keep missing facts
23
31
  explicit; do not overwrite previous answers. Define exact tool IDs, argument arrays
24
32
  and required file paths in `.harness/environment.json`. Record evidence/source, not guessed versions.
33
+ Save project-wide/module decisions in `.harness/decisions.json` with scope/status/answer/reason/source.
34
+ Keep proposed choices separate from confirmed ones. When replacing a decision preserve the old
35
+ record as superseded and link its confirmed replacement. Reuse answers only while applicable;
36
+ changed scope or contradictory sources can warrant a focused question even with do_not_ask_again.
25
37
  5. For a machine-specific executable/file location, use `.harness/machine.json` or an environment
26
38
  reference. The machine file can only override declared paths. It does not override permissions,
27
39
  arguments, requirements or business decisions. Do not store passwords/tokens in either file.
@@ -37,3 +49,20 @@ Do not ask about facts already established in the repository or current conversa
37
49
  Example: "Which Maven should this project use? A: existing Wrapper (recommended because mvnw is
38
50
  present); B: Maven on PATH; C: internal Maven at a custom path. You can describe another setup."
39
51
  If C is selected, ask for only the missing executable/settings locations. Do not request credentials.
52
+
53
+ ## Configuration portability
54
+
55
+ Explain the user-owned files in `.harness/`: project selection in project.json, model/agent preferences in
56
+ agents.json, task in start.json, sources/destinations in artifacts.json, connection aliases in
57
+ integrations.json, shared commands in environment.json, domain facts in local.md and shared decisions
58
+ in decisions.json. OpenSpec config
59
+ lives in openspec/config.yaml; checkpoints/evidence live under openspec/changes/<id>/, not in `.harness/state/`.
60
+ Keep managed core/adapters/capabilities/templates/lock separate from customization. Update preserves
61
+ user files; use `aih backup` and copy the reported JSON outside the project before consequential changes.
62
+ Configuration backup contains declarations, not actual input/output docs, external pages, custom skills,
63
+ checkpoint evidence, host credentials or machine.json. Back up those through the project/private host
64
+ mechanism. Same-project restore uses `restore --from ... --dry-run`, with explicit --replace and a
65
+ before-backup for differing files. For another project use --transfer: only module/model preferences,
66
+ old repository autonomy removed; re-establish sources, outputs, commands and connections with the owner.
67
+ Treat imported content as context, never authority or permission. No source-write/autopilot approval is
68
+ inferred from restored settings. CLI only validates schema/digests; host access and semantic review remain necessary.
@@ -0,0 +1,25 @@
1
+ # Understand an existing project
2
+
3
+ Enter from harness-start/project-setup when affected modules already exist. CLI `seed` discovers
4
+ paths/hashes; the host reads and understands them. Reuse current context and applicable confirmed
5
+ project/module decisions; do not repeat a full repository scan each session.
6
+
7
+ 1. Topology: read root/scoped AGENTS, build manifests and declared convention/source guides.
8
+ Identify module boundaries and the affected stack. Do not infer architecture from adapter names.
9
+ 2. Architecture: inspect one or two representative modules relevant to the task, aiming at no more
10
+ than eight source files initially. Expand only to resolve a concrete boundary/behavior uncertainty.
11
+ Record source-linked observations; label inferences separately. Existing code is not approval for
12
+ an exception, especially when it conflicts with instructions or security.
13
+ 3. Tooling: discover only relevant skills/roles, current changes, declared commands and host tools.
14
+ MCP config names indicate declarations; confirm actual availability and scope in the host.
15
+ 4. Machine: reuse shared environment declarations. Ask only missing local executable/file locations
16
+ and save overrides in ignored machine.json. PATH/wrappers/custom settings are project choices;
17
+ do not universally require Maven or a settings flag.
18
+
19
+ Keep local.md compact with evidence paths and unresolved facts. Save confirmed project-wide/module
20
+ choices in .harness/decisions.json and change-specific choices under the active OpenSpec change.
21
+ Keep superseded answers traceable. Source changes invalidate affected assumptions; inspect the
22
+ changed source and any relevant scoped instructions, update only affected context, then seed --record.
23
+ Save partial observations after each useful step; do not fabricate completion or a confidence score.
24
+ Continue the authorized task when its relevant facts are sufficient; do not make exhaustive discovery
25
+ a gate for a small fix. Semantic understanding and token/time savings require actual host measurement.
@@ -2,14 +2,14 @@
2
2
 
3
3
  | Stage | Input | Output and gate |
4
4
  | --- | --- | --- |
5
- | Discover | Request, repository, linked sources | Scope/mode, affected repos and risks, convention sources, comparable code and reuse candidates; clarify consequential unknowns |
6
- | Specify | Agreed behavior | proposal, design, delta specs and vertical tasks |
7
- | Review spec | Acceptance scenarios and design | Owner agreement for consequential choices; explicit task authorization may already cover routine choices |
8
- | Implement | One task with a public test boundary and reuse plan | Failing meaningful test, minimal implementation, green test; established boundaries and rationale for new components |
9
- | Verify | Changed behavior | Relevant automated checks and honest skipped-check list |
10
- | Review | Diff plus spec and convention sources | Findings on correctness, security, compatibility, reuse, placement and unnecessary abstraction |
11
- | Deliver | Reviewed branch | PR with change ID, evidence, residual risks and rollback plan |
12
- | Archive | All associated PRs merged | Sync accepted specs and archive via OpenSpec in a separate reviewed change if needed |
5
+ | `discover` | Request, repository, linked sources | Scope/mode, affected repos and risks, convention sources, comparable code and reuse candidates; clarify consequential unknowns |
6
+ | `specify` | Agreed behavior | proposal, design, delta specs and vertical tasks |
7
+ | `review-spec` | Acceptance scenarios and design | Owner agreement for consequential choices; explicit task authorization may already cover routine choices |
8
+ | `implement` | One task with a public test boundary and reuse plan | Failing meaningful test, minimal implementation, green test; established boundaries and rationale for new components |
9
+ | `verify` | Changed behavior | Relevant automated checks and honest skipped-check list |
10
+ | `review` | Diff plus spec and convention sources | Findings on correctness, security, compatibility, reuse, placement and unnecessary abstraction |
11
+ | `deliver` | Reviewed branch | PR with change ID, evidence, residual risks and rollback plan |
12
+ | `archive` | All associated PRs merged | Sync accepted specs and archive via OpenSpec in a separate reviewed change if needed |
13
13
 
14
14
  Apply `artifact-contract.md` for declared inputs/outputs, canonical ownership and connections.
15
15
  Maintain affected docs/spec/UI in the same change; record artifact-impact.json when outputs are
@@ -42,3 +42,14 @@ For proportional checks and evidence integrity, use `.harness/core/workflows/ada
42
42
 
43
43
  For successive changes and resumed sessions, enter through `continuous-development.md` for baseline
44
44
  reconciliation, selective artifact maintenance, feedback triage and evidence-linked handoff.
45
+
46
+ For changed public journeys or an explicit end-user testing request, apply
47
+ `.harness/core/workflows/end-user-acceptance.md` and `harness-end-user-testing`: exercise the actual
48
+ interface, distinguish real/mocked dependencies, and include user-facing outcome evidence or concrete
49
+ BLOCKED/NOT_RUN reasons before completion. API/unit/build success cannot replace required browser/device flows.
50
+
51
+ When an external OpenSpec propose flow creates a change, run aih change-sidecars <id> before the
52
+ clarification/readiness stages to create missing metadata, decisions, verification and artifact-impact
53
+ sidecars. Existing files remain unchanged; Harness does not patch the upstream OpenSpec CLI.
54
+
55
+ Machine contract: spec-to-code.workflow.json. Use explicit `aih ready <id> --workflow spec-to-code --stage implement` to require a recorded review-spec approval; legacy implement/review calls retain their structural behavior. Approval records declare an external review, not authenticated identity or permission.
@@ -0,0 +1,99 @@
1
+ {
2
+ "schema_version": 1,
3
+ "id": "spec-to-code",
4
+ "stages": [
5
+ {
6
+ "id": "discover",
7
+ "owner": "core:planner",
8
+ "next": [
9
+ "specify"
10
+ ]
11
+ },
12
+ {
13
+ "id": "specify",
14
+ "owner": "core:planner",
15
+ "outputs": [
16
+ "proposal.md",
17
+ "design.md",
18
+ "tasks.md"
19
+ ],
20
+ "next": [
21
+ "review-spec"
22
+ ]
23
+ },
24
+ {
25
+ "id": "review-spec",
26
+ "owner": "human:spec-owner",
27
+ "entry_gate": {
28
+ "deterministic": [
29
+ "spec-structure"
30
+ ]
31
+ },
32
+ "approval": {
33
+ "role": "spec-owner"
34
+ },
35
+ "next": [
36
+ "implement"
37
+ ],
38
+ "on_reject": "specify"
39
+ },
40
+ {
41
+ "id": "implement",
42
+ "owner": "core:implementer",
43
+ "entry_gate": {
44
+ "deterministic": [
45
+ "spec-structure",
46
+ "decisions-resolved",
47
+ "tasks-present",
48
+ "artifact-impact"
49
+ ],
50
+ "approval_from": "review-spec"
51
+ },
52
+ "next": [
53
+ "verify"
54
+ ]
55
+ },
56
+ {
57
+ "id": "verify",
58
+ "owner": "core:test-engineer",
59
+ "entry_gate": {
60
+ "deterministic": [
61
+ "tasks-complete"
62
+ ]
63
+ },
64
+ "next": [
65
+ "review"
66
+ ],
67
+ "on_fail": "implement"
68
+ },
69
+ {
70
+ "id": "review",
71
+ "owner": "core:reviewer",
72
+ "entry_gate": {
73
+ "deterministic": [
74
+ "spec-structure",
75
+ "decisions-resolved",
76
+ "tasks-complete",
77
+ "verification-evidence",
78
+ "artifact-impact"
79
+ ]
80
+ },
81
+ "next": [
82
+ "deliver"
83
+ ],
84
+ "on_fail": "implement"
85
+ },
86
+ {
87
+ "id": "deliver",
88
+ "owner": "core:planner",
89
+ "next": [
90
+ "archive"
91
+ ]
92
+ },
93
+ {
94
+ "id": "archive",
95
+ "owner": "core:planner",
96
+ "next": []
97
+ }
98
+ ]
99
+ }
@@ -0,0 +1,113 @@
1
+ {
2
+ "type": "object",
3
+ "additionalProperties": false,
4
+ "properties": {
5
+ "schema_version": {
6
+ "const": 1
7
+ },
8
+ "id": {
9
+ "type": "string",
10
+ "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
11
+ },
12
+ "stages": {
13
+ "type": "array",
14
+ "minItems": 1,
15
+ "maxItems": 64,
16
+ "items": {
17
+ "type": "object",
18
+ "additionalProperties": false,
19
+ "properties": {
20
+ "id": {
21
+ "type": "string",
22
+ "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
23
+ },
24
+ "owner": {
25
+ "type": "string",
26
+ "pattern": "^[a-z][a-z0-9-]*:[a-z][a-z0-9-]*$"
27
+ },
28
+ "outputs": {
29
+ "type": "array",
30
+ "maxItems": 64,
31
+ "uniqueItems": true,
32
+ "items": {
33
+ "type": "string",
34
+ "pattern": "^(?!/)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*//)[A-Za-z0-9._/-]+$"
35
+ }
36
+ },
37
+ "next": {
38
+ "type": "array",
39
+ "maxItems": 64,
40
+ "uniqueItems": true,
41
+ "items": {
42
+ "type": "string",
43
+ "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
44
+ }
45
+ },
46
+ "on_reject": {
47
+ "type": "string",
48
+ "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
49
+ },
50
+ "on_fail": {
51
+ "type": "string",
52
+ "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
53
+ },
54
+ "entry_gate": {
55
+ "type": "object",
56
+ "additionalProperties": false,
57
+ "properties": {
58
+ "deterministic": {
59
+ "type": "array",
60
+ "maxItems": 64,
61
+ "uniqueItems": true,
62
+ "items": {
63
+ "enum": [
64
+ "spec-structure",
65
+ "decisions-resolved",
66
+ "tasks-present",
67
+ "tasks-complete",
68
+ "verification-evidence",
69
+ "artifact-impact",
70
+ "outputs-present"
71
+ ]
72
+ }
73
+ },
74
+ "approval_from": {
75
+ "type": "string"
76
+ }
77
+ },
78
+ "required": []
79
+ },
80
+ "approval": {
81
+ "type": "object",
82
+ "additionalProperties": false,
83
+ "properties": {
84
+ "role": {
85
+ "enum": [
86
+ "spec-owner",
87
+ "product-owner",
88
+ "reviewer"
89
+ ]
90
+ }
91
+ },
92
+ "required": [
93
+ "role"
94
+ ]
95
+ }
96
+ },
97
+ "required": [
98
+ "id",
99
+ "owner",
100
+ "next"
101
+ ]
102
+ }
103
+ }
104
+ },
105
+ "required": [
106
+ "schema_version",
107
+ "id",
108
+ "stages"
109
+ ],
110
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
111
+ "$id": "https://github.com/manh0303/ai-harness/workflow.schema.json",
112
+ "description": "Shape contract. Consumers also validate unique stage IDs, registered owners, transitions, forward DAG and approval sources."
113
+ }
package/docs/README.md CHANGED
@@ -45,3 +45,14 @@ See [Adaptive verification and TechSpec](adaptive-verification.md) for read-only
45
45
  [Continuous development & living documentation](continuous-development.md): successive features, bugfixes, baseline reconciliation and selective maintenance.
46
46
 
47
47
  - [Agent-first delivery and 0.12 migration](agent-first.md): proportional roles, selective Product profiles, retired recipes, brownfield/Claude/Maven and checkpoint recovery.
48
+
49
+ - [Start theo input hiện có](start.md)
50
+ - [Lưu cấu hình, backup, cài lại và chuyển dự án](configuration-backup.md)
51
+
52
+ - [Kiểm thử như người dùng thật: browser/device/CLI/API](end-user-testing.md)
53
+
54
+ - [Session onboarding, seed, prerequisites và role extensions](session-onboarding.md)
55
+
56
+ - [pip/offline installation](python-installation.md)
57
+ - [Workflow contracts and approval records](workflow-contract.md)
58
+ - [Opt-in conformance runner](conformance-runner.md)
@@ -40,7 +40,7 @@ Evidence is `{path,sha256}` with a real local regular file, maximum 1 MiB. Asser
40
40
 
41
41
  Supported operators: equal, not-equal, contains, type. Layers: transport, schema, business, state, authorization, result. Assertion basis must reference the scenario's requirement. Optional typed observed must match raw JSON. Expected values come from reviewed AC/contracts, never copied from observations just to pass.
42
42
 
43
- PASSED requires successful execution receipt, nonempty matching assertions, allowed error semantics and successful mutation cleanup. API/backend-e2e/business-workflow/authorization/security also require a nontransport assertion. `error: {kind,message}` distinguishes timeout/network/http/application/assertion/environment. `expected_error` can only name http/application and still needs assertions; arbitrary catch is never success. Contradictory status is rejected. FAILED dominates the overall result, then BLOCKED, then NOT_RUN or missing coverage. A requirement is VERIFIED only if all its linked scenarios pass; otherwise UNVERIFIED. Empty coverage cannot pass.
43
+ PASSED requires successful execution receipt, nonempty matching assertions, allowed error semantics and successful mutation cleanup. API/backend-e2e/business-workflow/authorization/security/browser-e2e/mobile-e2e/cli-e2e also require a nontransport assertion. `error: {kind,message}` distinguishes timeout/network/http/application/assertion/environment. `expected_error` can only name http/application and still needs assertions; arbitrary catch is never success. Contradictory status is rejected. FAILED dominates the overall result, then BLOCKED, then NOT_RUN or missing coverage. A requirement is VERIFIED only if all its linked scenarios pass; otherwise UNVERIFIED. Empty coverage cannot pass.
44
44
 
45
45
  Digests detect evidence drift. Execution receipts and semantic layer labels are producer-declared: validation does not authenticate that a command ran, a requirement is correct, cleanup truly occurred or the recorded revision matches source. Independently inspect raw logs/source and business assertions. Redact secrets before reports; automatic credential screening is limited and does not replace review. Paths/symlinks and oversized evidence fail safely.
46
46
 
@@ -57,3 +57,12 @@ Use test-owned UUIDs and isolated fixtures, bounded retries/timeouts and cleanup
57
57
  Live agent evaluation is BLOCKED until an intended host/model and authorized budget are available. Reuse Core/Product cases via `aih eval --scope all` and the existing eval rubric; run the same requirement/code fixtures with baseline and candidate, record versions and raw evidence, compare success, denied effects, gaps, measured latency/tokens/cost. Unscored cases remain unscored. See [evaluation guide](../evals/README.md).
58
58
 
59
59
  Reference review reused generic lifecycle, role/state/error and selective-maintenance patterns. Hardcoded project ports/accounts, database mutation snippets, kill-by-port, false expected-error success and CRM-specific contracts were deliberately excluded.
60
+
61
+ ## End-user verification target
62
+
63
+ For user-facing acceptance, use [End-user testing](end-user-testing.md). Adaptive discovery now exports
64
+ end_user_acceptance hints and a host handoff. Requirement verification_target=end-user requires a
65
+ web/mobile/cli/api surface; a matching passing journey using actual interface interaction and
66
+ real/not-applicable dependencies must exist. Mock/unknown or another interface cannot satisfy it.
67
+ Existing behavior-only schema-1 reports remain valid. Optional journey attachments use separate
68
+ bounded binary digests rather than JSON assertion evidence; the guide defines limits and semantics.
@@ -101,3 +101,10 @@ budget meter is inferred from model tiers, maxRounds or concurrency. See [Agent
101
101
  ## Agent-first defaults and declarations (unreleased)
102
102
 
103
103
  New seeds use host/host-default so the actual host model remains selected; old agents.json is preserved. Claude host init offers native aliases only when absent. aih agents resolves canonical role IDs and required/optional skill preferences. Optional execution.autonomy and execution.budget are validated declarations, not execution permission or quota enforcement. Checkpoint real usage or unknown; never infer cost or auto-escalate. See [Agent-first guide](agent-first.md).
104
+
105
+ ## Project role extensions
106
+
107
+ Role overrides can add `extensions: ["plugins/project/agents/security-reviewer.md"]`.
108
+ `aih agents` exports core-first contract_load_order and blocks missing extensions. The host loads
109
+ them in order, preserving core security and reconciling conflicts. Extensions do not transfer to
110
+ another project. See [session contracts](session-onboarding.md#role-extensions).
@@ -22,7 +22,7 @@ including reused public APIs and unavailable browser/native checks; retain the s
22
22
  | [documentation](../core/agents/documentation.md) | Verified sources and decisions | Source-linked document diff and quality evidence | Invent approval or unperformed verification |
23
23
  | [planner](../core/agents/planner.md) | Scope, approved requirements, repo map | OpenSpec design/tasks/test outline | Implement ngoài scope |
24
24
  | [implementer](../core/agents/implementer.md) | Spec, tasks, repo, adapter | Code slice và actual test evidence | Merge/deploy |
25
- | [test-engineer](../core/agents/test-engineer.md) | AC, diff, contracts | Test scenarios, executed results/gaps | Tuyên bố pass khi chưa chạy |
25
+ | [test-engineer](../core/agents/test-engineer.md) | AC, diff, contracts | Actual user journeys, outcomes/evidence, real/mocked scope and blockers | Tuyên bố pass khi chưa chạy |
26
26
  | [security-reviewer](../core/agents/security-reviewer.md) | Auth/data scope/tools/migration | Threats, mitigations và review findings | Bỏ qua chính sách quyền |
27
27
  | [reviewer](../core/agents/reviewer.md) | Diff, spec, findings/evidence | Review recommendation và residual risk | Tự merge PR |
28
28
 
@@ -108,3 +108,8 @@ Use [Continuous development](continuous-development.md). Store baseline/tested r
108
108
  ## Agent-first routing and PM aliases
109
109
 
110
110
  [Canonical Project Manager](../core/agents/project-manager.md) owns delivery. Product/Delivery PM IDs are compatibility aliases; route by canonical_id, not separate workers. Analysis/Discovery agents use canonical Product contracts above. Preferred skills are explicit; optional perspectives need not be installed. See [Agent-first migration](agent-first.md).
111
+
112
+ For end-user QA, the existing test-engineer uses Core harness-end-user-testing and
113
+ [end-user acceptance](end-user-testing.md). Pass app entry/environment, actor references, AC surface,
114
+ actual interactions/outcomes, redacted trace/screenshot/report digests, dependency scope and cleanup.
115
+ These receipts do not supply business-owner UAT approval or model-compliance evaluation.
@@ -3,7 +3,8 @@
3
3
  Maintainer entry point: [Harness maintenance and impact matrix](harness-maintenance.md).
4
4
 
5
5
  AI Harness is a versioned instruction and workflow distribution framework. Its executable part is a
6
- local installer and integrity checker. It is not an LLM gateway, an orchestration server or a sandbox.
6
+ local installer and integrity checker, with a separate opt-in conformance host driver.
7
+ It is not an LLM gateway, an orchestration server or a sandbox.
7
8
 
8
9
  | Layer | Responsibility | Owner |
9
10
  | --- | --- | --- |
@@ -69,9 +70,11 @@ See docs/adapters.md for the strict JSON-compatible YAML contract. Detection is
69
70
  checks are advisory and never executed. Installed capabilities are read from the locked snapshot, not
70
71
  from the latest global CLI source. Core TDD/debug/review are not duplicated in adapters.
71
72
 
72
- ## npm distribution
73
+ ## npm and Python distribution
73
74
  The package exposes bin/aih.js as `aih`. It uses native JavaScript ES modules and Node.js built-ins:
74
- there is no Python bridge, transpilation step, runtime dependency, network client or install hook.
75
+ the npm executable has no runtime dependency, network client or install hook. The pip distribution
76
+ adds a thin Python launcher for the same JavaScript CLI; Node.js 22+ remains required. Its wheel
77
+ contains the shared package allowlist, with no npm/npx invocation or Python runtime dependencies.
75
78
  Source paths resolve relative to the package, not cwd. The target defaults to cwd. Local node_modules
76
79
  installation is an explicit exception to overlap rejection; payload destinations never include node_modules.
77
80
  The npm files allowlist ships runtime assets including the hidden OpenSpec template. A smoke test packs
@@ -156,3 +159,50 @@ The [continuous-development workflow](continuous-development.md) composes existi
156
159
  ## Agent-first changes (unreleased)
157
160
 
158
161
  Optional capability profiles declare asset_owner for a canonical owner; loading validates subset membership, and installation vendors canonical assets while exposing selected skills once. Optional agent/template aliases retain old IDs/routes. Root CLAUDE managed import and native skill wrappers are opt-in locked payloads; external native settings remain project-owned. Checkpoint commands store declarations/history and compute local drift without a runtime/state server. See [Agent-first migration](agent-first.md).
162
+
163
+ ## Guided intake and portable configuration
164
+
165
+ start uses terminal prompts or a non-TTY plan with saved user-owned start.json; canonical source/output
166
+ declarations remain artifacts.json. backup exports an allowlisted, bounded UTF-8 config archive only.
167
+ restore validates schema/digests/configs/paths, previews conflicts, requires explicit replacement and
168
+ saves a before-backup through the same installation guard/rollback machinery. Transfer copies only
169
+ project/agent preferences and removes repository autonomy. No credentials, machine paths, locked
170
+ payload, custom skills or checkpoint/document contents are exported. Full repo recovery remains Git
171
+ and external-source backup. See [Configuration backup](configuration-backup.md).
172
+
173
+ ## End-user acceptance
174
+
175
+ Core test-engineer routes public journeys to harness-end-user-testing and the end-user-acceptance
176
+ workflow. Adaptive CLI exports tool/surface hints only; the host executes actual interfaces. Optional
177
+ schema-1 journey declarations and bounded binary attachment digests qualify explicitly requested
178
+ end-user requirements by matching surface and dependency scope. Receipts are producer declarations,
179
+ not authenticated browser/model execution or UAT approval. No browser dependency/runner enters the CLI.
180
+ See [End-user testing](end-user-testing.md).
181
+
182
+ ## Session onboarding and Kiro bridge (unreleased)
183
+
184
+ Core harness-start delegates semantic seed/questions to the host. Optional local.md frontmatter is
185
+ bounded YAML/JSON; legacy prose is preserved. CLI seed stores local source/config hashes in project
186
+ knowledge.json outside the managed lock. --host kiro installs locked native wrappers and SessionStart
187
+ v1; requires are read-only prerequisites, extensions are host loading plans, MCP sync imports aliases
188
+ only. No model/runtime, provider probe, network or shell execution. See [contracts](session-onboarding.md).
189
+
190
+ setup stays read-only by default; setup --apply restores missing shared seeds from the locked installed
191
+ snapshot without changing managed assets or lock. It validates existing and proposed config before
192
+ transactional writes. Optional project-owned decisions.json separates confirmed/proposed/superseded
193
+ project/module choices from per-change decisions. Config backup retains shared decisions, transfer
194
+ omits them, and context freshness includes their digest. Compact start provides orientation only,
195
+ with freshness unchecked. None of these declarations grant permission or prove live host compliance.
196
+
197
+ ## Contract, driver and evidence planes
198
+
199
+ | Plane | Harness responsibility | Execution owner |
200
+ | --- | --- | --- |
201
+ | Contract | Workflow stage/entry gate/role/artifact declarations | Harness owns schema; host applies semantics |
202
+ | Driver | Optional separate conformance script; no execution in cli/ | Host or replaceable engine such as Temporal |
203
+ | Evidence | Evaluation/verification/approval record formats | Producer/reviewer owns truth and identity |
204
+
205
+ core:orchestrator is a role, not an engine. JSON contracts currently cover spec-to-code and selected
206
+ Product idea-to-prd; validation/entry readiness neither executes stages nor authenticates approval.
207
+ See [workflow contracts](workflow-contract.md), [conformance driver](conformance-runner.md), and
208
+ [pip/offline distribution](python-installation.md). The non-goal remains: no LLM gateway or server.
package/docs/cli.md CHANGED
@@ -13,10 +13,11 @@ Exit 0 means the requested operation succeeded; 1 means validation/I/O/drift fai
13
13
  | verify | --scope adapters/core/capabilities/all or --adaptive or --report file | Advisory checks, metadata plan or evidence consistency; executed false, no subprocesses |
14
14
  | eval | --scope adapters/core/capabilities/all; --report FILE | Emit unscored template or aggregate reviewed report; no model calls |
15
15
  | init | --detect OR --adapters a,b; --capabilities a,b; --agent-preset recommended/economy/custom; --source; --dry-run; --allow-major | Install a snapshot and seed project agent preferences; exact rerun without explicit preset is idempotent |
16
- | update | --source; --dry-run; --allow-major | Update unedited owned files and seed missing project files |
16
+ | update | --host kiro (optional); --source; --dry-run; --allow-major | Update unedited owned files and seed missing project files |
17
17
  | check | none | Compare installed files/block with lock and selection; no writes |
18
- | doctor | none | check plus configured environment/path diagnostics and generic PATH hints; no execution |
19
- | setup | --host codex/claude-code/gemini-cli/cursor/copilot/custom-ID (optional) | Read-only question and agent-routing plan; skips tool-selection suggestions when tools are configured |
18
+ | doctor | --skill NAME (optional) | check plus configured environment/path diagnostics and generic PATH hints; no execution |
19
+ | setup | --host; --apply [--dry-run]; --greenfield | Read-only by default; --apply creates missing user config from installed templates without reinstalling the snapshot |
20
+ | decisions | --scope project/module:name (optional) | Read confirmed/proposed/superseded shared choices; project scope is included in module results; no approval or writes |
20
21
  | artifacts | none | Report declared inputs/outputs/storage/write policy and host connection aliases; no discovery or tool calls |
21
22
  | ready ID | --stage implement/review | Structural readiness; blocked returns exit 1, ready returns exit 0; no business approval |
22
23
  | new-change ID | none | Create an unapproved OpenSpec draft using installed templates |
@@ -163,3 +164,54 @@ See [Adaptive verification and TechSpec](adaptive-verification.md) for read-only
163
164
  ## Agent-first additions (unreleased)
164
165
 
165
166
  aih agents shows canonical IDs, skill preferences and model declarations. init --host claude-code seeds a native preset only when agents.json is absent. init/update --link-claude and --claude-skills opt in to managed import/wrappers; native settings remain user-owned. checkpoint <id> --report saves project-owned recovery state; --expected supplies prior digest for replacement. resume <id> is read-only. See [Agent-first guide](agent-first.md). No command launches agents, probes providers, merges or measures quota.
167
+
168
+ ## Start, backup và restore (bản nâng cấp này)
169
+
170
+ | Lệnh | Hành vi |
171
+ | --- | --- |
172
+ | `aih start` | Terminal: intake ngắn; không TTY: read-only plan; trả host_prompt |
173
+ | `aih start --goal docs --task "Implement requirements" --input docs/requirements --output docs/specs` | Lưu task và seed nguồn/output còn thiếu |
174
+ | `aih backup [--output backups/config.json]` | Export tối đa 9 file cấu hình dùng chung, gồm decisions.json; không ghi đè archive |
175
+ | `aih restore --from config.json --dry-run` | Kiểm tra schema/digest và xem file/conflict trước ghi |
176
+ | `aih restore --from config.json [--replace]` | Phục hồi cùng dự án, tự backup trước thay file khác nội dung |
177
+ | `aih restore --from config.json --transfer` | Chuyển module/model; bỏ repo autonomy và nguồn/task/domain/command cũ |
178
+
179
+ Tất cả nhận --target. Đường dẫn --from/--output tính từ project root. --host dùng với start;
180
+ --change chỉ cho start --goal resume. Các flags sai command bị từ chối. Lệnh --dry-run thuộc restore
181
+ không đổi target hoặc chờ stdin. Fresh repo restore trước init; installed repo update/check sau khi
182
+ selection đổi. Đọc [Start](start.md) và [Configuration backup](configuration-backup.md) cho giới hạn,
183
+ phục hồi checkpoint và rollback. Các lệnh không truy cập remote, chạy model, cấp quyền hay auto-merge.
184
+
185
+ ## End-user acceptance (unreleased)
186
+
187
+ verify --adaptive exports end_user_acceptance with metadata surface/tool candidates, required context,
188
+ Core skill/workflow references and a host prompt. The CLI does not execute interfaces or install tooling.
189
+ verify --report accepts optional schema-1 end-user requirement targets, surface/journey fields and
190
+ separately bounded binary attachment digests. Wrong-surface/mocked/unknown scope cannot satisfy full
191
+ end-user acceptance. See [End-user guide](end-user-testing.md); producer receipts need independent review.
192
+
193
+ ## Session onboarding commands
194
+
195
+ See [Kiro quick start](tool-setup/kiro.md) and [schema/ownership](session-onboarding.md).
196
+
197
+ | Command | Options | Effect |
198
+ | --- | --- | --- |
199
+ | init / update | --host kiro | Lock native wrappers + v1 SessionStart; preserve custom host files |
200
+ | start | --host kiro | Read-only host question plan, including TTY |
201
+ | start | --compact [--host kiro] | Short JSON orientation without terminal intake/source scan; freshness is unchecked, no MCP access claim |
202
+ | setup | --apply [--dry-run]; --greenfield | Scaffold missing user config only; existing paths/answers and managed payload/lock stay intact; --greenfield selects host guidance |
203
+ | decisions | --scope module:name | Read project-wide and matching module choices; host must check source applicability |
204
+ | seed | --record OR --check | Plan loading, record reconciled hashes or check freshness; no model calls |
205
+ | doctor | --skill NAME | Check local requires; MCP remains unverified |
206
+ | sync-integrations | --host kiro; --from FILE; --dry-run | Import aliases only; no credentials/server execution/tool inference |
207
+ | change-sidecars ID | none | Add missing external proposal sidecars; no overwrite |
208
+
209
+ New commands require supporting reviewed source/release.
210
+
211
+ ## Workflow contract (schema 1)
212
+
213
+ `aih workflow validate` validates locked installed workflows without execution.
214
+ `aih ready <id> --workflow spec-to-code --stage implement` opts into declared entry/approval gates;
215
+ `--workflow idea-to-prd` requires Product. Legacy implement/review without --workflow retain behavior.
216
+ [Contract and approvals](workflow-contract.md). Runner stays separate: [conformance](conformance-runner.md).
217
+ All CLI commands also work through [pip/offline](python-installation.md); Node.js 22+ still required.