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.
- package/CHANGELOG.md +43 -0
- package/LICENSE +19 -0
- package/README.md +384 -0
- package/dist/packages/cli/src/index.js +1066 -0
- package/dist/packages/core/src/secret-patterns.json +25 -0
- package/dist/packages/mcp-server/src/index.js +782 -0
- package/docs/adr/ADR-001-node-first-runtime.md +20 -0
- package/docs/adr/ADR-002-workspace-and-state.md +16 -0
- package/docs/adr/ADR-003-schemas-and-adapter-sdk.md +15 -0
- package/docs/adr/ADR-004-policy-leases-and-heartbeat.md +15 -0
- package/docs/adr/ADR-005-privacy-export-delete-and-supply-chain.md +16 -0
- package/docs/adr/ADR-006-adapter-preview-before-install.md +21 -0
- package/docs/adr/ADR-007-managed-block-backup-and-rollback.md +16 -0
- package/docs/adr/ADR-008-mcp-registration-manifest-before-write.md +16 -0
- package/docs/adr/ADR-009-local-capability-registry.md +16 -0
- package/docs/adr/ADR-010-mcp-capability-tools-read-only.md +15 -0
- package/docs/adr/ADR-011-local-audit-cli-export.md +16 -0
- package/docs/adr/ADR-012-npm-package-runtime-scope.md +16 -0
- package/docs/adr/ADR-013-core-domain-ledger-v1.md +16 -0
- package/docs/adr/ADR-014-memory-lifecycle-v1.md +16 -0
- package/docs/adr/ADR-015-policy-standing-orders-v1.md +16 -0
- package/docs/adr/ADR-016-heartbeat-lease-idempotency-v1.md +16 -0
- package/docs/adr/ADR-017-reversible-mcp-registration-install.md +17 -0
- package/docs/adr/ADR-018-schedule-reconcile-guardrails-v1.md +17 -0
- package/docs/adr/ADR-019-commitments-lifecycle-v1.md +17 -0
- package/docs/adr/ADR-020-mcp-memory-lifecycle-tools.md +16 -0
- package/docs/adr/ADR-021-unified-install-orchestrator-v1.md +17 -0
- package/docs/adr/ADR-022-unified-uninstall-orchestrator-v1.md +20 -0
- package/docs/adr/ADR-023-deep-doctor-install-readiness-v1.md +18 -0
- package/docs/adr/ADR-024-capability-learn-cards-v1.md +18 -0
- package/docs/adr/ADR-025-bootstrap-capability-card-recall-v1.md +18 -0
- package/docs/adr/ADR-026-managed-block-bootstrap-handshake-v1.md +18 -0
- package/docs/adr/ADR-027-local-release-manifest-checksum-v1.md +17 -0
- package/docs/adr/ADR-028-openclaw-workspace-templates-v1.md +47 -0
- package/docs/adr/ADR-029-host-guided-onboarding-v1.md +98 -0
- package/docs/adr/ADR-030-host-surface-matrix-v1.md +93 -0
- package/docs/adr/ADR-031-host-parity-matrix-v2.md +91 -0
- package/docs/adr/ADR-032-nativesoul-hard-cut-rebrand.md +54 -0
- package/docs/adr/ADR-033-local-hybrid-memory-reflection.md +49 -0
- package/docs/adr/ADR-034-memory-importers-provenance.md +38 -0
- package/docs/adr/ADR-035-policy-pack-apply-rollback.md +34 -0
- package/docs/adr/ADR-036-local-operator-dashboard-readonly.md +38 -0
- package/docs/adr/ADR-037-full-native-evidence-contract.md +45 -0
- package/docs/adr/ADR-038-identity-vs-activation-onboarding.md +39 -0
- package/docs/adr/ADR-039-entitlements-offline-licensing.md +47 -0
- package/docs/adr/ADR-040-proprietary-free-to-install-distribution.md +52 -0
- package/docs/adr/ADR-041-project-identity-and-lightweight-registry.md +35 -0
- package/docs/adr/ADR-042-control-plane-direction-and-deferral.md +80 -0
- package/docs/adr/ADR-043-versioning-and-release-policy.md +60 -0
- package/docs/adr/ADR-044-pro-awareness-and-upgrade-nudge-policy.md +53 -0
- package/docs/adr/ADR-045-paid-only-closed-distribution.md +55 -0
- package/docs/legal/EULA.md +70 -0
- package/llm-install.txt +222 -0
- package/package.json +61 -0
- package/plugins/antigravity-nativesoul/GEMINI.md +17 -0
- package/plugins/antigravity-nativesoul/commands/nativesoul-explore.md +22 -0
- package/plugins/antigravity-nativesoul/commands/nativesoul-heartbeat.md +9 -0
- package/plugins/antigravity-nativesoul/commands/nativesoul-plan.md +23 -0
- package/plugins/antigravity-nativesoul/commands/nativesoul-recall.md +16 -0
- package/plugins/antigravity-nativesoul/commands/nativesoul-start.md +9 -0
- package/plugins/antigravity-nativesoul/hooks.json +59 -0
- package/plugins/antigravity-nativesoul/mcp_config.json +8 -0
- package/plugins/antigravity-nativesoul/nativesoul-package.json +22 -0
- package/plugins/antigravity-nativesoul/plugin.json +5 -0
- package/plugins/claude-nativesoul/.claude-plugin/plugin.json +90 -0
- package/plugins/claude-nativesoul/hooks/loader.cjs +23 -0
- package/plugins/claude-nativesoul/hooks/memory-flush.cjs +45 -0
- package/plugins/claude-nativesoul/hooks/pre-tool-use.cjs +53 -0
- package/plugins/claude-nativesoul/hooks/session-start.cjs +108 -0
- package/plugins/claude-nativesoul/hooks/user-prompt-submit.cjs +62 -0
- package/plugins/claude-nativesoul/skills/life-explore/SKILL.md +19 -0
- package/plugins/claude-nativesoul/skills/life-heartbeat/SKILL.md +16 -0
- package/plugins/claude-nativesoul/skills/life-plan/SKILL.md +23 -0
- package/plugins/claude-nativesoul/skills/life-recall/SKILL.md +18 -0
- package/plugins/claude-nativesoul/skills/life-start/SKILL.md +13 -0
- package/plugins/codex-nativesoul/.codex-plugin/plugin.json +83 -0
- package/plugins/codex-nativesoul/.mcp.json +8 -0
- package/plugins/codex-nativesoul/hooks/loader.cjs +23 -0
- package/plugins/codex-nativesoul/hooks/memory-flush.cjs +45 -0
- package/plugins/codex-nativesoul/hooks/pre-tool-use.cjs +53 -0
- package/plugins/codex-nativesoul/hooks/session-start.cjs +119 -0
- package/plugins/codex-nativesoul/hooks/user-prompt-submit.cjs +62 -0
- package/plugins/codex-nativesoul/skills/life-explore/SKILL.md +24 -0
- package/plugins/codex-nativesoul/skills/life-heartbeat/SKILL.md +21 -0
- package/plugins/codex-nativesoul/skills/life-plan/SKILL.md +28 -0
- package/plugins/codex-nativesoul/skills/life-recall/SKILL.md +23 -0
- package/plugins/codex-nativesoul/skills/life-start/SKILL.md +18 -0
- package/plugins/gemini-nativesoul/GEMINI.md +17 -0
- package/plugins/gemini-nativesoul/commands/nativesoul-explore.toml +3 -0
- package/plugins/gemini-nativesoul/commands/nativesoul-heartbeat.toml +2 -0
- package/plugins/gemini-nativesoul/commands/nativesoul-plan.toml +3 -0
- package/plugins/gemini-nativesoul/commands/nativesoul-recall.toml +3 -0
- package/plugins/gemini-nativesoul/commands/nativesoul-start.toml +2 -0
- package/plugins/gemini-nativesoul/gemini-extension.json +16 -0
- package/plugins/gemini-nativesoul/hooks/hooks.json +59 -0
- package/plugins/grok-nativesoul/.mcp.json +8 -0
- package/plugins/grok-nativesoul/AGENTS.md +17 -0
- package/plugins/grok-nativesoul/commands/nativesoul-explore.md +22 -0
- package/plugins/grok-nativesoul/commands/nativesoul-heartbeat.md +9 -0
- package/plugins/grok-nativesoul/commands/nativesoul-plan.md +23 -0
- package/plugins/grok-nativesoul/commands/nativesoul-recall.md +16 -0
- package/plugins/grok-nativesoul/commands/nativesoul-start.md +9 -0
- package/plugins/grok-nativesoul/hooks/hooks.json +59 -0
- package/plugins/grok-nativesoul/nativesoul-package.json +22 -0
- package/plugins/grok-nativesoul/plugin.json +5 -0
- package/plugins/shared/hooks/host-hook.cjs +207 -0
- package/plugins/shared/hooks/lib.cjs +279 -0
- package/plugins/shared/hooks/policy-fail-closed.cjs +95 -0
- package/policy-packs/local-readonly.json +47 -0
- package/policy-packs/team-review.json +49 -0
- package/schemas/audit-event.schema.json +18 -0
- package/schemas/capability-card.schema.json +37 -0
- package/schemas/capability.schema.json +25 -0
- package/schemas/commitment.schema.json +19 -0
- package/schemas/full-native-evidence.schema.json +82 -0
- package/schemas/lease.schema.json +16 -0
- package/schemas/memory.schema.json +31 -0
- package/schemas/migration.schema.json +14 -0
- package/schemas/policy-pack.schema.json +96 -0
- package/schemas/schedule.schema.json +16 -0
- package/schemas/session.schema.json +16 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# ADR-030: Host surface matrix v1
|
|
2
|
+
|
|
3
|
+
## Status
|
|
4
|
+
|
|
5
|
+
Accepted — Story 6.1. Provider parity details are superseded by ADR-031.
|
|
6
|
+
|
|
7
|
+
## Context
|
|
8
|
+
|
|
9
|
+
NativeSoul `install --all-hosts` registers MCP and managed blocks using single paths per host id (`~/.claude/mcp.json`, `~/.codex/mcp.json`). Real validation (2026-06-23) showed Claude Code, Claude Desktop, and Codex App read **different configuration surfaces**.
|
|
10
|
+
|
|
11
|
+
Epic 6 requires a canonical matrix before further install or plugin work.
|
|
12
|
+
|
|
13
|
+
## Decision
|
|
14
|
+
|
|
15
|
+
Each **host id** maps to one or more **surfaces** (install targets). Install orchestrator writes to every surface for that host on the current OS.
|
|
16
|
+
|
|
17
|
+
| Host id | Surface | Managed block target | MCP config target | Plugin / package target | OS notes |
|
|
18
|
+
|---------|---------|----------------------|-------------------|-------------------------|----------|
|
|
19
|
+
| `claude` | Claude Code CLI | `~/.claude/CLAUDE.md` | `~/.claude.json` -> `mcpServers` (user scope) | `~/.claude/plugins/nativesoul/` or installed `.claude-plugin` package | Cross-platform under the user's home directory. |
|
|
20
|
+
| `claude` | Claude Desktop | N/A — no global `CLAUDE.md` | macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`; Linux: `${XDG_CONFIG_HOME:-~/.config}/Claude/claude_desktop_config.json`; Windows: `%APPDATA%\Claude\claude_desktop_config.json` | Shared `~/.claude/plugins/nativesoul/` plus `~/.claude/settings.json` hooks per ADR-031 | Target path is resolved by platform; no macOS-only default. |
|
|
21
|
+
| `codex` | Codex CLI / App single surface | `~/.codex/AGENTS.md` | `~/.codex/mcp.json` | `~/.codex/plugins/nativesoul/` or installed `.codex-plugin` package | Cross-platform under the user's home directory. Story 6.4 local spike confirmed no separate Codex App MCP target on the operator macOS machine. |
|
|
22
|
+
| `grok` | Grok Build | `~/.grok/AGENTS.md` | `~/.grok/mcp.json` | `~/.grok/plugins/nativesoul/` | Native plugin hooks per ADR-031; no hidden scheduler fallback. |
|
|
23
|
+
| `antigravity` | Antigravity CLI | `~/.gemini/GEMINI.md` | `~/.gemini/antigravity-cli/mcp_config.json` | `~/.antigravity/plugins/nativesoul/` | Native plugin hooks per ADR-031; no hidden scheduler fallback. |
|
|
24
|
+
| `gemini` | Gemini CLI | `~/.gemini/GEMINI.md` | `~/.gemini/settings.json` | `~/.gemini/extensions/nativesoul/` | Native extension hooks per ADR-031; `/memory refresh` is reload guidance, not a scheduler. |
|
|
25
|
+
|
|
26
|
+
### Migration notes
|
|
27
|
+
|
|
28
|
+
- Existing NativeSoul writes to `~/.claude/mcp.json` are treated as legacy for Claude Code.
|
|
29
|
+
- Deep doctor should report `LEGACY_MCP_PATH` when `~/.claude/mcp.json` contains `mcpServers.nativesoul` but `~/.claude.json` does not.
|
|
30
|
+
- Migration is explicit and reversible: install the new surface, verify doctor, then uninstall or rollback the legacy target.
|
|
31
|
+
- No existing non-NativeSoul MCP servers, preferences, credentials, or comments are removed during migration.
|
|
32
|
+
|
|
33
|
+
### Command resolution
|
|
34
|
+
|
|
35
|
+
- MCP `command` MUST resolve on install (absolute path or verified PATH).
|
|
36
|
+
- Doctor MUST execute `which`/existence check, not string match on `"nativesoul-mcp"`.
|
|
37
|
+
- Platform-specific app config paths MUST be resolved in code, not hard-coded to macOS paths.
|
|
38
|
+
|
|
39
|
+
### Codex App path spike (Story 6.4)
|
|
40
|
+
|
|
41
|
+
Local read-only discovery on the operator macOS machine found:
|
|
42
|
+
|
|
43
|
+
- `~/.codex/mcp.json` exists and contains the JSON MCP `mcpServers.nativesoul` registration shape.
|
|
44
|
+
- `~/.codex/config.toml` exists, but is a broader Codex configuration surface and is not the NativeSoul MCP JSON target for this MVP.
|
|
45
|
+
- `~/Library/Application Support/Codex`, `~/Library/Application Support/com.openai.codex`, and `~/Library/Application Support/OpenAI/Codex` exist, but inspected files were app state, Chromium/Electron cache, crashpad, or native-host metadata. No additional Codex App MCP JSON config target was found.
|
|
46
|
+
|
|
47
|
+
Decision for M2: treat Codex CLI and Codex App as a **single MCP install surface** backed by `~/.codex/mcp.json`. NativeSoul MUST NOT write into Codex `Application Support` directories unless a future validated ADR identifies a supported MCP path there.
|
|
48
|
+
|
|
49
|
+
### Bootstrap tier per surface
|
|
50
|
+
|
|
51
|
+
| Surface | Preferred tier | Fallback |
|
|
52
|
+
|---------|----------------|----------|
|
|
53
|
+
| Claude Code | A — SessionStart hook via plugin | D — `generated/claude/last-context.md` |
|
|
54
|
+
| Claude Desktop | A — if hooks available; else MCP at connect | D — cache + first-turn instruction |
|
|
55
|
+
| Codex | A — session hook via plugin | D — cache |
|
|
56
|
+
| Grok Build | A — plugin lifecycle hook plus managed block fallback | D — `bootstrap --format cache` degraded context |
|
|
57
|
+
| Antigravity CLI | A — plugin lifecycle hook plus managed block fallback | D — `bootstrap --format cache` degraded context |
|
|
58
|
+
| Gemini CLI | A — extension lifecycle hook plus managed block fallback and `/memory refresh` guidance | D — `bootstrap --format cache` degraded context |
|
|
59
|
+
|
|
60
|
+
Providers must stay synchronized through native hooks where validated and Tier B/D fallbacks where necessary. Do not emulate schedulers or hooks with hidden cron/daemon behavior.
|
|
61
|
+
|
|
62
|
+
## Consequences
|
|
63
|
+
|
|
64
|
+
- `packages/core/src/host-integration.ts` gains surface-aware targets (breaking change to default paths — migration + doctor warning).
|
|
65
|
+
- `install --all-hosts` may touch more files; backups per target required (ADR-007, ADR-017).
|
|
66
|
+
- Epic 5 plugins bundle MCP registration to avoid drift across surfaces.
|
|
67
|
+
- `plugins/` becomes the planned repository location for host-native package sources generated by Stories 5.1, 5.2, and 6.6.
|
|
68
|
+
|
|
69
|
+
## Alternatives considered
|
|
70
|
+
|
|
71
|
+
| Alternative | Rejected because |
|
|
72
|
+
|-------------|------------------|
|
|
73
|
+
| Single `~/.claude/mcp.json` for all Claude surfaces | Not read by Claude Code user scope or Desktop |
|
|
74
|
+
| Document manual steps only | Fails FR-002 automatic bootstrap operator experience |
|
|
75
|
+
|
|
76
|
+
## References
|
|
77
|
+
|
|
78
|
+
- Story 6.1, Epic 006
|
|
79
|
+
- Real-host validation Wave 4 / FifoClaw 2026-06-23
|
|
80
|
+
- Claude Code MCP docs: `~/.claude.json` user scope
|
|
81
|
+
|
|
82
|
+
## Review
|
|
83
|
+
|
|
84
|
+
- Architect sign-off: GO recorded in `docs/stories/epics/VALIDATION-REPORT.md`.
|
|
85
|
+
- PO sign-off: Story 6.1 validated 10/10 and moved to Done on 2026-06-23.
|
|
86
|
+
|
|
87
|
+
## Change Log
|
|
88
|
+
|
|
89
|
+
- 2026-06-23: Drafted from Wave 4 real-host validation.
|
|
90
|
+
- 2026-06-23: Accepted in Story 6.1; added surface matrix, plugin targets, OS notes, and legacy migration rule.
|
|
91
|
+
- 2026-06-23: Story 5.7 added explicit Tier B/D parity for Grok, Antigravity, and Gemini.
|
|
92
|
+
- 2026-06-23: Story 6.4 confirmed Codex CLI/App single MCP surface on the operator macOS machine.
|
|
93
|
+
- 2026-06-24: Claude Desktop MCP target changed from macOS-only to platform-resolved macOS/Linux/Windows paths.
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# ADR-031: Host parity matrix v2
|
|
2
|
+
|
|
3
|
+
## Status
|
|
4
|
+
|
|
5
|
+
Accepted — Epic 10
|
|
6
|
+
|
|
7
|
+
## Context
|
|
8
|
+
|
|
9
|
+
ADR-030 correctly mapped install surfaces, but Grok, Antigravity, and Gemini still read as "preview". The product requirement is stronger: these hosts must deliver the same operator benefit as Codex/Claude when official surfaces allow it, while never claiming native hooks or schedulers that are not documented.
|
|
10
|
+
|
|
11
|
+
Gemini CLI has official extension, context, command, MCP, and extension hook surfaces. Grok exposes plugin hooks and MCP through its local plugin manager. Antigravity exposes package hooks and MCP through its local plugin validation/install surface. Native scheduler support still requires separate proof and is not claimed for Gemini, Grok, or Antigravity.
|
|
12
|
+
|
|
13
|
+
## Decision
|
|
14
|
+
|
|
15
|
+
Provider parity is reported by capability level, not by implementation identity.
|
|
16
|
+
|
|
17
|
+
| Level | Meaning |
|
|
18
|
+
|-------|---------|
|
|
19
|
+
| `native` | Host exposes a documented native hook/package/scheduler surface and NativeSoul installed it. |
|
|
20
|
+
| `official-fallback` | Host has no validated native hook/scheduler, but NativeSoul installed an explicit package/command/MCP/context fallback using supported file/config surfaces. |
|
|
21
|
+
| `unsupported-native` | No supported native or fallback package surface is installed for this capability. |
|
|
22
|
+
| `ready` | The host delivers the end-user flow through native or official fallback surfaces. |
|
|
23
|
+
|
|
24
|
+
## Host matrix
|
|
25
|
+
|
|
26
|
+
| Host | Package surface | Hooks | Scheduler | Expected parity |
|
|
27
|
+
|------|-----------------|-------|-----------|-----------------|
|
|
28
|
+
| `codex` | native plugin | `native` | native if Codex Automations manifest is detected; otherwise fallback heartbeat command | `ready` when plugin/MCP/block are installed |
|
|
29
|
+
| `claude` Code | native plugin | `native` | native if Claude Scheduled Tasks manifest is detected; otherwise fallback heartbeat command | `ready` when plugin/MCP/block are installed |
|
|
30
|
+
| `claude` Desktop | shared Claude plugin/settings hooks + MCP config | `native` | fallback heartbeat command | `ready` when plugin/settings/MCP are installed |
|
|
31
|
+
| `gemini` | official extension at `~/.gemini/extensions/nativesoul/` | `native` through extension hooks | `official-fallback`; no hidden cron | `ready` through extension hooks + MCP + `GEMINI.md` + commands |
|
|
32
|
+
| `grok` | native plugin at `~/.grok/plugins/nativesoul/`; post-copy `grok plugin install --trust` registers hooks with the CLI | `native` through `hooks/hooks.json` | `official-fallback`; no hidden cron | `ready` through plugin hooks + MCP + `AGENTS.md` + commands |
|
|
33
|
+
| `antigravity` | native plugin at `~/.antigravity/plugins/nativesoul/` | `native` through root `hooks.json` | `official-fallback`; no hidden cron | `ready` through plugin hooks + MCP + shared `GEMINI.md` block + commands |
|
|
34
|
+
|
|
35
|
+
## Capability Status Semantics
|
|
36
|
+
|
|
37
|
+
`ready` is not the same as `full native capability`.
|
|
38
|
+
|
|
39
|
+
- `ready` means the operator flow works through installed NativeSoul surfaces: bootstrap, MCP, package/plugin or extension, managed block, memory recall, policy guard, and heartbeat fallback where needed.
|
|
40
|
+
- `ready with fallback` means NativeSoul is operational but one or more host capabilities use explicit fallback or are blocked by missing native host support. This is valid support language, but not a full-native claim.
|
|
41
|
+
- `full native capability` means every capability for that host is native or fully ready, including native scheduler support and non-degraded capability scan.
|
|
42
|
+
- `official-fallback` is an accepted, honest mode. It is not a failure, but it must not be described as native support.
|
|
43
|
+
- `degraded` capability scan means NativeSoul can still operate, but the host capability inventory came from a fallback or partial source and must not be overclaimed.
|
|
44
|
+
|
|
45
|
+
## Current Real-Host Snapshot
|
|
46
|
+
|
|
47
|
+
Snapshot source: `nativesoul doctor --deep --all-hosts --json` on the operator machine, 2026-06-25.
|
|
48
|
+
|
|
49
|
+
| Host surface | Operational parity | Hooks | Bootstrap/MCP/package | Capability scan | Heartbeat / scheduler | Full native capability? |
|
|
50
|
+
|--------------|--------------------|-------|------------------------|-----------------|-----------------------|-------------------------|
|
|
51
|
+
| `codex` | `ready` | `native` | `ready` | `degraded` | `official-fallback`; `native_scheduler_supported=false` | No |
|
|
52
|
+
| `claude` Code | `ready` | `native` | `ready` | `ready` | `official-fallback`; `native_scheduler_supported=false` | No |
|
|
53
|
+
| `claude` Desktop | `ready` | `native` | `ready` | `ready` | `official-fallback`; `native_scheduler_supported=false` | No |
|
|
54
|
+
| `gemini` | `ready` | `native` via official extension hooks | `ready` | `ready` through official extension/config inventory | `official-fallback`; `native_scheduler_supported=false`; blocked by host for full-native scheduler | No |
|
|
55
|
+
| `grok` | `ready` | `native` via plugin hooks | `ready` | `ready` through native plugin/hook/MCP/command inventory | `official-fallback`; `native_scheduler_supported=false`; blocked by host for full-native scheduler | No |
|
|
56
|
+
| `antigravity` | `ready` | `native` via package hooks | `ready` | `degraded` | `official-fallback`; `native_scheduler_supported=false` | No |
|
|
57
|
+
|
|
58
|
+
Current conclusion: all supported hosts are operationally ready for NativeSoul continuity, but no host should be marketed or documented as `full native capability` until native scheduler mappings are proven and capability scans are non-degraded for that host.
|
|
59
|
+
|
|
60
|
+
The release gate for public support claims is:
|
|
61
|
+
|
|
62
|
+
```sh
|
|
63
|
+
nativesoul doctor --deep --all-hosts --require-full-native --json
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
The command prints `full_native_matrix` and exits non-zero unless every selected host surface is full-native. Release copy may claim `ready` or `ready with fallback` for operational hosts that do not pass this strict gate.
|
|
67
|
+
|
|
68
|
+
## Consequences
|
|
69
|
+
|
|
70
|
+
- `doctor --deep` emits `provider_parity` per host with bootstrap, MCP, package, hooks, memory recall, policy guard, capability scan, and heartbeat status.
|
|
71
|
+
- `doctor --deep` emits `full_native_matrix` for aggregate release decisions. `--require-full-native` turns that matrix into a strict gate.
|
|
72
|
+
- Gemini and Antigravity may share `~/.gemini/GEMINI.md`; managed blocks therefore use host-scoped markers and can coexist.
|
|
73
|
+
- Plugin/package doctor separates `enabled` package presence from `hook_registered`; Gemini, Grok, and Antigravity must now report hook registration when their hook manifests are installed.
|
|
74
|
+
- `native_schedule_supported=false` remains visible for Gemini/Grok/Antigravity. Heartbeat parity is provided by explicit package commands, not a daemon, cron, or fake native scheduler.
|
|
75
|
+
- Documentation and sales copy must distinguish `ready` from `full native capability`; fallback/degraded states are acceptable only when labeled explicitly.
|
|
76
|
+
|
|
77
|
+
## References
|
|
78
|
+
|
|
79
|
+
- `nativesoul-prd-v1.0.md` §9.4, §11.1, §14, §25.2
|
|
80
|
+
- `docs/adr/ADR-030-host-surface-matrix-v1.md`
|
|
81
|
+
- `docs/stories/epics/EPIC-010-provider-parity.md`
|
|
82
|
+
|
|
83
|
+
## Change Log
|
|
84
|
+
|
|
85
|
+
- 2026-06-24: Accepted for Epic 10 provider parity.
|
|
86
|
+
- 2026-06-24: Updated after local official discovery proved Gemini extension hooks, Grok plugin hooks, and Antigravity plugin hooks. Scheduler support remains fallback-only.
|
|
87
|
+
- 2026-06-25: Added current real-host capability snapshot and clarified `ready` vs `full native capability`.
|
|
88
|
+
- 2026-06-26: Story 16.4 updated Gemini: official extension/config inventory is machine-readable; persistent scheduler remains undocumented and blocked for full-native.
|
|
89
|
+
- 2026-06-26: Story 16.5 updated Grok: native plugin/hook/MCP/command inventory is machine-readable; headless/external scheduling remains non-native.
|
|
90
|
+
- 2026-06-26: Story 16.7 added `full_native_matrix`, `--require-full-native`, and release-claim audit language.
|
|
91
|
+
- 2026-06-27: Grok install now auto-registers copied plugins via `grok plugin install --trust`; capability scan dedupes `~/.grok/plugins/*` inventory.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# ADR-032: NativeSoul hard-cut rebrand
|
|
2
|
+
|
|
3
|
+
## Status
|
|
4
|
+
|
|
5
|
+
Accepted for Epic 12.
|
|
6
|
+
|
|
7
|
+
## Context
|
|
8
|
+
|
|
9
|
+
The project name is now NativeSoul. The repo is still local/private, so the rename can be a hard cut before M7 instead of a compatibility migration for public users.
|
|
10
|
+
|
|
11
|
+
Keeping old command names, environment variables, managed markers, MCP keys, package paths, or home directories would increase host-install ambiguity and make operator diagnosis harder.
|
|
12
|
+
|
|
13
|
+
## Decision
|
|
14
|
+
|
|
15
|
+
NativeSoul is the only supported public name after Epic 12.
|
|
16
|
+
|
|
17
|
+
| Surface | Decision |
|
|
18
|
+
|---------|----------|
|
|
19
|
+
| Package name | `nativesoul` |
|
|
20
|
+
| CLI binaries | `nativesoul`, `nativesoul-mcp` |
|
|
21
|
+
| Environment variables | `NATIVESOUL_*` only |
|
|
22
|
+
| Local home | `~/.nativesoul` |
|
|
23
|
+
| SQLite path | `~/.nativesoul/state/nativesoul.sqlite` |
|
|
24
|
+
| MCP server key | `nativesoul` |
|
|
25
|
+
| Host package directories | `nativesoul` under each host plugin or extension root |
|
|
26
|
+
| Managed markers | `<!-- nativesoul:<host>:start v1 -->` / `<!-- nativesoul:<host>:end -->` |
|
|
27
|
+
| Repository target | `fillipeweb/nativesoul` |
|
|
28
|
+
|
|
29
|
+
No compatibility aliases are retained in code, docs, package metadata, host manifests, or active install configuration.
|
|
30
|
+
|
|
31
|
+
## Consequences
|
|
32
|
+
|
|
33
|
+
- Existing local data must be copied to `~/.nativesoul` before old local install paths are removed.
|
|
34
|
+
- Installed host configs must reference `nativesoul` and `nativesoul-mcp`.
|
|
35
|
+
- Global npm link must expose only the new binaries.
|
|
36
|
+
- Release and package smoke gates must validate the new package metadata.
|
|
37
|
+
- Final verification includes a hard-cut search for the former package strings in active tracked files.
|
|
38
|
+
|
|
39
|
+
## Validation
|
|
40
|
+
|
|
41
|
+
- `nativesoul --help`
|
|
42
|
+
- `nativesoul-mcp` JSON-RPC initialize smoke
|
|
43
|
+
- `nativesoul init -> status -> doctor`
|
|
44
|
+
- `nativesoul install --all-hosts --apply --target-root <tmp>`
|
|
45
|
+
- `nativesoul doctor --deep --all-hosts --target-root <tmp>`
|
|
46
|
+
- `nativesoul uninstall --all-hosts --apply --target-root <tmp>`
|
|
47
|
+
- `npm run lint`
|
|
48
|
+
- `npm run typecheck`
|
|
49
|
+
- `npm run policy:check`
|
|
50
|
+
- `npm test`
|
|
51
|
+
- `npm run test:e2e`
|
|
52
|
+
- `npm run package:smoke`
|
|
53
|
+
- `npm run release:provenance:dry-run -- --json`
|
|
54
|
+
- `npm run release:security:audit -- --dependency-audit=offline`
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# ADR-033: Local hybrid memory and reflection
|
|
2
|
+
|
|
3
|
+
## Status
|
|
4
|
+
|
|
5
|
+
Accepted for M7 backlog
|
|
6
|
+
|
|
7
|
+
## Context
|
|
8
|
+
|
|
9
|
+
Epic 13 introduces semantic indexing, hybrid recall, reflection reports, and memory transition guardrails. These features touch the highest-risk NativeSoul state: durable memories and the evidence used to recall or promote them.
|
|
10
|
+
|
|
11
|
+
The review of the M7 backlog identified that stories 13.1-13.4 were Ready, but the architectural boundary was not explicit enough for implementation. The missing decisions were local-only indexing, additive hybrid search, a defined reflection algorithm, and a required transition state machine before memory automation can safely run in M9.
|
|
12
|
+
|
|
13
|
+
## Decision
|
|
14
|
+
|
|
15
|
+
NativeSoul memory search remains local-first and additive.
|
|
16
|
+
|
|
17
|
+
1. FTS remains the baseline recall path.
|
|
18
|
+
2. Semantic vectors are optional local indexes, never a replacement for canonical memory records.
|
|
19
|
+
3. Hybrid recall must merge FTS and semantic candidates with deterministic scope filtering by project, host, source, and sensitivity before results reach bootstrap or MCP responses.
|
|
20
|
+
4. Reflection consolidation produces reviewable proposals, not direct durable memory writes.
|
|
21
|
+
5. Memory status changes must pass a transition matrix before M9 memory automation may enable recurring candidate or promotion workflows.
|
|
22
|
+
|
|
23
|
+
## Reflection Algorithm Boundary
|
|
24
|
+
|
|
25
|
+
Story 13.3 must implement a transparent pipeline:
|
|
26
|
+
|
|
27
|
+
1. Collect daily notes, candidates, stale active records, and duplicate clusters.
|
|
28
|
+
2. Redact or exclude secret-like content before ranking.
|
|
29
|
+
3. Group candidates by project and intent.
|
|
30
|
+
4. Score consolidation opportunities by recency, repetition, confidence, and conflict risk.
|
|
31
|
+
5. Emit a report with proposed create/update/reject/expire actions and before/after evidence.
|
|
32
|
+
6. Require human approval or an explicit policy before applying durable changes.
|
|
33
|
+
|
|
34
|
+
## Consequences
|
|
35
|
+
|
|
36
|
+
- Story 13.4 is a prerequisite for M9 story 17.4.
|
|
37
|
+
- Story 13.2 must cite NFR-001 and keep local recall within bounded latency and context budget.
|
|
38
|
+
- MCP handlers and CLI commands must share the same recall and transition services.
|
|
39
|
+
- Dashboard work in Epic 15 may read reflection output but must not introduce write authority.
|
|
40
|
+
|
|
41
|
+
## References
|
|
42
|
+
|
|
43
|
+
- `docs/stories/epics/EPIC-013-m7-hybrid-memory-reflection.md`
|
|
44
|
+
- `docs/stories/13.1-local-semantic-index-v1.md`
|
|
45
|
+
- `docs/stories/13.2-hybrid-memory-recall-v1.md`
|
|
46
|
+
- `docs/stories/13.3-reflection-consolidation-report-v1.md`
|
|
47
|
+
- `docs/stories/13.4-memory-transition-guardrails-v1.md`
|
|
48
|
+
- `docs/adr/ADR-014-memory-lifecycle-v1.md`
|
|
49
|
+
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# ADR-034: Memory importers and provenance
|
|
2
|
+
|
|
3
|
+
## Status
|
|
4
|
+
|
|
5
|
+
Accepted for M7 backlog
|
|
6
|
+
|
|
7
|
+
## Context
|
|
8
|
+
|
|
9
|
+
Epic 14 adds OpenClaw and native host importers. Importers can accidentally over-trust external data, leak secrets, or blur the difference between imported material and NativeSoul-approved memories.
|
|
10
|
+
|
|
11
|
+
The M7 review identified that importer safety needs an explicit architecture decision before implementation.
|
|
12
|
+
|
|
13
|
+
## Decision
|
|
14
|
+
|
|
15
|
+
All memory importers are dry-run-first and provenance-preserving.
|
|
16
|
+
|
|
17
|
+
1. Importers read only documented export files, user-selected paths, or explicit CLI inputs.
|
|
18
|
+
2. Importers never read private host databases or undocumented binary stores.
|
|
19
|
+
3. Dry-run output is required before any write.
|
|
20
|
+
4. Imported records are created as candidates unless a stricter human-approved policy exists.
|
|
21
|
+
5. Every imported record stores source system, source path or logical origin, import timestamp, mapping confidence, and redaction status.
|
|
22
|
+
6. Secret-like content is redacted or rejected before candidate creation.
|
|
23
|
+
|
|
24
|
+
## Consequences
|
|
25
|
+
|
|
26
|
+
- Story 14.1 must prove OpenClaw import mapping without writes by default.
|
|
27
|
+
- Story 14.2 must keep host-specific importers opt-in and documented.
|
|
28
|
+
- Imported memories cannot bypass ADR-033 transition guardrails.
|
|
29
|
+
- Audit events are required for dry-run summaries and applied imports.
|
|
30
|
+
|
|
31
|
+
## References
|
|
32
|
+
|
|
33
|
+
- `docs/stories/epics/EPIC-014-m7-importers-policy-packs.md`
|
|
34
|
+
- `docs/stories/14.1-openclaw-importer-dry-run-v1.md`
|
|
35
|
+
- `docs/stories/14.2-native-memory-importers-v1.md`
|
|
36
|
+
- `docs/adr/ADR-014-memory-lifecycle-v1.md`
|
|
37
|
+
- `docs/adr/ADR-033-local-hybrid-memory-reflection.md`
|
|
38
|
+
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# ADR-035: Policy pack apply and rollback
|
|
2
|
+
|
|
3
|
+
## Status
|
|
4
|
+
|
|
5
|
+
Accepted for M7 backlog
|
|
6
|
+
|
|
7
|
+
## Context
|
|
8
|
+
|
|
9
|
+
Epic 14 also introduces policy packs. Policy packs are useful for repeatable operator setup, but they affect standing orders and other authority-bearing files. NativeSoul already treats `SOUL.md`, `POLICY.md`, and standing orders as human-authoritative surfaces.
|
|
10
|
+
|
|
11
|
+
## Decision
|
|
12
|
+
|
|
13
|
+
Policy packs are declarative, previewed, audited, and reversible.
|
|
14
|
+
|
|
15
|
+
1. A policy pack declares files, managed blocks, standing-order entries, required approvals, and rollback strategy.
|
|
16
|
+
2. Applying a pack requires a diff preview and explicit approval.
|
|
17
|
+
3. Protected identity and policy files are never overwritten wholesale.
|
|
18
|
+
4. Rollback must restore only the managed material that NativeSoul wrote.
|
|
19
|
+
5. Each apply and rollback operation emits an audit event with pack id, version, affected files, and approval evidence.
|
|
20
|
+
|
|
21
|
+
## Consequences
|
|
22
|
+
|
|
23
|
+
- Story 14.3 owns the schema, catalog, validation rules, and sample packs.
|
|
24
|
+
- Story 14.4 owns apply, rollback, audit, and failure recovery.
|
|
25
|
+
- M9 activation may offer policy-pack recommendations, but cannot silently apply them.
|
|
26
|
+
- Existing managed-block backup and rollback decisions remain authoritative.
|
|
27
|
+
|
|
28
|
+
## References
|
|
29
|
+
|
|
30
|
+
- `docs/stories/14.3-policy-pack-schema-catalog-v1.md`
|
|
31
|
+
- `docs/stories/14.4-policy-pack-apply-rollback-v1.md`
|
|
32
|
+
- `docs/adr/ADR-007-managed-block-backup-and-rollback.md`
|
|
33
|
+
- `docs/adr/ADR-015-policy-standing-orders-v1.md`
|
|
34
|
+
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# ADR-036: Local operator dashboard read-only boundary
|
|
2
|
+
|
|
3
|
+
## Status
|
|
4
|
+
|
|
5
|
+
Accepted for M7 backlog
|
|
6
|
+
|
|
7
|
+
## Context
|
|
8
|
+
|
|
9
|
+
Epic 15 adds a local dashboard, host skills, and feedback metrics. The product value is operator visibility, but the architecture must preserve the existing rule: CLI first, observability second, UI third.
|
|
10
|
+
|
|
11
|
+
The review flagged that dashboard data API and "smart explore" behavior need a clear boundary.
|
|
12
|
+
|
|
13
|
+
## Decision
|
|
14
|
+
|
|
15
|
+
The M7 dashboard is read-only and backed by CLI-readable data contracts.
|
|
16
|
+
|
|
17
|
+
1. Dashboard state must be available through CLI/API before UI rendering.
|
|
18
|
+
2. The dashboard may show memories, capabilities, runs, schedules, approvals, audit events, and metrics.
|
|
19
|
+
3. The dashboard cannot approve, promote, forget, schedule, or edit policy in M7.
|
|
20
|
+
4. Host skills for recall, planning, and exploration must call existing NativeSoul services and honor capability status.
|
|
21
|
+
5. Local feedback metrics are stored locally and exclude prompts, memory bodies, secrets, and raw filesystem paths unless explicitly approved.
|
|
22
|
+
|
|
23
|
+
## Consequences
|
|
24
|
+
|
|
25
|
+
- Story 15.1 defines the data contract.
|
|
26
|
+
- Story 15.2 consumes the contract without adding write authority.
|
|
27
|
+
- Story 15.3 must define "explore" as scoped read-only discovery, not autonomous code mutation.
|
|
28
|
+
- Story 15.4 must prove local-only feedback and retention behavior.
|
|
29
|
+
|
|
30
|
+
## References
|
|
31
|
+
|
|
32
|
+
- `docs/stories/epics/EPIC-015-m7-local-dashboard-skills.md`
|
|
33
|
+
- `docs/stories/15.1-local-dashboard-data-api-v1.md`
|
|
34
|
+
- `docs/stories/15.2-read-only-dashboard-viewer-v1.md`
|
|
35
|
+
- `docs/stories/15.3-host-skills-recall-plan-explore-v1.md`
|
|
36
|
+
- `docs/stories/15.4-local-feedback-metrics-v1.md`
|
|
37
|
+
- `docs/adr/ADR-011-local-audit-cli-export.md`
|
|
38
|
+
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# ADR-037: Full-native evidence contract
|
|
2
|
+
|
|
3
|
+
## Status
|
|
4
|
+
|
|
5
|
+
Accepted for M8 backlog
|
|
6
|
+
|
|
7
|
+
## Context
|
|
8
|
+
|
|
9
|
+
ADR-031 introduced the distinction between operational `ready` and `full native capability`. Epic 16 needs a stricter evidence contract so NativeSoul can stop relying on honest fallback language where official host-native scheduler and inventory surfaces are proven.
|
|
10
|
+
|
|
11
|
+
The M8 review also confirmed that all-host full-native cannot be promised while Grok has no native scheduler.
|
|
12
|
+
|
|
13
|
+
## Decision
|
|
14
|
+
|
|
15
|
+
`full_native` is an evidence-backed status, not a marketing label.
|
|
16
|
+
|
|
17
|
+
A host capability may be marked `full_native` only when all required evidence fields are present:
|
|
18
|
+
|
|
19
|
+
1. Host id and version/source observed.
|
|
20
|
+
2. Official documentation or local CLI/app help proving the native surface.
|
|
21
|
+
3. Native scheduler support when the capability includes heartbeat or recurring work.
|
|
22
|
+
4. Native capability inventory or non-degraded scan source.
|
|
23
|
+
5. Native install/package/hook registration evidence.
|
|
24
|
+
6. Verification command and timestamp.
|
|
25
|
+
7. Failure mode for unsupported hosts: `blocked_by_host`, `degraded_scan`, or `ready_fallback`.
|
|
26
|
+
|
|
27
|
+
The public JSON contract is `schemas/full-native-evidence.schema.json`. `doctor --deep` emits this contract per host under `full_native_evidence` without changing the existing operational `status` or `provider_parity` fields.
|
|
28
|
+
|
|
29
|
+
Reference repositories such as `thedotmack/claude-mem`, `openclaw/openclaw`, and `openclaw/clawhub` may inform implementation patterns, but they do not satisfy this evidence contract. Full-native evidence must come from official host docs, local CLI/app help, local config/API proof, or machine-readable inventory.
|
|
30
|
+
|
|
31
|
+
## Consequences
|
|
32
|
+
|
|
33
|
+
- Story 16.1 owns schema, CLI output, doctor integration, and examples.
|
|
34
|
+
- Stories 16.2-16.6 must populate evidence rather than hard-code claims.
|
|
35
|
+
- Story 16.7 must fail strict full-native gates when evidence is missing.
|
|
36
|
+
- Grok can be `ready` or `blocked_by_host` for scheduler, but must not become all-host full-native without vendor support.
|
|
37
|
+
- M9 heartbeat onboarding depends on this contract to avoid offering fake native scheduler setup.
|
|
38
|
+
|
|
39
|
+
## References
|
|
40
|
+
|
|
41
|
+
- `docs/adr/ADR-031-host-parity-matrix-v2.md`
|
|
42
|
+
- `docs/research/m8-full-native-host-parity-research.md`
|
|
43
|
+
- `docs/research/external-architecture-references.md`
|
|
44
|
+
- `docs/stories/epics/EPIC-016-m8-full-native-host-parity.md`
|
|
45
|
+
- `docs/stories/16.1-full-native-evidence-contract-v1.md`
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# ADR-038: Identity vs activation onboarding
|
|
2
|
+
|
|
3
|
+
## Status
|
|
4
|
+
|
|
5
|
+
Accepted for M9 backlog
|
|
6
|
+
|
|
7
|
+
## Context
|
|
8
|
+
|
|
9
|
+
Story 1.9 introduced host-guided onboarding for identity and project setup. Epic 17 adds activation onboarding for heartbeat, memory automation, recall behavior, and cross-host verification.
|
|
10
|
+
|
|
11
|
+
The M9 review identified an overlap risk: install must not mix identity creation with recurring automation setup in a way that hides approvals or makes onboarding irreversible.
|
|
12
|
+
|
|
13
|
+
## Decision
|
|
14
|
+
|
|
15
|
+
NativeSoul onboarding has two distinct phases.
|
|
16
|
+
|
|
17
|
+
1. Identity onboarding defines who the agent is, project scope, protected identity/policy files, and host-managed blocks.
|
|
18
|
+
2. Activation onboarding enables operational automation: heartbeat, recall triggers, memory candidate creation, promotion policy, standing orders, and verification.
|
|
19
|
+
3. Install may chain from identity onboarding into activation, but activation must present a separate plan and approval prompt.
|
|
20
|
+
4. QuickStart activation uses conservative defaults: no sensitive auto-promotion, no hidden scheduler, and no unsupported host writes.
|
|
21
|
+
5. Advanced activation exposes scheduler host, cadence, memory policy, recall trigger, verification depth, and standing-order options.
|
|
22
|
+
6. Re-running onboarding preserves existing configuration unless reset is explicit.
|
|
23
|
+
|
|
24
|
+
## Consequences
|
|
25
|
+
|
|
26
|
+
- Story 17.1 owns QuickStart/Advanced activation profiles.
|
|
27
|
+
- Story 17.2 owns activation status and dry-run plan semantics.
|
|
28
|
+
- Story 17.3 depends on ADR-037 for scheduler honesty.
|
|
29
|
+
- Story 17.4 depends on ADR-033 for memory transition safety.
|
|
30
|
+
- Story 17.6 may update install prompts only after 17.1-17.5 are implemented.
|
|
31
|
+
|
|
32
|
+
## References
|
|
33
|
+
|
|
34
|
+
- `docs/adr/ADR-029-host-guided-onboarding-v1.md`
|
|
35
|
+
- `docs/adr/ADR-033-local-hybrid-memory-reflection.md`
|
|
36
|
+
- `docs/adr/ADR-037-full-native-evidence-contract.md`
|
|
37
|
+
- `docs/research/openclaw-onboarding-activation-reference.md`
|
|
38
|
+
- `docs/stories/epics/EPIC-017-m9-activation-onboarding.md`
|
|
39
|
+
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# ADR-039: Entitlements & Offline Ed25519 Licensing
|
|
2
|
+
|
|
3
|
+
## Status
|
|
4
|
+
**LARGELY SUPERSEDED (2026-06-30) by [ADR-045](ADR-045-paid-only-closed-distribution.md)** — licensing is now **Dodo-managed online keys (once-a-day check + offline grace)**, not an offline Ed25519 token from a custom issuer. The boot gate is `licensed | unlicensed` (no `Tier`/`FeatureId`/`PRO_FEATURES`, no "degrade to Free"). The custom Ed25519 issuer is removed. Retained only as historical context.
|
|
5
|
+
|
|
6
|
+
~~Accepted — for EPIC-018 (Onda 0 monetization)~~
|
|
7
|
+
|
|
8
|
+
## Context
|
|
9
|
+
|
|
10
|
+
O NativeSoul tem um tier Free (core de continuidade, uncapped) e um tier Pro pago, mas **não existe nenhuma camada de entitlement no código** (`packages/domain/src/types.ts` só tem `HandshakeTier`, que é qualidade de bootstrap — não plano comercial). Hoje todas as features rodam grátis, inclusive as que serão Pro (painel, importers).
|
|
11
|
+
|
|
12
|
+
Precisamos de um mecanismo para distinguir Free de Pro e gatear features pagas **sem violar os pilares do produto**: local-first, sem daemon, sem telemetria, "never copies credentials", e a marca "He doesn't fake it". Qualquer verificação que telefone para casa quebraria esses pilares.
|
|
13
|
+
|
|
14
|
+
O design técnico completo já existe em [`docs/architecture/entitlements-free-pro-design-v1.md`](../architecture/entitlements-free-pro-design-v1.md) (§1-11). Este ADR formaliza a **decisão de arquitetura**; o design-doc é a especificação de implementação que as stories do EPIC-018 executam.
|
|
15
|
+
|
|
16
|
+
## Decision
|
|
17
|
+
|
|
18
|
+
Adotar **licença offline assinada com Ed25519, verificada 100% localmente** via `node:crypto` (zero dependências novas — alinhado ao `dependencies: {}` do projeto).
|
|
19
|
+
|
|
20
|
+
1. **Modelo de entitlement (domain layer).** `Tier = 'free' | 'pro'`, `FeatureId` (allowlist fechada de features ADITIVAS), `PRO_FEATURES`, `Entitlement`, `LicensePayload`. O core **nunca** recebe `FeatureId` → é estruturalmente impossível gatear o core (ver Consequences "never cripple free"). Ref design §1.
|
|
21
|
+
|
|
22
|
+
2. **Licença = token `payload.assinatura`** (base64url do payload `.` base64url da assinatura Ed25519). O CLI **embute apenas a chave pública**; a chave privada vive só no emissor. HMAC simétrico foi rejeitado: exigiria a chave secreta no cliente, permitindo forja de licenças. Ref design §2.
|
|
23
|
+
|
|
24
|
+
3. **`LicensePayload v:1` inclui `kid?: string`** (key id) desde a primeira versão, para permitir rotação de chave sem migração dolorosa. Documentado na story 18.1, não só no runbook.
|
|
25
|
+
|
|
26
|
+
4. **Storage:** `~/.nativesoul/license.json` (modo `0600`, padrão de `workspace.ts`), **não** no SQLite — a licença é fato global da instalação, não do projeto, e evita migration de schema. Ref design §3.
|
|
27
|
+
|
|
28
|
+
5. **Gate único:** `packages/core/src/entitlements.ts` expõe `loadEntitlements`/`hasFeature`/`requireFeature` em typed-result (nunca lança exceção solta; retorna `{ ok:false, reason:'REQUIRES_PRO', upgrade_url, message }`). Licença inválida/expirada/corrompida **sempre degrada para Free, nunca trava o produto** (graceful degradation, igual a `isCodeIntelAvailable()`). Ref design §4.
|
|
29
|
+
|
|
30
|
+
6. **Três pontos de enforcement:** (a) guards de comando no CLI; (b) `gatedTool()` wrapper no MCP server (deny tipado, never fake success); (c) branch interna no recall (`maxMode: 'fts' | 'hybrid'` — Free usa FTS, que é core e nunca desligado; Pro ganha o re-ranking). Aditivo, não subtrativo. Ref design §5.
|
|
31
|
+
|
|
32
|
+
7. **Anti-pirataria pragmática:** Ed25519 impede geração casual de chaves (99% do risco real). **Sem DRM, ofuscação, fingerprint ou validação online** — contradiriam a marca de confiança e não detêm o pirata determinado. Ref design §9.
|
|
33
|
+
|
|
34
|
+
## Consequences
|
|
35
|
+
|
|
36
|
+
- **Pré-requisito de receita.** Sem esta camada, não há como cobrar — hoje o Pro roda grátis. Desbloqueia a Onda 0.
|
|
37
|
+
- **Local-first preservado.** A verificação é matemática e local; nenhum servidor é contatado em runtime nem na ativação. O único componente com servidor (emissor) é tratado no [ADR-040](ADR-040-proprietary-free-to-install-distribution.md) e no runbook `monetization-issuer-runbook.md`, e só EMITE licença — nunca é runtime.
|
|
38
|
+
- **Guardrail "never cripple free" garantido por construção.** Como `FeatureId` é allowlist fechada e o core não tem `FeatureId`, nenhum PR consegue gatear o core sem adicionar a feature a `PRO_FEATURES` (rejeitável em review). Reforçado por teste de invariante (story 18.3).
|
|
39
|
+
- **Stories afetadas:** EPIC-018 (18.1 domain model com `kid`; 18.2 verify/store/keygen; 18.3 gate; 18.4 activation; 18.5 enforcement; 18.6 issuer).
|
|
40
|
+
- **Risco de segurança a endurecer no emissor:** anti-replay/idempotência do webhook — tratado no runbook e na story 18.6 (auditoria de segurança H2).
|
|
41
|
+
|
|
42
|
+
## References
|
|
43
|
+
- [`docs/architecture/entitlements-free-pro-design-v1.md`](../architecture/entitlements-free-pro-design-v1.md) §1-11 (spec de implementação)
|
|
44
|
+
- [ADR-040: Proprietary Free-to-Install Distribution](ADR-040-proprietary-free-to-install-distribution.md)
|
|
45
|
+
- [`docs/architecture/feature-registry.yaml`](../architecture/feature-registry.yaml) (fonte de verdade marketing↔código)
|
|
46
|
+
- `docs/stories/epics/EPIC-018-monetization-entitlements.md`
|
|
47
|
+
- ADR-005 (privacy/export/supply-chain) — coerência local-first
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# ADR-040: Proprietary Free-to-Install Distribution
|
|
2
|
+
|
|
3
|
+
## Status
|
|
4
|
+
**SUPERSEDED (2026-06-30) by [ADR-045](ADR-045-paid-only-closed-distribution.md)** — the model flipped from *free-to-install, source-available* to **paid-only, closed (private repo + minified npm), $29, Dodo-managed licensing**. The PRD Q-008 resolution (proprietary, not OSS) still holds; only the *free-to-install + source-available* mechanics are superseded.
|
|
5
|
+
|
|
6
|
+
~~Accepted (2026-06-26) — supersedes PRD Q-008~~
|
|
7
|
+
|
|
8
|
+
## Context
|
|
9
|
+
|
|
10
|
+
O PRD (`nativesoul-prd-v1.0.md`, Q-008) deixou em aberto: "core open source vs enterprise/comercial". A sales page e o brief de marketing chegaram a apoiar confiança em "open source / read the source / build-in-public". Na prática:
|
|
11
|
+
|
|
12
|
+
- O repositório é **privado** (`isPrivate: true`); o `package.json` tem `"private": true`; **não existia arquivo LICENSE** (criado depois nesta spec pass do EPIC-018 — `LICENSE` + `docs/legal/EULA.md`); o pacote npm não foi publicado.
|
|
13
|
+
- O selo "Open source" era, portanto, **falso hoje** (auditoria §12.4, honesty-risk H1).
|
|
14
|
+
- Os concorrentes diretos (AgentMemory, CMEM) são Apache-2.0 — competir como "open source pela metade" é incoerente.
|
|
15
|
+
|
|
16
|
+
O fundador decidiu: **produto proprietário, gratuito para instalar, não open source.** Este ADR formaliza o modelo de distribuição, preço e o reposicionamento de confiança que isso exige.
|
|
17
|
+
|
|
18
|
+
## Decision
|
|
19
|
+
|
|
20
|
+
**Proprietário free-to-install + Pro pago, source-available, não OSS.**
|
|
21
|
+
|
|
22
|
+
1. **Distribuição npm.** Publicar o pacote (`dist/` transpilado) no registry público; remover `"private": true`; `"license": "UNLICENSED"` no `package.json` apontando para o EULA. **Não minificar/ofuscar agressivamente** nesta fase — o JS legível preserva inspecionabilidade e custa nada. Compilar para binário (Node SEA / `bun --compile`) fica para a **Onda 2**, não é bloqueador de launch.
|
|
23
|
+
|
|
24
|
+
2. **Licenciamento.** `LICENSE` na raiz (texto curto) apontando para [`docs/legal/EULA.md`](../legal/EULA.md): uso **gratuito** do core local; tier **Pro** via licença paga; **sem direito de fork/redistribuição**. Source-available ≠ open source: o código é legível, mas não licenciado para redistribuição.
|
|
25
|
+
|
|
26
|
+
3. **Preço Pro = perpetual fallback** (não lifetime puro). $47 = produto + **1 ano de updates**; após, o usuário mantém o último build para sempre e paga upgrade (~$27-47) na próxima major. Modelo validado de Sublime Text / TablePlus. Resolve a ausência de MRR sem virar assinatura. Custo marginal por usuário ≈ zero (local-first/offline), o que torna o modelo seguro. A linguagem de copy correspondente é governada pelo `feature-registry.yaml` (`pricing_perpetual_fallback`).
|
|
27
|
+
|
|
28
|
+
4. **Reposicionamento de confiança** (substitui o pilar "leia a fonte", que cai com o código fechado):
|
|
29
|
+
|
|
30
|
+
| Removido | Substituto |
|
|
31
|
+
|---|---|
|
|
32
|
+
| "Open source" / "read the source" | "Verify with one command" (`doctor`, `cat SOUL.md`, `ls ~/.nativesoul/`, audit log) |
|
|
33
|
+
| Build-in-public (repo público) | Source-available npm + EULA |
|
|
34
|
+
| Selo "Open source" | "No telemetry — verificável com seu próprio network inspector" |
|
|
35
|
+
|
|
36
|
+
A prova de honestidade migra de "ler o código" (que quase ninguém faz) para **comportamento verificável** (que qualquer dev confirma com 5 comandos e um network monitor) — mais forte para a objeção real de privacidade. Modelo de mercado: Raycast, Warp, TablePlus (free-but-closed, vendem confiança via comportamento + trust center).
|
|
37
|
+
|
|
38
|
+
## Consequences
|
|
39
|
+
|
|
40
|
+
- **Resolve PRD Q-008** → marcado como decidido (proprietário). PRD atualizado.
|
|
41
|
+
- **Sales page / brief:** remover badge "Open source", "read the source", build-in-public; pricing passa a perpetual fallback. Governado pelo `feature-registry.yaml` e refletido no brief in-project (`docs/marketing/nativesoul-marketing-brief-v1.md`). A sales page externa (`rmbc-v1.md`, equipe de copy) consome o registry.
|
|
42
|
+
- **Pré-requisitos de `npm publish`:** LICENSE + EULA presentes; `"private": true` removido. Tratado na story 18.9 (handoff @devops — push/publish é exclusivo de @devops).
|
|
43
|
+
- **Revisão legal recomendada** (@legal-chief) do EULA antes de venda global — não opcional.
|
|
44
|
+
- **Risco residual:** parte do público dev valoriza OSS. Mitigação: liderar com o que os concorrentes abertos NÃO têm (identidade/SOUL, no-daemon, zero cópia de credencial) + free uncapped + refund 30 dias reduzem o risco percebido a quase zero.
|
|
45
|
+
|
|
46
|
+
## References
|
|
47
|
+
- [`docs/architecture/entitlements-free-pro-design-v1.md`](../architecture/entitlements-free-pro-design-v1.md) §4 (impacto "free mas não open source"), §9 (anti-pirataria)
|
|
48
|
+
- [ADR-039: Entitlements & Offline Licensing](ADR-039-entitlements-offline-licensing.md)
|
|
49
|
+
- [`docs/architecture/feature-registry.yaml`](../architecture/feature-registry.yaml)
|
|
50
|
+
- `docs/legal/EULA.md`, `LICENSE`
|
|
51
|
+
- `nativesoul-prd-v1.0.md` Q-008 (superseded por este ADR)
|
|
52
|
+
- Pesquisa de mercado (Raycast/Warp/TablePlus/Sublime) — `docs/architecture/project-overview-v1.md` §4
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# ADR-041: Project Identity & Lightweight Registry
|
|
2
|
+
|
|
3
|
+
## Status
|
|
4
|
+
Accepted — for EPIC-019 (Onda 1, project management)
|
|
5
|
+
|
|
6
|
+
## Context
|
|
7
|
+
|
|
8
|
+
O NativeSoul escopa memória, commitments, runs e sessions por `project_id`, **derivado on-the-fly** do diretório de trabalho (`resolveProjectIdFromCwd`: alias → git-remote → git-root → path). Não existe tabela `projects` nem comando `project`. Isso é zero-config e local-first, mas impede o usuário de **enumerar, renomear, fixar ou limpar** projetos, e o id por-path **orfana memórias** se a pasta for movida (repos sem remote git).
|
|
9
|
+
|
|
10
|
+
Precisamos habilitar gestão de projetos **sem** sacrificar o local-first nem a derivação zero-config. Design técnico completo: [`docs/architecture/project-management-design-v1.md`](../architecture/project-management-design-v1.md) (Aria @architect + Dara @data-engineer).
|
|
11
|
+
|
|
12
|
+
## Decision
|
|
13
|
+
|
|
14
|
+
1. **Registry como projeção lazy, não como autoridade.** Introduzir tabela `projects` (migração 5), populada por upsert lazy no write-boundary do bootstrap e backfill retroativo dos `scope_project` distintos. **A derivação continua a fonte da verdade do id**; o registry é um índice para enumerar/renomear/lifecycle. DB sem `projects` = comportamento idêntico ao atual (graceful degradation). Sem FK física das 5 tabelas para `projects`.
|
|
15
|
+
|
|
16
|
+
2. **Path-stability via marker `.nativesoul/project`.** Nova precedência `alias → marker → git-remote → git-root → path`. Auto-criado **apenas** quando a fonte é `git-root`/`path` (o caso frágil); repos com remote não geram marker. O id deixa de depender do caminho.
|
|
17
|
+
|
|
18
|
+
3. **`rename` é cosmético** (só `projects.display_name`). **Cascade de `scope_project` é proibido** — quebraria o `hash` da memória, exigiria transação multi-tabela e criaria divergência permanente derivação↔armazenamento. Mudança de id real = `alias`, com gap de continuidade documentado em `project show`.
|
|
19
|
+
|
|
20
|
+
4. **CLI-first; sem MCP na v1.** Surface `nativesoul project list/show/rename/pin/alias/forget`. `alias add/remove` é o primeiro escritor de `config.yaml` `project.aliases`. Tools `life_project_*` ficam como carry-forward read-only.
|
|
21
|
+
|
|
22
|
+
5. **Produto único licenciado.** Project management é a fundação de continuidade (custo marginal zero) e não tem gate por feature. Sob ADR-045, ele fica disponível quando o boot gate do produto está licenciado.
|
|
23
|
+
|
|
24
|
+
## Consequences
|
|
25
|
+
|
|
26
|
+
- **Escopo correto: 5 tabelas** (memories, semantic_memory_index, commitments, runs, sessions). `schedules` é host-only (sem `project_id`) → fora de cascade/forget. Migração 5 também adiciona o índice faltante `idx_memories_project_status`.
|
|
27
|
+
- **Stories:** EPIC-019 (19.1 registry+backfill, 19.2 list/show, 19.3 marker/path-stability, 19.4 rename/alias+config-writer, 19.5 forget lifecycle).
|
|
28
|
+
- **Risco concentrado em 19.3** (altera a precedência da derivação em produção) → gate de QA reforçado; regressão orfana memórias silenciosamente.
|
|
29
|
+
- **Carry-forward:** `project merge` (re-unificação com re-hash), `life_project_*` read-only, sync cross-device do registry.
|
|
30
|
+
- **Backward-compat total:** toda a epic é aditiva.
|
|
31
|
+
|
|
32
|
+
## References
|
|
33
|
+
- [`docs/architecture/project-management-design-v1.md`](../architecture/project-management-design-v1.md)
|
|
34
|
+
- `packages/core/src/project.ts` (derivação), `packages/db/src/schema.ts` (migração)
|
|
35
|
+
- `docs/stories/epics/EPIC-019-project-management.md`
|