nativesoul 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.
Files changed (121) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/LICENSE +19 -0
  3. package/README.md +384 -0
  4. package/dist/packages/cli/src/index.js +1066 -0
  5. package/dist/packages/core/src/secret-patterns.json +25 -0
  6. package/dist/packages/mcp-server/src/index.js +782 -0
  7. package/docs/adr/ADR-001-node-first-runtime.md +20 -0
  8. package/docs/adr/ADR-002-workspace-and-state.md +16 -0
  9. package/docs/adr/ADR-003-schemas-and-adapter-sdk.md +15 -0
  10. package/docs/adr/ADR-004-policy-leases-and-heartbeat.md +15 -0
  11. package/docs/adr/ADR-005-privacy-export-delete-and-supply-chain.md +16 -0
  12. package/docs/adr/ADR-006-adapter-preview-before-install.md +21 -0
  13. package/docs/adr/ADR-007-managed-block-backup-and-rollback.md +16 -0
  14. package/docs/adr/ADR-008-mcp-registration-manifest-before-write.md +16 -0
  15. package/docs/adr/ADR-009-local-capability-registry.md +16 -0
  16. package/docs/adr/ADR-010-mcp-capability-tools-read-only.md +15 -0
  17. package/docs/adr/ADR-011-local-audit-cli-export.md +16 -0
  18. package/docs/adr/ADR-012-npm-package-runtime-scope.md +16 -0
  19. package/docs/adr/ADR-013-core-domain-ledger-v1.md +16 -0
  20. package/docs/adr/ADR-014-memory-lifecycle-v1.md +16 -0
  21. package/docs/adr/ADR-015-policy-standing-orders-v1.md +16 -0
  22. package/docs/adr/ADR-016-heartbeat-lease-idempotency-v1.md +16 -0
  23. package/docs/adr/ADR-017-reversible-mcp-registration-install.md +17 -0
  24. package/docs/adr/ADR-018-schedule-reconcile-guardrails-v1.md +17 -0
  25. package/docs/adr/ADR-019-commitments-lifecycle-v1.md +17 -0
  26. package/docs/adr/ADR-020-mcp-memory-lifecycle-tools.md +16 -0
  27. package/docs/adr/ADR-021-unified-install-orchestrator-v1.md +17 -0
  28. package/docs/adr/ADR-022-unified-uninstall-orchestrator-v1.md +20 -0
  29. package/docs/adr/ADR-023-deep-doctor-install-readiness-v1.md +18 -0
  30. package/docs/adr/ADR-024-capability-learn-cards-v1.md +18 -0
  31. package/docs/adr/ADR-025-bootstrap-capability-card-recall-v1.md +18 -0
  32. package/docs/adr/ADR-026-managed-block-bootstrap-handshake-v1.md +18 -0
  33. package/docs/adr/ADR-027-local-release-manifest-checksum-v1.md +17 -0
  34. package/docs/adr/ADR-028-openclaw-workspace-templates-v1.md +47 -0
  35. package/docs/adr/ADR-029-host-guided-onboarding-v1.md +98 -0
  36. package/docs/adr/ADR-030-host-surface-matrix-v1.md +93 -0
  37. package/docs/adr/ADR-031-host-parity-matrix-v2.md +91 -0
  38. package/docs/adr/ADR-032-nativesoul-hard-cut-rebrand.md +54 -0
  39. package/docs/adr/ADR-033-local-hybrid-memory-reflection.md +49 -0
  40. package/docs/adr/ADR-034-memory-importers-provenance.md +38 -0
  41. package/docs/adr/ADR-035-policy-pack-apply-rollback.md +34 -0
  42. package/docs/adr/ADR-036-local-operator-dashboard-readonly.md +38 -0
  43. package/docs/adr/ADR-037-full-native-evidence-contract.md +45 -0
  44. package/docs/adr/ADR-038-identity-vs-activation-onboarding.md +39 -0
  45. package/docs/adr/ADR-039-entitlements-offline-licensing.md +47 -0
  46. package/docs/adr/ADR-040-proprietary-free-to-install-distribution.md +52 -0
  47. package/docs/adr/ADR-041-project-identity-and-lightweight-registry.md +35 -0
  48. package/docs/adr/ADR-042-control-plane-direction-and-deferral.md +80 -0
  49. package/docs/adr/ADR-043-versioning-and-release-policy.md +60 -0
  50. package/docs/adr/ADR-044-pro-awareness-and-upgrade-nudge-policy.md +53 -0
  51. package/docs/adr/ADR-045-paid-only-closed-distribution.md +55 -0
  52. package/docs/legal/EULA.md +70 -0
  53. package/llm-install.txt +222 -0
  54. package/package.json +61 -0
  55. package/plugins/antigravity-nativesoul/GEMINI.md +17 -0
  56. package/plugins/antigravity-nativesoul/commands/nativesoul-explore.md +22 -0
  57. package/plugins/antigravity-nativesoul/commands/nativesoul-heartbeat.md +9 -0
  58. package/plugins/antigravity-nativesoul/commands/nativesoul-plan.md +23 -0
  59. package/plugins/antigravity-nativesoul/commands/nativesoul-recall.md +16 -0
  60. package/plugins/antigravity-nativesoul/commands/nativesoul-start.md +9 -0
  61. package/plugins/antigravity-nativesoul/hooks.json +59 -0
  62. package/plugins/antigravity-nativesoul/mcp_config.json +8 -0
  63. package/plugins/antigravity-nativesoul/nativesoul-package.json +22 -0
  64. package/plugins/antigravity-nativesoul/plugin.json +5 -0
  65. package/plugins/claude-nativesoul/.claude-plugin/plugin.json +90 -0
  66. package/plugins/claude-nativesoul/hooks/loader.cjs +23 -0
  67. package/plugins/claude-nativesoul/hooks/memory-flush.cjs +45 -0
  68. package/plugins/claude-nativesoul/hooks/pre-tool-use.cjs +53 -0
  69. package/plugins/claude-nativesoul/hooks/session-start.cjs +108 -0
  70. package/plugins/claude-nativesoul/hooks/user-prompt-submit.cjs +62 -0
  71. package/plugins/claude-nativesoul/skills/life-explore/SKILL.md +19 -0
  72. package/plugins/claude-nativesoul/skills/life-heartbeat/SKILL.md +16 -0
  73. package/plugins/claude-nativesoul/skills/life-plan/SKILL.md +23 -0
  74. package/plugins/claude-nativesoul/skills/life-recall/SKILL.md +18 -0
  75. package/plugins/claude-nativesoul/skills/life-start/SKILL.md +13 -0
  76. package/plugins/codex-nativesoul/.codex-plugin/plugin.json +83 -0
  77. package/plugins/codex-nativesoul/.mcp.json +8 -0
  78. package/plugins/codex-nativesoul/hooks/loader.cjs +23 -0
  79. package/plugins/codex-nativesoul/hooks/memory-flush.cjs +45 -0
  80. package/plugins/codex-nativesoul/hooks/pre-tool-use.cjs +53 -0
  81. package/plugins/codex-nativesoul/hooks/session-start.cjs +119 -0
  82. package/plugins/codex-nativesoul/hooks/user-prompt-submit.cjs +62 -0
  83. package/plugins/codex-nativesoul/skills/life-explore/SKILL.md +24 -0
  84. package/plugins/codex-nativesoul/skills/life-heartbeat/SKILL.md +21 -0
  85. package/plugins/codex-nativesoul/skills/life-plan/SKILL.md +28 -0
  86. package/plugins/codex-nativesoul/skills/life-recall/SKILL.md +23 -0
  87. package/plugins/codex-nativesoul/skills/life-start/SKILL.md +18 -0
  88. package/plugins/gemini-nativesoul/GEMINI.md +17 -0
  89. package/plugins/gemini-nativesoul/commands/nativesoul-explore.toml +3 -0
  90. package/plugins/gemini-nativesoul/commands/nativesoul-heartbeat.toml +2 -0
  91. package/plugins/gemini-nativesoul/commands/nativesoul-plan.toml +3 -0
  92. package/plugins/gemini-nativesoul/commands/nativesoul-recall.toml +3 -0
  93. package/plugins/gemini-nativesoul/commands/nativesoul-start.toml +2 -0
  94. package/plugins/gemini-nativesoul/gemini-extension.json +16 -0
  95. package/plugins/gemini-nativesoul/hooks/hooks.json +59 -0
  96. package/plugins/grok-nativesoul/.mcp.json +8 -0
  97. package/plugins/grok-nativesoul/AGENTS.md +17 -0
  98. package/plugins/grok-nativesoul/commands/nativesoul-explore.md +22 -0
  99. package/plugins/grok-nativesoul/commands/nativesoul-heartbeat.md +9 -0
  100. package/plugins/grok-nativesoul/commands/nativesoul-plan.md +23 -0
  101. package/plugins/grok-nativesoul/commands/nativesoul-recall.md +16 -0
  102. package/plugins/grok-nativesoul/commands/nativesoul-start.md +9 -0
  103. package/plugins/grok-nativesoul/hooks/hooks.json +59 -0
  104. package/plugins/grok-nativesoul/nativesoul-package.json +22 -0
  105. package/plugins/grok-nativesoul/plugin.json +5 -0
  106. package/plugins/shared/hooks/host-hook.cjs +207 -0
  107. package/plugins/shared/hooks/lib.cjs +279 -0
  108. package/plugins/shared/hooks/policy-fail-closed.cjs +95 -0
  109. package/policy-packs/local-readonly.json +47 -0
  110. package/policy-packs/team-review.json +49 -0
  111. package/schemas/audit-event.schema.json +18 -0
  112. package/schemas/capability-card.schema.json +37 -0
  113. package/schemas/capability.schema.json +25 -0
  114. package/schemas/commitment.schema.json +19 -0
  115. package/schemas/full-native-evidence.schema.json +82 -0
  116. package/schemas/lease.schema.json +16 -0
  117. package/schemas/memory.schema.json +31 -0
  118. package/schemas/migration.schema.json +14 -0
  119. package/schemas/policy-pack.schema.json +96 -0
  120. package/schemas/schedule.schema.json +16 -0
  121. package/schemas/session.schema.json +16 -0
