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,95 @@
1
+ 'use strict';
2
+
3
+ // Generated by scripts/generate-policy-fail-closed.mjs from packages/core/src/policy-fail-closed.ts.
4
+ // Do not edit by hand.
5
+
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.preToolUseEvent = preToolUseEvent;
8
+ exports.isSensitivePreToolUsePayload = isSensitivePreToolUsePayload;
9
+ exports.buildFailClosedPreToolUseResult = buildFailClosedPreToolUseResult;
10
+ function preToolUseEvent(payload) {
11
+ const record = isRecord(payload) ? payload : {};
12
+ const toolInput = isRecord(record.tool_input) ? record.tool_input : isRecord(record.input) ? record.input : {};
13
+ const toolName = stringValue(record.tool_name) ?? stringValue(record.tool) ?? stringValue(record.name) ?? "unknown_tool";
14
+ const action = stringValue(record.action) ?? stringValue(toolInput.action) ?? toolName;
15
+ const target = stringValue(record.target) ??
16
+ stringValue(toolInput.target) ??
17
+ stringValue(toolInput.file_path) ??
18
+ stringValue(toolInput.path) ??
19
+ stringValue(toolInput.url) ??
20
+ stringValue(toolInput.command);
21
+ const command = stringValue(toolInput.command) ?? stringValue(record.command);
22
+ return {
23
+ action,
24
+ className: inferPolicyClass(toolName, [target, command].filter(Boolean).join(" ")),
25
+ target,
26
+ project: stringValue(record.project) ?? stringValue(record.project_id) ?? stringValue(toolInput.project) ?? stringValue(toolInput.project_id)
27
+ };
28
+ }
29
+ function isSensitivePreToolUsePayload(payload) {
30
+ const event = preToolUseEvent(payload);
31
+ return event.className === "external_write" || event.className === "destructive";
32
+ }
33
+ function buildFailClosedPreToolUseResult(input) {
34
+ if (!isSensitivePreToolUsePayload(input)) {
35
+ return null;
36
+ }
37
+ const event = preToolUseEvent(input);
38
+ return {
39
+ allowed: false,
40
+ blocked: true,
41
+ message: `NativeSoul policy unavailable; blocked sensitive tool use ${event.action}.`,
42
+ evaluation: {
43
+ action: event.action,
44
+ class: event.className,
45
+ target: event.target ?? null,
46
+ decision: "approval_required",
47
+ reasons: ["POLICY_UNAVAILABLE_FAIL_CLOSED"],
48
+ matched_standing_order: null
49
+ }
50
+ };
51
+ }
52
+ function inferPolicyClass(toolName, target) {
53
+ const combined = `${toolName} ${target ?? ""}`.toLowerCase();
54
+ if (/\b(bash|shell|sh|zsh|exec_command)\b/u.test(toolName.toLowerCase())) {
55
+ return inferShellCommandClass(target ?? "");
56
+ }
57
+ if (/\b(rm\s+-[^\s]*[rf][^\s]*|delete|reset\s+--hard|destroy|purge|drop)\b/u.test(combined)) {
58
+ return "destructive";
59
+ }
60
+ if (/(slack|gmail|outlook|github|gh\s+pr|gh\s+issue|git\s+push|vercel\s+deploy|deploy|publish|send|post|comment|merge|api|curl\s+.*(-x|--request|-d|--data|--data-raw|--form)\s*(post|put|patch|delete)?)/u.test(combined)) {
61
+ return "external_write";
62
+ }
63
+ if (/(write|edit|patch|apply|create|move|rename|git\s+commit)/u.test(combined)) {
64
+ return "write_project";
65
+ }
66
+ if (/(curl|fetch|browser|http|web)/u.test(combined)) {
67
+ return "probe_external";
68
+ }
69
+ return "read_local";
70
+ }
71
+ function inferShellCommandClass(command) {
72
+ const normalized = command.toLowerCase();
73
+ if (/\b(rm\s+-[^\s]*[rf][^\s]*|delete|reset\s+--hard|destroy|purge|drop)\b/u.test(normalized)) {
74
+ return "destructive";
75
+ }
76
+ if (/(curl\s+.*(-x|--request|-d|--data|--data-raw|--form)\s*(post|put|patch|delete)?|gh\s+(pr|issue|release)|git\s+push|vercel\s+deploy|npm\s+publish|pnpm\s+publish|deploy|publish)/u.test(normalized)) {
77
+ return "external_write";
78
+ }
79
+ if (/(^|\s)(touch|mkdir|mv|cp|tee|chmod|chown|git\s+commit)\b|(^|[^>])>[^>]|>>/u.test(normalized)) {
80
+ return "write_project";
81
+ }
82
+ if (/^(pwd|ls|cat|head|tail|rg|grep|sed\s+-n|find\s+.*-print|git\s+(status|diff|log|show))(\s|$)/u.test(normalized.trim())) {
83
+ return "read_local";
84
+ }
85
+ if (/(curl|fetch|http|https?:\/\/)/u.test(normalized)) {
86
+ return "probe_external";
87
+ }
88
+ return "write_project";
89
+ }
90
+ function isRecord(value) {
91
+ return Boolean(value) && !Array.isArray(value) && typeof value === "object";
92
+ }
93
+ function stringValue(value) {
94
+ return typeof value === "string" && value.trim().length > 0 ? value.trim() : undefined;
95
+ }
@@ -0,0 +1,47 @@
1
+ {
2
+ "id": "local-readonly",
3
+ "version": "1.0.0",
4
+ "title": "Local read-only guardrails",
5
+ "description": "Prefer local reads and require approval for project writes while operators evaluate NativeSoul behavior.",
6
+ "intended_use": "Use for first installs, audits, and dry-run verification where no automatic authority changes should happen.",
7
+ "approvals": [
8
+ "operator_review"
9
+ ],
10
+ "standing_orders": [
11
+ {
12
+ "id": "local-readonly-defaults",
13
+ "action": "propose",
14
+ "authority": "proposal",
15
+ "allowed": [
16
+ "read_workspace",
17
+ "inspect_status"
18
+ ],
19
+ "approval_required": [
20
+ "write_project",
21
+ "change_host_config"
22
+ ],
23
+ "scope_projects": [],
24
+ "scope_hosts": [],
25
+ "reason": "Keep first-run validation observable and reversible."
26
+ }
27
+ ],
28
+ "policy_proposals": [
29
+ {
30
+ "target": "POLICY.md",
31
+ "summary": "Require explicit operator approval before writes to project files or host configuration during first-run validation.",
32
+ "rationale": "NativeSoul should prove bootstrap, memory, and host checks before changing authority-bearing surfaces.",
33
+ "rollback_note": "Remove the proposed first-run approval language from POLICY.md after review."
34
+ }
35
+ ],
36
+ "managed_blocks": [],
37
+ "rollback": {
38
+ "strategy": "proposal-only",
39
+ "restores": [
40
+ "POLICY.md proposal text"
41
+ ],
42
+ "notes": "No files are changed by listing, showing, or validating this pack."
43
+ },
44
+ "metadata": {
45
+ "maturity": "starter"
46
+ }
47
+ }
@@ -0,0 +1,49 @@
1
+ {
2
+ "id": "team-review",
3
+ "version": "1.0.0",
4
+ "title": "Team review workflow",
5
+ "description": "Require review for external writes and destructive actions in shared team repositories.",
6
+ "intended_use": "Use when NativeSoul is installed in a team-owned repository and changes need an approval trail.",
7
+ "approvals": [
8
+ "operator_review",
9
+ "team_review"
10
+ ],
11
+ "standing_orders": [
12
+ {
13
+ "id": "team-external-write-review",
14
+ "action": "propose",
15
+ "authority": "proposal",
16
+ "allowed": [
17
+ "read_workspace",
18
+ "inspect_status"
19
+ ],
20
+ "approval_required": [
21
+ "external_write",
22
+ "destructive",
23
+ "identity_policy_change"
24
+ ],
25
+ "scope_projects": [],
26
+ "scope_hosts": [],
27
+ "reason": "Shared repositories need review before external side effects or destructive work."
28
+ }
29
+ ],
30
+ "policy_proposals": [
31
+ {
32
+ "target": "POLICY.md",
33
+ "summary": "Require team review before external writes, destructive actions, or identity/policy changes.",
34
+ "rationale": "Team repositories need explicit approval evidence before changes leave the local workspace or affect authority.",
35
+ "rollback_note": "Remove the proposed team-review approval language from POLICY.md after review."
36
+ }
37
+ ],
38
+ "managed_blocks": [],
39
+ "rollback": {
40
+ "strategy": "proposal-only",
41
+ "restores": [
42
+ "POLICY.md proposal text"
43
+ ],
44
+ "notes": "This catalog pack is read-only until the apply/rollback story implements approved writes."
45
+ },
46
+ "metadata": {
47
+ "maturity": "starter"
48
+ }
49
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://nativesoul.local/schemas/audit-event.v1.json",
4
+ "title": "NativeSoul Audit Event",
5
+ "type": "object",
6
+ "required": ["id", "type", "actor", "origin", "result", "created_at", "hash"],
7
+ "properties": {
8
+ "id": { "type": "string", "pattern": "^evt_" },
9
+ "type": { "type": "string" },
10
+ "actor": { "type": "string" },
11
+ "origin": { "type": "string" },
12
+ "result": { "type": "string", "enum": ["ok", "error", "blocked"] },
13
+ "details": { "type": "object" },
14
+ "created_at": { "type": "string" },
15
+ "hash": { "type": "string", "pattern": "^sha256:" }
16
+ },
17
+ "additionalProperties": false
18
+ }
@@ -0,0 +1,37 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://nativesoul.local/schemas/capability-card.v1.json",
4
+ "title": "NativeSoul Capability Card",
5
+ "type": "object",
6
+ "required": ["card_version", "id", "uid", "host", "normalized_kind", "readiness", "source", "schema_hash", "use_when", "requires", "side_effects", "approval", "examples"],
7
+ "properties": {
8
+ "card_version": { "const": 1 },
9
+ "id": { "type": "string" },
10
+ "uid": { "type": "string" },
11
+ "host": { "type": "string" },
12
+ "native_kind": { "type": "string" },
13
+ "normalized_kind": { "type": "string" },
14
+ "readiness": {
15
+ "type": "object",
16
+ "required": ["installed", "enabled", "active", "authenticated", "healthy", "allowed", "ready"],
17
+ "properties": {
18
+ "installed": { "type": "boolean" },
19
+ "enabled": { "type": "boolean" },
20
+ "active": { "type": "boolean" },
21
+ "authenticated": { "type": "boolean" },
22
+ "healthy": { "type": "boolean" },
23
+ "allowed": { "type": "boolean" },
24
+ "ready": { "type": "boolean" }
25
+ },
26
+ "additionalProperties": false
27
+ },
28
+ "source": { "type": "string" },
29
+ "schema_hash": { "type": "string" },
30
+ "use_when": { "type": "array", "items": { "type": "string" } },
31
+ "requires": { "type": "array", "items": { "type": "string" } },
32
+ "side_effects": { "type": "array", "items": { "type": "string" } },
33
+ "approval": { "type": "string" },
34
+ "examples": { "type": "array", "items": { "type": "string" } }
35
+ },
36
+ "additionalProperties": false
37
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://nativesoul.local/schemas/capability.v1.json",
4
+ "title": "NativeSoul Capability",
5
+ "type": "object",
6
+ "required": ["uid", "host", "native_kind", "normalized_kind", "installed", "enabled", "active", "authenticated", "healthy", "allowed", "ready", "source", "last_seen_at"],
7
+ "properties": {
8
+ "uid": { "type": "string" },
9
+ "host": { "type": "string" },
10
+ "native_kind": { "type": "string" },
11
+ "normalized_kind": { "type": "string" },
12
+ "native_id": { "type": ["string", "null"] },
13
+ "installed": { "type": "boolean" },
14
+ "enabled": { "type": "boolean" },
15
+ "active": { "type": "boolean" },
16
+ "authenticated": { "type": "boolean" },
17
+ "healthy": { "type": "boolean" },
18
+ "allowed": { "type": "boolean" },
19
+ "ready": { "type": "boolean" },
20
+ "source": { "type": "string" },
21
+ "capabilities": { "type": "array", "items": { "type": "string" } },
22
+ "last_seen_at": { "type": "string" }
23
+ },
24
+ "additionalProperties": true
25
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://nativesoul.local/schemas/commitment.v1.json",
4
+ "title": "NativeSoul Commitment",
5
+ "type": "object",
6
+ "required": ["id", "project_id", "summary", "status", "source", "created_at", "updated_at"],
7
+ "properties": {
8
+ "id": { "type": "string", "pattern": "^commitment_" },
9
+ "project_id": { "type": "string" },
10
+ "summary": { "type": "string" },
11
+ "status": { "type": "string", "enum": ["open", "completed", "dismissed", "expired"] },
12
+ "due_at": { "type": ["string", "null"] },
13
+ "ttl_expires_at": { "type": ["string", "null"] },
14
+ "source": { "type": "object" },
15
+ "created_at": { "type": "string" },
16
+ "updated_at": { "type": "string" }
17
+ },
18
+ "additionalProperties": false
19
+ }
@@ -0,0 +1,82 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://nativesoul.local/schemas/full-native-evidence.schema.json",
4
+ "title": "Full Native Evidence Contract",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "schema_version",
9
+ "host",
10
+ "surface",
11
+ "status",
12
+ "ready",
13
+ "full_native",
14
+ "blocked_by_host",
15
+ "degraded_scan",
16
+ "generated_at",
17
+ "requirements",
18
+ "missing_requirements"
19
+ ],
20
+ "properties": {
21
+ "schema_version": { "const": 1 },
22
+ "host": { "type": "string", "minLength": 1 },
23
+ "surface": { "type": "string", "minLength": 1 },
24
+ "status": {
25
+ "type": "string",
26
+ "enum": ["ready", "full_native", "blocked_by_host", "degraded_scan", "ready_fallback"]
27
+ },
28
+ "ready": { "type": "boolean" },
29
+ "full_native": { "type": "boolean" },
30
+ "blocked_by_host": { "type": "boolean" },
31
+ "degraded_scan": { "type": "boolean" },
32
+ "generated_at": { "type": "string", "format": "date-time" },
33
+ "requirements": {
34
+ "type": "array",
35
+ "minItems": 5,
36
+ "items": { "$ref": "#/$defs/requirement_evidence" }
37
+ },
38
+ "missing_requirements": {
39
+ "type": "array",
40
+ "items": { "$ref": "#/$defs/requirement" }
41
+ }
42
+ },
43
+ "$defs": {
44
+ "requirement": {
45
+ "type": "string",
46
+ "enum": ["native_package", "native_hooks", "mcp", "native_scheduler", "official_inventory"]
47
+ },
48
+ "requirement_evidence": {
49
+ "type": "object",
50
+ "additionalProperties": false,
51
+ "required": ["requirement", "satisfied", "evidence", "missing_reason"],
52
+ "properties": {
53
+ "requirement": { "$ref": "#/$defs/requirement" },
54
+ "satisfied": { "type": "boolean" },
55
+ "evidence": {
56
+ "type": "array",
57
+ "items": { "$ref": "#/$defs/evidence_record" }
58
+ },
59
+ "missing_reason": {
60
+ "type": ["string", "null"]
61
+ }
62
+ }
63
+ },
64
+ "evidence_record": {
65
+ "type": "object",
66
+ "additionalProperties": false,
67
+ "required": ["source_kind", "reference", "observed_at", "confidence"],
68
+ "properties": {
69
+ "source_kind": {
70
+ "type": "string",
71
+ "enum": ["doctor", "local_cli", "local_api", "config_file", "official_docs"]
72
+ },
73
+ "reference": { "type": "string", "minLength": 1 },
74
+ "observed_at": { "type": "string", "format": "date-time" },
75
+ "confidence": {
76
+ "type": "string",
77
+ "enum": ["high", "medium", "low"]
78
+ }
79
+ }
80
+ }
81
+ }
82
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://nativesoul.local/schemas/lease.v1.json",
4
+ "title": "NativeSoul Lease",
5
+ "type": "object",
6
+ "required": ["id", "slot", "holder", "idempotency_key", "expires_at", "status"],
7
+ "properties": {
8
+ "id": { "type": "string" },
9
+ "slot": { "type": "string" },
10
+ "holder": { "type": "string" },
11
+ "idempotency_key": { "type": "string" },
12
+ "expires_at": { "type": "string" },
13
+ "status": { "type": "string", "enum": ["claimed", "completed", "expired"] }
14
+ },
15
+ "additionalProperties": false
16
+ }
@@ -0,0 +1,31 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://nativesoul.local/schemas/memory.v1.json",
4
+ "title": "NativeSoul Memory",
5
+ "type": "object",
6
+ "required": ["id", "type", "scope", "content", "summary", "source", "confidence", "authority", "sensitivity", "status", "created_at", "hash"],
7
+ "properties": {
8
+ "id": { "type": "string", "pattern": "^mem_" },
9
+ "type": { "type": "string" },
10
+ "scope": {
11
+ "type": "object",
12
+ "required": ["project"],
13
+ "properties": {
14
+ "user": { "type": "string" },
15
+ "project": { "type": "string" }
16
+ },
17
+ "additionalProperties": false
18
+ },
19
+ "content": { "type": "string" },
20
+ "summary": { "type": "string" },
21
+ "source": { "type": "object" },
22
+ "confidence": { "type": "number", "minimum": 0, "maximum": 1 },
23
+ "authority": { "type": "string" },
24
+ "sensitivity": { "type": "string" },
25
+ "status": { "type": "string", "enum": ["candidate", "active", "superseded", "rejected", "forgotten"] },
26
+ "created_at": { "type": "string" },
27
+ "expires_at": { "type": ["string", "null"] },
28
+ "hash": { "type": "string", "pattern": "^sha256:" }
29
+ },
30
+ "additionalProperties": false
31
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://nativesoul.local/schemas/migration.v1.json",
4
+ "title": "NativeSoul Migration",
5
+ "type": "object",
6
+ "required": ["version", "name", "checksum", "applied_at"],
7
+ "properties": {
8
+ "version": { "type": "integer", "minimum": 1 },
9
+ "name": { "type": "string" },
10
+ "checksum": { "type": "string" },
11
+ "applied_at": { "type": "string" }
12
+ },
13
+ "additionalProperties": false
14
+ }
@@ -0,0 +1,96 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://nativesoul.local/schemas/policy-pack.v1.json",
4
+ "title": "NativeSoul Policy Pack v1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["id", "version", "title", "description", "intended_use", "standing_orders", "policy_proposals", "managed_blocks", "rollback"],
8
+ "properties": {
9
+ "id": {
10
+ "type": "string",
11
+ "pattern": "^[a-z0-9][a-z0-9-]{2,63}$"
12
+ },
13
+ "version": {
14
+ "type": "string",
15
+ "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$"
16
+ },
17
+ "title": {
18
+ "type": "string",
19
+ "minLength": 1
20
+ },
21
+ "description": {
22
+ "type": "string",
23
+ "minLength": 1
24
+ },
25
+ "intended_use": {
26
+ "type": "string",
27
+ "minLength": 1
28
+ },
29
+ "approvals": {
30
+ "type": "array",
31
+ "items": { "type": "string" }
32
+ },
33
+ "standing_orders": {
34
+ "type": "array",
35
+ "items": {
36
+ "type": "object",
37
+ "additionalProperties": false,
38
+ "required": ["id", "action", "authority", "allowed", "approval_required", "scope_projects", "scope_hosts", "reason"],
39
+ "properties": {
40
+ "id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]{2,63}$" },
41
+ "action": { "type": "string", "enum": ["add", "propose"] },
42
+ "authority": { "type": "string", "enum": ["operator-approved", "proposal"] },
43
+ "allowed": { "type": "array", "items": { "type": "string" } },
44
+ "approval_required": { "type": "array", "items": { "type": "string" } },
45
+ "scope_projects": { "type": "array", "items": { "type": "string" } },
46
+ "scope_hosts": { "type": "array", "items": { "type": "string" } },
47
+ "reason": { "type": "string", "minLength": 1 }
48
+ }
49
+ }
50
+ },
51
+ "policy_proposals": {
52
+ "type": "array",
53
+ "items": {
54
+ "type": "object",
55
+ "additionalProperties": false,
56
+ "required": ["target", "summary", "rationale", "rollback_note"],
57
+ "properties": {
58
+ "target": { "type": "string", "enum": ["SOUL.md", "POLICY.md"] },
59
+ "summary": { "type": "string", "minLength": 1 },
60
+ "rationale": { "type": "string", "minLength": 1 },
61
+ "rollback_note": { "type": "string", "minLength": 1 }
62
+ }
63
+ }
64
+ },
65
+ "managed_blocks": {
66
+ "type": "array",
67
+ "items": {
68
+ "type": "object",
69
+ "additionalProperties": false,
70
+ "required": ["target", "marker", "content", "rollback_key"],
71
+ "properties": {
72
+ "target": { "type": "string", "minLength": 1 },
73
+ "marker": { "type": "string", "minLength": 1 },
74
+ "content": { "type": "string", "minLength": 1 },
75
+ "rollback_key": { "type": "string", "minLength": 1 }
76
+ }
77
+ }
78
+ },
79
+ "rollback": {
80
+ "type": "object",
81
+ "additionalProperties": false,
82
+ "required": ["strategy", "restores", "notes"],
83
+ "properties": {
84
+ "strategy": { "type": "string", "enum": ["proposal-only", "managed-block", "snapshot-required"] },
85
+ "restores": { "type": "array", "items": { "type": "string" }, "minItems": 1 },
86
+ "notes": { "type": "string", "minLength": 1 }
87
+ }
88
+ },
89
+ "metadata": {
90
+ "type": "object",
91
+ "additionalProperties": {
92
+ "type": ["string", "number", "boolean", "null"]
93
+ }
94
+ }
95
+ }
96
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://nativesoul.local/schemas/schedule.v1.json",
4
+ "title": "NativeSoul Schedule",
5
+ "type": "object",
6
+ "required": ["id", "host", "mode", "enabled", "native_schedule_supported"],
7
+ "properties": {
8
+ "id": { "type": "string" },
9
+ "host": { "type": "string" },
10
+ "mode": { "type": "string", "enum": ["leader", "federated", "per-project"] },
11
+ "enabled": { "type": "boolean" },
12
+ "native_schedule_supported": { "type": "boolean" },
13
+ "native_id": { "type": ["string", "null"] }
14
+ },
15
+ "additionalProperties": false
16
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://nativesoul.local/schemas/session.v1.json",
4
+ "title": "NativeSoul Session",
5
+ "type": "object",
6
+ "required": ["id", "host", "cwd", "project_id", "mode", "started_at"],
7
+ "properties": {
8
+ "id": { "type": "string" },
9
+ "host": { "type": "string" },
10
+ "cwd": { "type": "string" },
11
+ "project_id": { "type": "string" },
12
+ "mode": { "type": "string", "enum": ["healthy", "degraded", "unsupported"] },
13
+ "started_at": { "type": "string" }
14
+ },
15
+ "additionalProperties": false
16
+ }