@@ -0,0 +1,20 @@
1
+ # ADR-001: Node-first runtime for MVP
2
+
3
+ ## Status
4
+
5
+ Accepted for MVP.
6
+
7
+ ## Context
8
+
9
+ The PRD leaves Q-002 open and recommends a single binary. The product owner compared this with OpenClaw and chose a Node-first implementation for speed and host ecosystem fit.
10
+
11
+ ## Decision
12
+
13
+ NativeSoul M0/M1 uses TypeScript on Node.js 22.17+ with npm-compatible distribution. Native binary packaging is a pre-beta decision, not an M1 blocker.
14
+
15
+ ## Consequences
16
+
17
+ - The MVP can ship quickly through `npm install -g nativesoul`.
18
+ - The core must avoid long-running daemons and hidden schedulers.
19
+ - CI must cover macOS, Linux, and Windows before beta.
20
+ - A future ADR must decide whether to keep a Node runtime requirement or bundle a platform binary.
@@ -0,0 +1,16 @@
1
+ # ADR-002: Canonical workspace and state
2
+
3
+ ## Status
4
+
5
+ Accepted for M0.
6
+
7
+ ## Decision
8
+
9
+ NativeSoul uses `~/.nativesoul` by default, overridable with `NATIVESOUL_HOME` or `--home`. Human-readable files are Markdown/YAML. Transactional state lives in SQLite under `state/nativesoul.sqlite`.
10
+
11
+ ## Rules
12
+
13
+ - Initialization is idempotent.
14
+ - Existing human files are never overwritten.
15
+ - Managed writes happen under the NativeSoul home only.
16
+ - `SOUL.md` and `POLICY.md` are proposal-only for automated changes.
@@ -0,0 +1,15 @@
1
+ # ADR-003: Schemas and adapter SDK v1
2
+
3
+ ## Status
4
+
5
+ Accepted for M0.
6
+
7
+ ## Decision
8
+
9
+ Public records use versioned JSON schemas in `schemas/`. Host adapters implement the v1 contract in `packages/adapter-sdk`.
10
+
11
+ ## Rules
12
+
13
+ - Unsupported host operations return a typed result, never fake success.
14
+ - Readiness keeps Installed, Enabled, Active, Authenticated, Healthy, Allowed, and Ready as separate states.
15
+ - Metadata from manifests, skills, plugins, MCPs, and connectors is untrusted input.
@@ -0,0 +1,15 @@
1
+ # ADR-004: Policy, leases, and heartbeat boundaries
2
+
3
+ ## Status
4
+
5
+ Accepted for M0.
6
+
7
+ ## Decision
8
+
9
+ M0 defines policy and lease contracts but does not install schedules. Heartbeat execution remains read-only by default until standing orders and scheduler adapters are implemented.
10
+
11
+ ## Rules
12
+
13
+ - External writes and destructive actions require approval unless covered by a standing order.
14
+ - Lease records use idempotency keys to prevent duplicate work.
15
+ - Grok and Gemini standalone get no hidden cron fallback.
@@ -0,0 +1,16 @@
1
+ # ADR-005: Privacy, export/delete, and supply-chain
2
+
3
+ ## Status
4
+
5
+ Accepted for M0.
6
+
7
+ ## Decision
8
+
9
+ NativeSoul stores no secrets in memory, audit, registry, fixtures, or exports. Telemetry is off by default. Releases require signed artifacts, checksum/provenance, and rollback before beta.
10
+
11
+ ## Rules
12
+
13
+ - Redaction runs before persistence.
14
+ - Export/delete must be local and auditable.
15
+ - Installers must backup before managed writes.
16
+ - Beta release requires a packaging ADR and release checklist.
@@ -0,0 +1,21 @@
1
+ # ADR-006: Adapter preview before install
2
+
3
+ ## Status
4
+
5
+ Accepted for M2.1.
6
+
7
+ ## Context
8
+
9
+ The PRD requires native-first adapters but also requires reversible installation, backups, diff, and no credential copying. The first adapter slice should therefore inspect and diagnose before mutating host configuration.
10
+
11
+ ## Decision
12
+
13
+ Codex and Claude adapters start with read-only `detect`, `coldScan`, `doctor`, and managed-block preview. `install`, `uninstall`, `reload`, `update`, and `scheduleReconcile` return typed unsupported results until dedicated stories implement safe writes.
14
+
15
+ Each adapter package keeps `adapter.config.md` with the official host documentation link as the primary reference index (see Story 2.1).
16
+
17
+ ## Consequences
18
+
19
+ - M2 starts without touching `~/.codex/AGENTS.md`, `~/.claude/CLAUDE.md`, plugins, MCP configs, or schedules.
20
+ - CLI users can inspect what would be installed before any write path exists.
21
+ - Adapter readiness remains honest: preview support is not the same as Ready native integration.
@@ -0,0 +1,16 @@
1
+ # ADR-007: Managed-block backup and rollback
2
+
3
+ ## Status
4
+
5
+ Accepted for M2.2.
6
+
7
+ ## Decision
8
+
9
+ Managed-block installation is dry-run by default. Writes require `--apply`, create a local backup snapshot under the NativeSoul home, and are idempotent. Rollback also requires `--apply`.
10
+
11
+ ## Rules
12
+
13
+ - Only the selected host instruction target may be written.
14
+ - Backups preserve the complete previous file content locally with restrictive file permissions.
15
+ - A missing target is represented in the snapshot and is removed again on rollback.
16
+ - No scheduler, plugin install, MCP registration, credential probing, or external write is part of this story.
@@ -0,0 +1,16 @@
1
+ # ADR-008: MCP registration manifest before write
2
+
3
+ ## Status
4
+
5
+ Accepted for M2.3.
6
+
7
+ ## Decision
8
+
9
+ NativeSoul exposes MCP registration manifests and snippets before any automatic host MCP registration. The manifest is deterministic, local-first, and secret-free. Host config mutation remains a future reversible install story.
10
+
11
+ ## Rules
12
+
13
+ - `nativesoul-mcp` is the package-mode command.
14
+ - Local development mode may point to `node dist/packages/mcp-server/src/index.js`.
15
+ - Snippets are review artifacts and must not claim active registration.
16
+ - No host config files are modified in this story.
@@ -0,0 +1,16 @@
1
+ # ADR-009: Local capability registry
2
+
3
+ ## Status
4
+
5
+ Accepted for M2.4.
6
+
7
+ ## Decision
8
+
9
+ Adapter scan results are persisted locally in SQLite as capability records. Readiness states remain separate and `Ready` is never inferred from mere discovery.
10
+
11
+ ## Rules
12
+
13
+ - Registry values are sanitized metadata, not executable instructions.
14
+ - No credentials, tokens, OAuth material, or tool arguments are stored.
15
+ - `capabilities refresh` may write local registry state but does not execute native capabilities.
16
+ - Bootstrap injects only ready capabilities.
@@ -0,0 +1,15 @@
1
+ # ADR-010: MCP capability tools are read-only
2
+
3
+ ## Status
4
+
5
+ Accepted for M2.5.
6
+
7
+ ## Decision
8
+
9
+ MCP capability tools read the local capability registry only. They do not run adapter refresh, execute native tools, probe authentication, or write host configuration.
10
+
11
+ ## Rules
12
+
13
+ - `life_capability_search` returns persisted records filtered by query/host/readiness.
14
+ - `life_capability_status` returns one persisted record by UID or an explicit not-found error.
15
+ - `Ready` remains a stored readiness state, not a derived shortcut.
@@ -0,0 +1,16 @@
1
+ # ADR-011: Local audit CLI list and export
2
+
3
+ ## Status
4
+
5
+ Accepted for M1.
6
+
7
+ ## Decision
8
+
9
+ NativeSoul exposes local audit inspection through the CLI before any UI. Audit list/export read persisted SQLite audit events and export to stdout; no daemon, cloud sync, host probing, or host configuration writes are involved.
10
+
11
+ ## Rules
12
+
13
+ - `audit list` returns persisted audit events in newest-first order with type/result/limit filters.
14
+ - `audit export --format json|jsonl` writes audit events to stdout.
15
+ - Export is auditable by appending an `audit_exported` event after the selected export set is read.
16
+ - Audit payloads must already be redacted before persistence; export does not reintroduce secrets.
@@ -0,0 +1,16 @@
1
+ # ADR-012: npm package runtime scope
2
+
3
+ ## Status
4
+
5
+ Accepted for M1.
6
+
7
+ ## Decision
8
+
9
+ The MVP package ships only the compiled runtime, public schemas, and install documentation needed to run the Node-first CLI and MCP stdio server. Source-tree agent framework folders, local IDE integrations, tests, fixtures, and development configuration are excluded from the npm tarball.
10
+
11
+ ## Rules
12
+
13
+ - Runtime package contents are controlled with `package.json` `files`.
14
+ - The package must not include `.aiox-core`, `.codex`, `.claude`, `.gemini`, `.github`, `.antigravity`, `.env*`, tests, or TypeScript source files.
15
+ - Runtime dependencies must be required by shipped code; unused framework dependencies stay out of `dependencies`.
16
+ - Local install smoke must install the tarball into an isolated npm prefix and run installed binaries.
@@ -0,0 +1,16 @@
1
+ # ADR-013: Core domain ledger v1
2
+
3
+ ## Status
4
+
5
+ Accepted for M1.
6
+
7
+ ## Decision
8
+
9
+ NativeSoul will create the PRD P0 domain ledger tables in SQLite before implementing higher-level lifecycle behavior. The ledger is transactional, local-first, and inert until specific services start writing domain records.
10
+
11
+ ## Rules
12
+
13
+ - Migration v3 owns `hosts`, `sessions`, `memory_edges`, `commitments`, `standing_orders`, `capability_sources`, `capability_experience`, `schedules`, `leases`, and `runs`.
14
+ - Structured fields are stored as JSON text and must remain redacted before persistence.
15
+ - Creating the ledger must not start a scheduler, mutate host configuration, call models, or change human Markdown files.
16
+ - `status --json` reports zero-safe counts so follow-up stories can verify adoption incrementally.
@@ -0,0 +1,16 @@
1
+ # ADR-014: Memory lifecycle v1
2
+
3
+ ## Status
4
+
5
+ Accepted for M1.
6
+
7
+ ## Decision
8
+
9
+ NativeSoul memory lifecycle starts with explicit local states: `candidate`, `active`, `rejected`, and `forgotten`. The CLI can propose, promote, reject, forget, and export memories while preserving redaction and auditability.
10
+
11
+ ## Rules
12
+
13
+ - Candidate memories are persisted and audited but are not returned by active recall.
14
+ - Promotion changes status to `active`; rejection changes status to `rejected`; forgetting changes status to `forgotten`.
15
+ - Export returns non-forgotten memories by default and records a redacted `memory_exported` audit event.
16
+ - Existing `memory add` remains a direct active write for compatibility until policy-based promotion replaces it.
@@ -0,0 +1,16 @@
1
+ # ADR-015: Policy and standing orders v1
2
+
3
+ ## Status
4
+
5
+ Accepted for M1.
6
+
7
+ ## Decision
8
+
9
+ NativeSoul provides a deterministic local policy evaluator before implementing autonomous action execution. Standing orders can adjust decisions for named actions, while identity and policy changes remain proposal-only.
10
+
11
+ ## Rules
12
+
13
+ - Policy evaluation is local, auditable, and side-effect free except for explicit proposal creation.
14
+ - `SOUL.md` and `POLICY.md` are never autoedited by NativeSoul.
15
+ - Destructive actions remain denied in M1 even if a standing order names them.
16
+ - External writes require approval unless a standing order explicitly allows the named action.
@@ -0,0 +1,16 @@
1
+ # ADR-016: Heartbeat lease idempotency v1
2
+
3
+ ## Status
4
+
5
+ Accepted for M1.
6
+
7
+ ## Decision
8
+
9
+ NativeSoul implements local heartbeat claim and completion primitives before installing or reconciling any native scheduler. A heartbeat slot is keyed by project and slot, so concurrent hosts cannot execute the same useful heartbeat twice.
10
+
11
+ ## Rules
12
+
13
+ - The core may claim and complete local leases, but must not install schedules, cron jobs, daemons, or host automations in M1.
14
+ - The idempotency key is derived from `heartbeat:<project>:<slot>`, independent of host.
15
+ - A duplicate claim for an active or completed slot returns `HEARTBEAT_OK` and does not create a new lease.
16
+ - `life_heartbeat_claim` and `life_heartbeat_complete` are local-write MCP tools only; they do not perform external writes.
@@ -0,0 +1,17 @@
1
+ # ADR-017: Reversible MCP registration install
2
+
3
+ ## Status
4
+
5
+ Accepted for M2.
6
+
7
+ ## Decision
8
+
9
+ NativeSoul may write an MCP registration entry only through an explicit, reversible install command. The operation is dry-run by default, creates a backup snapshot before applying, preserves unrelated config keys, and can roll back from the snapshot.
10
+
11
+ ## Rules
12
+
13
+ - `nativesoul mcp install` is dry-run by default.
14
+ - `--apply` writes only the selected MCP registration target.
15
+ - Tests and package smoke use `--target` paths outside real host configs.
16
+ - The install writes an `mcpServers.nativesoul` entry using package mode by default.
17
+ - No scheduler, plugin, host reload, daemon, credential probe, or external network call is part of this story.
@@ -0,0 +1,17 @@
1
+ # ADR-018: Schedule reconcile guardrails v1
2
+
3
+ ## Status
4
+
5
+ Accepted for M2.
6
+
7
+ ## Decision
8
+
9
+ NativeSoul exposes schedule reconciliation commands before implementing native scheduler creation. The command records desired local state and adapter capability status, but never installs cron, daemons, or undocumented scheduler fallbacks.
10
+
11
+ ## Rules
12
+
13
+ - `schedule reconcile` is dry-run by default.
14
+ - `--apply` may persist desired state in SQLite.
15
+ - Unsupported native scheduler status is explicit and auditable.
16
+ - `native_id` remains `null` until an adapter creates or verifies an official native schedule.
17
+ - Grok/Gemini-style hidden cron fallback remains forbidden.
@@ -0,0 +1,17 @@
1
+ # ADR-019: Commitments lifecycle v1
2
+
3
+ ## Status
4
+
5
+ Accepted for M1.
6
+
7
+ ## Decision
8
+
9
+ NativeSoul stores lightweight commitments as local follow-ups with project scope, TTL, deduplication, and explicit completion or dismissal. Commitments are not schedules and do not create native scheduler state.
10
+
11
+ ## Rules
12
+
13
+ - Commitments are local SQLite records with `project_id`, `summary`, `status`, optional `due_at`, and optional `ttl_expires_at`.
14
+ - Creating a duplicate open commitment for the same project and normalized summary returns the existing record.
15
+ - Expired commitments transition to `expired` during list/status operations.
16
+ - Commitment summaries and sources are redacted before persistence and audit.
17
+ - MCP commitment tools are local-write only and do not perform external actions.
@@ -0,0 +1,16 @@
1
+ # ADR-020: MCP memory lifecycle tools
2
+
3
+ ## Status
4
+
5
+ Accepted for M2.
6
+
7
+ ## Decision
8
+
9
+ NativeSoul exposes memory proposal and promotion through MCP using the same local core services as the CLI. MCP memory writes remain local-only, redacted before persistence, project-scoped, and audited.
10
+
11
+ ## Rules
12
+
13
+ - `life_remember_propose` creates a candidate memory, never an active memory.
14
+ - `life_memory_promote` promotes an existing candidate by id.
15
+ - Tools support direct JSON-RPC and `tools/call`.
16
+ - No external write, scheduler, host reload, or model call is performed.
@@ -0,0 +1,17 @@
1
+ # ADR-021: Unified install orchestrator v1
2
+
3
+ ## Status
4
+
5
+ Accepted for M2.
6
+
7
+ ## Decision
8
+
9
+ NativeSoul provides a CLI-first install orchestrator that composes existing reversible local operations: workspace init, adapter managed blocks, MCP registration, capability refresh, and schedule desired-state reconciliation. The installer is dry-run by default.
10
+
11
+ ## Rules
12
+
13
+ - `nativesoul install` is dry-run by default and requires `--apply` to write managed host files.
14
+ - The installer only uses existing reversible operations with snapshots.
15
+ - Tests and package smoke use `--target-root` to avoid real host config paths.
16
+ - Schedule reconciliation may persist unsupported desired state, but never creates hidden cron, daemons, or host automations.
17
+ - The installer reports degraded status when any host capability remains unsupported or not ready.
@@ -0,0 +1,20 @@
1
+ # ADR-022: Unified uninstall orchestrator v1
2
+
3
+ ## Status
4
+
5
+ Accepted for M2.
6
+
7
+ ## Decision
8
+
9
+ NativeSoul provides a CLI-first uninstall orchestrator that removes only the local integration artifacts written by the current installer: adapter managed blocks and `mcpServers.nativesoul` registrations. The uninstaller is dry-run by default and preserves the NativeSoul home/data directory unless an explicit purge flag and confirmation token are supplied.
10
+
11
+ ## Rules
12
+
13
+ - `nativesoul uninstall` is dry-run by default and requires `--apply` to write host files.
14
+ - Uninstall removes only NativeSoul managed markers and MCP registration entries.
15
+ - Unrelated host instructions, host config keys, and non-NativeSoul MCP servers must be preserved.
16
+ - Apply operations create backup snapshots before modifying managed host files.
17
+ - Re-running apply must be idempotent and report `noop` actions when NativeSoul artifacts are already absent.
18
+ - NativeSoul home/data is preserved by default.
19
+ - Data purge requires both `--purge-data` and `--confirm-purge-nativesoul-data DELETE_NATIVESOUL_HOME`.
20
+ - No host reload, plugin removal, native scheduler teardown, daemon stop, credential deletion, or external network call is performed.
@@ -0,0 +1,18 @@
1
+ # ADR-023: Deep doctor install readiness v1
2
+
3
+ ## Status
4
+
5
+ Accepted for M2.
6
+
7
+ ## Decision
8
+
9
+ NativeSoul provides a CLI-first deep doctor that aggregates local workspace health, managed-block presence, MCP registration health, persisted schedule state, persisted capability counts, and native adapter diagnostics when inspecting real host paths.
10
+
11
+ ## Rules
12
+
13
+ - `nativesoul doctor --deep` performs read-only diagnostics against host integration files and NativeSoul state.
14
+ - `--target-root` switches host file checks to temporary Codex/Claude paths and avoids treating native adapter detection as authoritative.
15
+ - Deep doctor never installs, uninstalls, reloads hosts, creates native schedules, probes credentials, starts daemons, or performs network calls.
16
+ - Invalid MCP JSON is reported as an error and makes the deep doctor unhealthy.
17
+ - Missing managed blocks or MCP registrations are warnings, not writes.
18
+ - Persisted schedules are reported as desired local state only; native scheduler teardown/provisioning remains out of scope.
@@ -0,0 +1,18 @@
1
+ # ADR-024: Capability learn cards v1
2
+
3
+ ## Status
4
+
5
+ Accepted for M2.
6
+
7
+ ## Decision
8
+
9
+ NativeSoul provides a local `capabilities learn` step that transforms already-persisted capability registry records into sanitized capability cards. The learn step is metadata-only: it does not execute native capabilities, probe credentials, reload hosts, or call external services.
10
+
11
+ ## Rules
12
+
13
+ - `capabilities learn` reads the local capability registry and writes JSON cards under `capabilities/cards/`.
14
+ - Cards include `use_when`, `requires`, `side_effects`, `approval`, short examples, readiness, source, and schema hash.
15
+ - Card IDs and filenames are deterministic from capability UID.
16
+ - Card content is redacted before persistence and must not contain secrets.
17
+ - Re-running learn is idempotent for unchanged records.
18
+ - Missing capability registry records is a degraded/no-op state, not a fabricated success.
@@ -0,0 +1,18 @@
1
+ # ADR-025: Bootstrap capability card recall v1
2
+
3
+ ## Status
4
+
5
+ Accepted for M2.
6
+
7
+ ## Decision
8
+
9
+ NativeSoul bootstrap payloads include a bounded local recall of previously learned capability cards. Recall reads sanitized card JSON files from `capabilities/cards/`, ranks them locally by current host and query text, and injects only compact guidance into the bootstrap payload.
10
+
11
+ ## Rules
12
+
13
+ - Bootstrap recall reads local card files only; it does not execute native capabilities, probe credentials, refresh adapters, reload hosts, create schedules, or call external services.
14
+ - Recall returns at most 8 cards and defaults to 5 cards.
15
+ - Cards for the current host are preferred, while cards from other hosts may appear only as alternatives.
16
+ - Missing or malformed card files are skipped and reported as bootstrap warnings.
17
+ - Bootstrap keeps the existing ready capability list separate from recalled cards; a recalled card is guidance, not proof that a capability is ready.
18
+ - Recalled card fields must remain redacted and compact enough to fit the bootstrap context budget.
@@ -0,0 +1,18 @@
1
+ # ADR-026: Managed block bootstrap handshake v1
2
+
3
+ ## Status
4
+
5
+ Accepted for M2.
6
+
7
+ ## Decision
8
+
9
+ Managed blocks installed into host instruction files explicitly describe the NativeSoul bootstrap handshake. They tell the host to call the local MCP `life_bootstrap` tool at the start of a new session when available, and provide a CLI fallback for degraded environments.
10
+
11
+ ## Rules
12
+
13
+ - Managed blocks remain small, reversible, and bounded by NativeSoul markers.
14
+ - The handshake is advisory host instruction content; it does not guarantee that a host executed the tool.
15
+ - The preferred path is MCP `life_bootstrap` with the current host and working directory.
16
+ - The fallback path is `nativesoul bootstrap --host <host> --cwd <current-working-directory> --json`.
17
+ - The block must state that `capability_cards` are advisory and `capabilities` remains the ready-only list.
18
+ - The block must preserve the existing policy guardrails for credentials and protected human files.
@@ -0,0 +1,17 @@
1
+ # ADR-027: Local release manifest and checksum v1
2
+
3
+ ## Status
4
+
5
+ Accepted for M2.
6
+
7
+ ## Decision
8
+
9
+ Local package builds produce a machine-readable release manifest and SHA-256 checksum next to the generated npm tarball. The manifest is local-only provenance for install testing; it does not claim public signing, registry publication, or external attestation.
10
+
11
+ ## Rules
12
+
13
+ - `npm run package:local` writes the tarball, `<tarball>.sha256`, and `<tarball>.manifest.json` under `.artifacts/package/`.
14
+ - The checksum file uses the standard `sha256 filename` format so operators can verify it with common tooling.
15
+ - The manifest includes package name, version, tarball filename, byte size, SHA-256, Node/npm versions, package privacy status, generated timestamp, and local install/test commands.
16
+ - Manifest generation never includes secrets, environment dumps, local home paths, source-tree private folders, or network calls.
17
+ - Public release signing, registry publication, and SLSA/provenance attestations remain separate pre-beta work.
@@ -0,0 +1,47 @@
1
+ # ADR-028: OpenClaw-inspired workspace templates v1
2
+
3
+ ## Status
4
+
5
+ Accepted for M1.
6
+
7
+ ## Context
8
+
9
+ NativeSoul already adopted OpenClaw workspace separation in the PRD (SOUL, IDENTITY, USER, AGENTS, MEMORY, HEARTBEAT), but `nativesoul init` seeded only minimal one-line stubs. OpenClaw documents richer templates, onboarding ritual, daily memory notes, and standing-order patterns.
10
+
11
+ ## Decision
12
+
13
+ Adopt OpenClaw workspace **patterns and template structure**, adapted for NativeSoul's cross-host coding-agent model:
14
+
15
+ - Rich human-file templates in `packages/core/src/workspace-templates.ts`
16
+ - Daily note seed at `memory/daily/YYYY-MM-DD.md`
17
+ - Example standing order at `standing-orders/example.yaml`
18
+ - Bootstrap payload includes parsed identity fields, `soul_summary`, bootstrap/daily-memory warnings
19
+ - `SOUL.md` and `POLICY.md` remain protected (proposal-only)
20
+
21
+ ## Adopted from OpenClaw
22
+
23
+ | Pattern | NativeSoul application |
24
+ | --- | --- |
25
+ | SOUL / IDENTITY / USER split | Same files; OpenClaw-style templates |
26
+ | AGENTS operating instructions | CLI-first + MCP handshake + execute-verify-report |
27
+ | MEMORY.md + daily notes | Curated vs working layer documented; SQLite stays searchable source |
28
+ | HEARTBEAT.md empty-by-default | Skip work until tasks are added |
29
+ | BOOTSTRAP.md first-run ritual | Host install flow; no gateway/channel setup |
30
+ | Standing orders YAML | `standing-orders/example.yaml` scaffold |
31
+
32
+ ## Explicitly not adopted (MVP)
33
+
34
+ - Gateway, channels, BOOT.md restart checklist
35
+ - Session transcript storage under workspace
36
+ - Semantic memory_search / dreaming / DREAMS.md (P1)
37
+ - Auto-injection of full files into every host turn (NativeSoul uses compact bootstrap budget)
38
+
39
+ ## References
40
+
41
+ - https://docs.openclaw.ai/concepts/agent-workspace
42
+ - https://docs.openclaw.ai/reference/templates/SOUL
43
+ - https://docs.openclaw.ai/reference/templates/IDENTITY
44
+ - https://docs.openclaw.ai/reference/templates/USER
45
+ - https://docs.openclaw.ai/reference/templates/BOOTSTRAP
46
+ - https://docs.openclaw.ai/concepts/memory
47
+ - https://docs.openclaw.ai/gateway/heartbeat
@@ -0,0 +1,98 @@
1
+ # ADR-029: Host-guided onboarding v1
2
+
3
+ ## Status
4
+
5
+ Proposed — Epic 4
6
+
7
+ ## Context
8
+
9
+ Stories 1.8 and 3.1–3.8 deliver workspace templates and install orchestration, but personalization still depends on manual file editing. The product decision locks **host-first UX**: the user pastes a prompt in Claude Code or Codex; the LLM installs NativeSoul and conducts onboarding. Templates are fallbacks; **AI-generated prose** from a 5-question interview is the primary path.
10
+
11
+ ## Decision
12
+
13
+ ### Option B — MCP tools + CLI mirror (selected)
14
+
15
+ | Surface | Commands / tools |
16
+ |---------|------------------|
17
+ | MCP | `life_onboarding_status`, `life_onboard_apply`, `life_onboard_complete` |
18
+ | CLI | `nativesoul onboard status`, `onboard apply`, `onboard complete` |
19
+
20
+ Install does **not** get a dedicated MCP tool. Install uses the published prompt artifact (`docs/prompts/install-nativesoul-v1.md`) that instructs the host to run deterministic shell commands.
21
+
22
+ ### Onboarding status
23
+
24
+ `life_onboarding_status` returns:
25
+
26
+ - `ritual_pending: boolean` (derived from `BOOTSTRAP.md` presence + bootstrap warnings)
27
+ - `files_present: { soul, identity, user, agents, bootstrap }`
28
+ - `protected_targets: ["SOUL.md", "POLICY.md"]`
29
+ - `interview_themes: ["entity", "soul", "human", "collaboration", "continuity"]`
30
+
31
+ ### Apply (dry-run default)
32
+
33
+ `life_onboard_apply` accepts:
34
+
35
+ ```json
36
+ {
37
+ "dry_run": true,
38
+ "user_confirmed": false,
39
+ "files": {
40
+ "IDENTITY.md": "...",
41
+ "SOUL.md": "...",
42
+ "USER.md": "...",
43
+ "AGENTS.md": "..."
44
+ },
45
+ "config_patch": { "hosts": ["codex", "claude"] }
46
+ }
47
+ ```
48
+
49
+ Rules:
50
+
51
+ - Default `dry_run: true` — no writes until host passes `dry_run: false` **and** `user_confirmed: true`
52
+ - `SOUL.md` writes require `user_confirmed: true` even in apply mode
53
+ - `POLICY.md` rejected — proposal flow only
54
+ - Existing user content outside managed sections is preserved (merge for `AGENTS.md`)
55
+ - Response includes per-file action (`create` | `update` | `noop`), `before_hash`, `after_hash`, warnings
56
+
57
+ ### Complete
58
+
59
+ `life_onboard_complete`:
60
+
61
+ - Archives or removes `BOOTSTRAP.md` (configurable `archive: true` default)
62
+ - Writes audit event `onboarding.completed`
63
+ - Idempotent — second call returns `already_complete: true`
64
+
65
+ ### Install prompt (no MCP) — unified with onboarding ask
66
+
67
+ `docs/prompts/install-nativesoul-v1.md` is the **single** canonical host prompt. The host:
68
+
69
+ 1. Clones or uses local `npm run package:local` tarball
70
+ 2. Verifies SHA-256
71
+ 3. Runs `nativesoul init` + `install --target-root` dry-run first
72
+ 4. Presents diff; applies only after user approval
73
+ 5. Asks via host question UI (e.g. AskUserQuestion): start onboarding now?
74
+ 6. If yes → continues Phase 2 in the **same session** (5 questions → `life_onboard_*`)
75
+
76
+ Standalone `onboard-nativesoul-v1.md` is for skip/re-run only.
77
+
78
+ ## Alternatives considered
79
+
80
+ | Option | Rejected because |
81
+ |--------|------------------|
82
+ | A — CLI wizard only | Violates host-first product decision |
83
+ | C — Full-file template slot-fill | User wants AI-generated prose, not `{name}` substitution |
84
+ | D — Install MCP tool | Install is shell-heavy; prompt + CLI is simpler and auditable |
85
+
86
+ ## Security
87
+
88
+ - Never accept credentials in onboard apply payloads
89
+ - Redact home paths from dry-run responses shown to model
90
+ - Treat file content as untrusted data — validate size limits (64 KiB per file v1)
91
+ - `SOUL.md` bypass attempts without `user_confirmed` return `POLICY_VIOLATION`
92
+
93
+ ## References
94
+
95
+ - `docs/prd/onboarding-interview-v1.md`
96
+ - `docs/adr/ADR-028-openclaw-workspace-templates-v1.md`
97
+ - `docs/prompts/onboard-nativesoul-v1.md`
98
+ - `docs/prompts/install-nativesoul-v1.md`