@ornexus/neocortex 4.60.16 → 4.63.3

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 (69) hide show
  1. package/dist/sbom.cdx.json +29 -29
  2. package/docs/install/installer-diagnostics.md +33 -0
  3. package/install.ps1 +49 -229
  4. package/install.sh +30 -92
  5. package/package.json +5 -2
  6. package/packages/client/dist/adapters/platform-detector.d.ts +7 -6
  7. package/packages/client/dist/adapters/platform-detector.js +1 -1
  8. package/packages/client/dist/agent/refresh-stubs.js +1 -1
  9. package/packages/client/dist/cache/encrypted-cache.d.ts +10 -4
  10. package/packages/client/dist/cache/encrypted-cache.js +1 -1
  11. package/packages/client/dist/cache/in-memory-asset-cache.d.ts +5 -4
  12. package/packages/client/dist/cache/in-memory-asset-cache.js +1 -1
  13. package/packages/client/dist/cache/protected-pi-boundary.d.ts +6 -2
  14. package/packages/client/dist/cache/protected-pi-boundary.js +1 -1
  15. package/packages/client/dist/checkpoint/checkpoint-client-reader.d.ts +31 -30
  16. package/packages/client/dist/checkpoint/checkpoint-client-reader.js +2 -2
  17. package/packages/client/dist/checkpoint/shared-checkpoint-types.d.ts +2 -0
  18. package/packages/client/dist/cli.js +3 -3
  19. package/packages/client/dist/commands/invoke.d.ts +77 -1
  20. package/packages/client/dist/commands/invoke.js +44 -59
  21. package/packages/client/dist/config/resolver-selection.d.ts +12 -31
  22. package/packages/client/dist/config/resolver-selection.js +1 -1
  23. package/packages/client/dist/errors/error-messages.js +1 -1
  24. package/packages/client/dist/evidence/collector.d.ts +18 -0
  25. package/packages/client/dist/evidence/collector.js +1 -0
  26. package/packages/client/dist/evidence/index.d.ts +3 -0
  27. package/packages/client/dist/evidence/index.js +1 -0
  28. package/packages/client/dist/evidence/types.d.ts +59 -0
  29. package/packages/client/dist/evidence/types.js +0 -0
  30. package/packages/client/dist/graph-retrieval/pre-command-hook.d.ts +21 -0
  31. package/packages/client/dist/graph-retrieval/pre-command-hook.js +1 -1
  32. package/packages/client/dist/index.d.ts +10 -11
  33. package/packages/client/dist/index.js +1 -1
  34. package/packages/client/dist/license/license-client.d.ts +17 -0
  35. package/packages/client/dist/license/license-client.js +1 -1
  36. package/packages/client/dist/memory/project-memory-writer.js +13 -13
  37. package/packages/client/dist/memory/shared-project-memory-types.d.ts +1 -1
  38. package/packages/client/dist/memory/shared-project-memory-types.js +2 -2
  39. package/packages/client/dist/resolvers/asset-resolver.d.ts +8 -71
  40. package/packages/client/dist/resolvers/remote-resolver.d.ts +7 -69
  41. package/packages/client/dist/resolvers/remote-resolver.js +1 -1
  42. package/packages/client/dist/runner-cli.js +0 -0
  43. package/packages/client/dist/state/project-state-snapshot.js +1 -1
  44. package/packages/client/dist/telemetry/index.d.ts +1 -1
  45. package/packages/client/dist/telemetry/index.js +1 -1
  46. package/packages/client/dist/telemetry/offline-queue.d.ts +12 -2
  47. package/packages/client/dist/telemetry/offline-queue.js +1 -1
  48. package/packages/client/dist/types/index.d.ts +26 -8
  49. package/packages/client/dist/types/index.js +1 -1
  50. package/packages/client/dist/types/shared-public-execution-contract.d.ts +175 -0
  51. package/packages/client/dist/types/shared-public-execution-contract.js +2 -0
  52. package/targets-stubs/antigravity/gemini.md +1 -1
  53. package/targets-stubs/antigravity/skill/SKILL.md +1 -1
  54. package/targets-stubs/claude-code/neocortex-root.agent.yaml +1 -1
  55. package/targets-stubs/claude-code/neocortex-root.md +2 -2
  56. package/targets-stubs/claude-code/neocortex.agent.yaml +1 -1
  57. package/targets-stubs/claude-code/neocortex.md +2 -2
  58. package/targets-stubs/codex/AGENTS.md +16 -6
  59. package/targets-stubs/codex/README.md +24 -0
  60. package/targets-stubs/codex/install-codex.sh +70 -1
  61. package/targets-stubs/codex/neocortex-local.config.toml +17 -0
  62. package/targets-stubs/codex/neocortex.toml +10 -1
  63. package/targets-stubs/cursor/agent.md +2 -2
  64. package/targets-stubs/gemini-cli/agent.md +2 -2
  65. package/targets-stubs/opencode/neocortex-root.md +4 -4
  66. package/targets-stubs/opencode/neocortex.md +1 -1
  67. package/targets-stubs/vscode/neocortex.agent.md +2 -2
  68. package/packages/client/dist/resolvers/local-resolver.d.ts +0 -26
  69. package/packages/client/dist/resolvers/local-resolver.js +0 -8
@@ -3,9 +3,9 @@
3
3
  "bomFormat": "CycloneDX",
4
4
  "specVersion": "1.5",
5
5
  "version": 1,
6
- "serialNumber": "urn:uuid:7d13d6c6-e0d2-4733-8fdd-7532efa6f2a7",
6
+ "serialNumber": "urn:uuid:3f822476-a2ed-4238-b64a-0756b2834aa6",
7
7
  "metadata": {
8
- "timestamp": "2026-07-14T14:38:12.232Z",
8
+ "timestamp": "2026-07-13T20:37:18.185Z",
9
9
  "tools": {
10
10
  "components": [
11
11
  {
@@ -83,10 +83,10 @@
83
83
  "type": "application",
84
84
  "name": "neocortex",
85
85
  "group": "@ornexus",
86
- "version": "4.60.16",
87
- "bom-ref": "@ornexus/neocortex@4.60.16",
86
+ "version": "4.63.3",
87
+ "bom-ref": "@ornexus/neocortex@4.63.3",
88
88
  "author": "OrNexus Team",
89
- "description": "Neocortex v4.60.16 - Orquestrador de Desenvolvimento de Epics & Stories para Claude Code",
89
+ "description": "Neocortex v4.63.3 - Orquestrador de Desenvolvimento de Epics & Stories para Claude Code",
90
90
  "licenses": [
91
91
  {
92
92
  "license": {
@@ -94,7 +94,7 @@
94
94
  }
95
95
  }
96
96
  ],
97
- "purl": "pkg:npm/%40ornexus/neocortex@4.60.16?vcs_url=git%2Bhttps%3A%2F%2Fgithub.com%2FOrNexus-AI%2Fneocortex.git",
97
+ "purl": "pkg:npm/%40ornexus/neocortex@4.63.3?vcs_url=git%2Bhttps%3A%2F%2Fgithub.com%2FOrNexus-AI%2Fneocortex.git",
98
98
  "externalReferences": [
99
99
  {
100
100
  "url": "git+https://github.com/OrNexus-AI/neocortex.git",
@@ -2055,9 +2055,9 @@
2055
2055
  "type": "library",
2056
2056
  "name": "client",
2057
2057
  "group": "@neocortex",
2058
- "version": "4.60.16",
2059
- "bom-ref": "@neocortex/client@4.60.16",
2060
- "purl": "pkg:npm/%40neocortex/client@4.60.16",
2058
+ "version": "4.63.3",
2059
+ "bom-ref": "@neocortex/client@4.63.3",
2060
+ "purl": "pkg:npm/%40neocortex/client@4.63.3",
2061
2061
  "properties": [
2062
2062
  {
2063
2063
  "name": "cdx:npm:package:path",
@@ -2069,9 +2069,9 @@
2069
2069
  "type": "library",
2070
2070
  "name": "shared",
2071
2071
  "group": "@neocortex",
2072
- "version": "4.60.16",
2073
- "bom-ref": "@neocortex/shared@4.60.16",
2074
- "purl": "pkg:npm/%40neocortex/shared@4.60.16",
2072
+ "version": "4.63.3",
2073
+ "bom-ref": "@neocortex/shared@4.63.3",
2074
+ "purl": "pkg:npm/%40neocortex/shared@4.63.3",
2075
2075
  "properties": [
2076
2076
  {
2077
2077
  "name": "cdx:npm:package:path",
@@ -2219,9 +2219,9 @@
2219
2219
  "type": "library",
2220
2220
  "name": "core",
2221
2221
  "group": "@neocortex",
2222
- "version": "4.60.16",
2223
- "bom-ref": "@neocortex/core@4.60.16",
2224
- "purl": "pkg:npm/%40neocortex/core@4.60.16",
2222
+ "version": "0.1.0",
2223
+ "bom-ref": "@neocortex/core@0.1.0",
2224
+ "purl": "pkg:npm/%40neocortex/core@0.1.0",
2225
2225
  "properties": [
2226
2226
  {
2227
2227
  "name": "cdx:npm:package:path",
@@ -2233,9 +2233,9 @@
2233
2233
  "type": "library",
2234
2234
  "name": "server",
2235
2235
  "group": "@neocortex",
2236
- "version": "4.60.16",
2237
- "bom-ref": "@neocortex/server@4.60.16",
2238
- "purl": "pkg:npm/%40neocortex/server@4.60.16",
2236
+ "version": "4.63.3",
2237
+ "bom-ref": "@neocortex/server@4.63.3",
2238
+ "purl": "pkg:npm/%40neocortex/server@4.63.3",
2239
2239
  "properties": [
2240
2240
  {
2241
2241
  "name": "cdx:npm:package:path",
@@ -9376,14 +9376,14 @@
9376
9376
  ],
9377
9377
  "dependencies": [
9378
9378
  {
9379
- "ref": "@ornexus/neocortex@4.60.16",
9379
+ "ref": "@ornexus/neocortex@4.63.3",
9380
9380
  "dependsOn": [
9381
9381
  "@clack/prompts@1.0.1",
9382
9382
  "@modelcontextprotocol/sdk@1.26.0",
9383
- "@neocortex/client@4.60.16",
9384
- "@neocortex/core@4.60.16",
9385
- "@neocortex/server@4.60.16",
9386
- "@neocortex/shared@4.60.16",
9383
+ "@neocortex/client@4.63.3",
9384
+ "@neocortex/core@0.1.0",
9385
+ "@neocortex/server@4.63.3",
9386
+ "@neocortex/shared@4.63.3",
9387
9387
  "better-sqlite3@12.11.1",
9388
9388
  "execa@9.6.1",
9389
9389
  "node-cache@5.1.2",
@@ -9920,16 +9920,16 @@
9920
9920
  "ref": "zod@4.3.6"
9921
9921
  },
9922
9922
  {
9923
- "ref": "@neocortex/client@4.60.16",
9923
+ "ref": "@neocortex/client@4.63.3",
9924
9924
  "dependsOn": [
9925
- "@neocortex/shared@4.60.16",
9925
+ "@neocortex/shared@4.63.3",
9926
9926
  "better-sqlite3@12.11.1",
9927
9927
  "jose@6.2.2",
9928
9928
  "keytar@7.9.0"
9929
9929
  ]
9930
9930
  },
9931
9931
  {
9932
- "ref": "@neocortex/shared@4.60.16"
9932
+ "ref": "@neocortex/shared@4.63.3"
9933
9933
  },
9934
9934
  {
9935
9935
  "ref": "better-sqlite3@12.11.1",
@@ -9966,13 +9966,13 @@
9966
9966
  ]
9967
9967
  },
9968
9968
  {
9969
- "ref": "@neocortex/core@4.60.16",
9969
+ "ref": "@neocortex/core@0.1.0",
9970
9970
  "dependsOn": [
9971
- "@neocortex/shared@4.60.16"
9971
+ "@neocortex/shared@4.63.3"
9972
9972
  ]
9973
9973
  },
9974
9974
  {
9975
- "ref": "@neocortex/server@4.60.16",
9975
+ "ref": "@neocortex/server@4.63.3",
9976
9976
  "dependsOn": [
9977
9977
  "@fastify/cors@10.1.0",
9978
9978
  "@fastify/helmet@13.0.2",
@@ -9,6 +9,38 @@ reason codes and bounded metadata only. Do not attach raw npm lifecycle logs,
9
9
  third-party onboarding output, private local paths, tokens, license keys or
10
10
  customer data to support issues.
11
11
 
12
+ ## Codex local activation diagnostics
13
+
14
+ Codex Neocortex invocations require trusted local access to the activation state
15
+ under `~/.neocortex`. When the client detects that a Codex profile or sandbox
16
+ cannot access or use that local state, it reports public error code
17
+ `CODEX_AUTH_SANDBOX` instead of asking the user to paste activation material into
18
+ a prompt or repository file.
19
+
20
+ Safe operator response:
21
+
22
+ 1. Retry from `codex --profile neocortex-local`, Codex App **Full Access** /
23
+ trusted-local mode, or a local terminal with the same activated user account.
24
+ 2. Share only the bounded error code, reason code and public path label such as
25
+ `~/.neocortex`, `~/.neocortex/config.json` or `~/.neocortex/cache`.
26
+ 3. Do not share raw auth logs, absolute home paths, machine fingerprints,
27
+ activation values, license keys, API keys, JWTs or private URLs.
28
+
29
+ Codex auth outcomes:
30
+
31
+ | Code / reason | Symptom summary | Safe next action |
32
+ | --- | --- | --- |
33
+ | `CODEX_AUTH_SANDBOX` | Codex cannot access or use existing local Neocortex activation. | Switch to the explicit local profile/Full Access/trusted-local mode or run from the local terminal; do not paste credentials into prompts. |
34
+ | `codex-config-inaccessible` | `~/.neocortex` or `~/.neocortex/config.json` is present but blocked by the Codex sandbox/profile. | Grant trusted local access or use the installed `neocortex-local` profile. |
35
+ | `codex-config-unreadable` | Config exists but cannot be parsed/read safely by this Codex runtime. | Retry from trusted local mode and attach only the bounded reason code if support is needed. |
36
+ | `codex-cache-unreadable` | Config has auth material but the local auth cache is blocked or unreadable. | Grant trusted local cache access or run from the local terminal. |
37
+ | `codex-auth-network-denied` | Activation metadata is present but Codex cannot complete auth/API access. | Allow outbound Neocortex auth/API network access in the trusted local session. |
38
+ | `codex-config-missing` / `NOT_CONFIGURED` | No activation exists in the selected environment. | Activate that environment intentionally from a trusted shell, or switch back to the already activated local profile. |
39
+
40
+ Release smoke for this path is documented in
41
+ `docs/verification/P203-codex-local-activation-smoke.md` and must remain
42
+ credential-free.
43
+
12
44
  ## Optional tool diagnostics
13
45
 
14
46
  Default npm lifecycle installs do not run CodeRabbit or similar third-party
@@ -105,3 +137,4 @@ examples only; see `docs/install/linux-global-install.md` for recovery guidance.
105
137
  | --- | --- | --- |
106
138
  | `P177-REQ-05` | `P177-CON-DIAG-01`, `P177-CON-INSTALLER-01`, `P177-CON-OPT-01` | `P177-VAL-05` / `[P177-EV-DIAGNOSTICS]` |
107
139
  | `P177-REQ-07` | `P177-CON-CLI-01`, `P177-CON-OPT-01`, `P177-CON-DIAG-01` | `P177-VAL-07` / `[P177-EV-DOCS]` |
140
+ | `P203-REQ-06` | `P203-CLI-02`, `P203-RUN-01`, `P203-RUN-02`, `P203-SEC-02` | `[P203-EV-SMOKE]` / `docs/verification/P203-codex-local-activation-smoke.md` |
package/install.ps1 CHANGED
@@ -17,7 +17,7 @@ param(
17
17
  [string]$ServerUrl = ('https://{0}.{1}.{2}' -f 'api','neocortex','sh')
18
18
  )
19
19
 
20
- $VERSION = "4.60.16"
20
+ $VERSION = "4.63.3"
21
21
 
22
22
  # =============================================================================
23
23
  # CONFIGURACOES
@@ -35,8 +35,8 @@ $DEBUG_MODE = $Debug
35
35
  $SKIP_PROJECT_DIRS = $SkipProject
36
36
  $QUIET_MODE = $Quiet
37
37
  $NO_BANNER = $NoBanner
38
- # LOCAL_MODE removed (Epic 50): thin-client ALWAYS, zero IP on client
39
- $LOCAL_MODE = $false
38
+ # Thin-client mode is mandatory. Customer installer paths never read core/ or
39
+ # development targets/ from a source checkout.
40
40
  $NEOCORTEX_SERVER_URL = $ServerUrl
41
41
 
42
42
  function Test-Interactive {
@@ -126,7 +126,6 @@ function Test-NeocortexSourceProject {
126
126
  }
127
127
 
128
128
  if ($packageJson.name -ne "@ornexus/neocortex") { return $false }
129
- if (-not (Test-Path (Join-Path $Path "core") -PathType Container)) { return $false }
130
129
  if (-not (Test-Path (Join-Path $Path "packages\server") -PathType Container)) { return $false }
131
130
  if (-not (Test-Path (Join-Path $Path "targets-stubs") -PathType Container)) { return $false }
132
131
  if (-not (Test-Path (Join-Path $Path "install.ps1") -PathType Leaf)) { return $false }
@@ -139,15 +138,10 @@ function Resolve-TargetDir {
139
138
 
140
139
  $stubName = if ($Target -eq "gemini") { "gemini-cli" } else { $Target }
141
140
  $stubDir = Join-Path $script:SourceDir "targets-stubs\$stubName"
142
- $devDir = Join-Path $script:SourceDir "targets\$stubName"
143
141
 
144
142
  if (Test-Path $stubDir -PathType Container) { return $stubDir }
145
- if ((Test-NeocortexSourceProject $script:SourceDir) -and (Test-Path $devDir -PathType Container)) {
146
- Write-Dbg "Fallback dev targets/ para $Target`: $devDir"
147
- return $devDir
148
- }
149
143
 
150
- Write-Warn "$Target (adapter nao encontrado; paths tentados: $stubDir, $devDir)"
144
+ Write-Warn "$Target (adapter publico nao encontrado: $stubDir)"
151
145
  return $null
152
146
  }
153
147
 
@@ -917,55 +911,27 @@ function Verify-Installation {
917
911
  }
918
912
  }
919
913
 
920
- if ($LOCAL_MODE) {
921
- # --- Layer 3: Step directories (local mode only) ---
922
- foreach ($dir in @("steps-c", "steps-e", "steps-p", "steps-r", "steps-u")) {
923
- $dirPath = Join-Path $script:DestDir $dir
924
- if (-not (Test-Path $dirPath -PathType Container)) {
925
- $report += @{ Status = "FAIL"; Detail = "$dir/ (diretorio nao encontrado)" }
926
- $fails++
927
- } else {
928
- $mdCount = (Get-ChildItem -Path $dirPath -Filter "*.md" -File -ErrorAction SilentlyContinue).Count
929
- if ($mdCount -eq 0) {
930
- $report += @{ Status = "WARN"; Detail = "$dir/ (vazio - nenhum arquivo .md)" }
931
- $warns++
932
- } else {
933
- $report += @{ Status = "OK"; Detail = "$dir/ ($mdCount arquivos)" }
934
- }
935
- }
936
- }
937
-
938
- # --- Layer 3b: Core directory (local mode only) ---
939
- $corePath = Join-Path $script:DestDir "core"
940
- if (-not (Test-Path $corePath -PathType Container)) {
941
- $report += @{ Status = "FAIL"; Detail = "core/ (diretorio nao encontrado)" }
942
- $fails++
943
- } else {
944
- $report += @{ Status = "OK"; Detail = "core/" }
945
- }
914
+ # --- Layer 3: Thin client config (remote mode) ---
915
+ $configFile = "$env:USERPROFILE\.neocortex\config.json"
916
+ if (Test-Path $configFile -PathType Leaf) {
917
+ $report += @{ Status = "OK"; Detail = "~\.neocortex\config.json (thin client configured)" }
946
918
  } else {
947
- # --- Layer 3: Thin client config (remote mode) ---
948
- $configFile = "$env:USERPROFILE\.neocortex\config.json"
949
- if (Test-Path $configFile -PathType Leaf) {
950
- $report += @{ Status = "OK"; Detail = "~\.neocortex\config.json (thin client configured)" }
951
- } else {
952
- $report += @{ Status = "WARN"; Detail = "~\.neocortex\config.json (nao encontrado)" }
953
- $warns++
954
- }
919
+ $report += @{ Status = "WARN"; Detail = "~\.neocortex\config.json (nao encontrado)" }
920
+ $warns++
921
+ }
955
922
 
956
- # Verify NO IP directories exist
957
- $ipFound = $false
958
- foreach ($dir in @("core", "steps-c", "steps-e", "steps-p", "steps-r", "steps-u")) {
959
- if (Test-Path (Join-Path $script:DestDir $dir) -PathType Container) {
960
- $report += @{ Status = "WARN"; Detail = "$dir/ ainda existe (deveria ter sido removido)" }
961
- $warns++
962
- $ipFound = $true
963
- }
964
- }
965
- if (-not $ipFound) {
966
- $report += @{ Status = "OK"; Detail = "Zero IP no filesystem (modo remoto)" }
923
+ # Verify NO IP directories exist
924
+ $ipFound = $false
925
+ foreach ($dir in @("core", "steps-c", "steps-e", "steps-p", "steps-r", "steps-u")) {
926
+ if (Test-Path (Join-Path $script:DestDir $dir) -PathType Container) {
927
+ $report += @{ Status = "WARN"; Detail = "$dir/ ainda existe (deveria ter sido removido)" }
928
+ $warns++
929
+ $ipFound = $true
967
930
  }
968
931
  }
932
+ if (-not $ipFound) {
933
+ $report += @{ Status = "OK"; Detail = "Zero IP no filesystem (modo remoto)" }
934
+ }
969
935
 
970
936
  # --- Layer 4: Tool availability (Story 66.4 AC1/AC2) ---
971
937
  $claudeCmd = Get-Command claude -ErrorAction SilentlyContinue
@@ -1161,21 +1127,8 @@ function Install-Core {
1161
1127
  return $false
1162
1128
  }
1163
1129
 
1164
- if ($LOCAL_MODE) {
1165
- # Modo local: copiar IP completa (comportamento legado para devs)
1166
- $coreSource = Join-Path $script:SourceDir "core"
1167
- if (Test-Path $coreSource -PathType Container) {
1168
- Copy-Item -Path $coreSource -Destination "$script:DestDir\" -Recurse -Force -ErrorAction SilentlyContinue
1169
- }
1170
- $r = Copy-Silent "$($script:SourceDir)\package.json" "$script:DestDir\"
1171
- if (-not $r) { Write-Fail "Falha ao copiar package.json (Install-Core)" }
1172
- $r = Copy-Silent "$($script:SourceDir)\README.md" "$script:DestDir\"
1173
- if (-not $r) { Write-Fail "Falha ao copiar README.md (Install-Core)" }
1174
- } else {
1175
- # Tier 3 Remote Mode: NAO copiar IP
1176
- # Nota: Invoke-AutoCleanupLegacy ja rodou no inicio - aqui apenas config
1177
- Set-ThinClientConfig
1178
- }
1130
+ # Thin-client only: configure public client state and never copy source assets.
1131
+ Set-ThinClientConfig
1179
1132
 
1180
1133
  # --- Version-aware cache purge on upgrade (Epic 62 - GAP 2+3) ---
1181
1134
  $pkgJsonPath = Join-Path $script:SourceDir "package.json"
@@ -1215,11 +1168,7 @@ function Install-Core {
1215
1168
  Write-Utf8NoBom -Path "$script:DestDir\.version" -Content $pkgVersion
1216
1169
  }
1217
1170
 
1218
- if ($LOCAL_MODE) {
1219
- Write-Ok "Core instalado (standards, templates, scripts) [modo local]"
1220
- } else {
1221
- Write-Ok "Remote mode configured (thin client ready)"
1222
- }
1171
+ Write-Ok "Remote mode configured (thin client ready)"
1223
1172
  return $true
1224
1173
  }
1225
1174
 
@@ -1228,38 +1177,8 @@ function Install-Core {
1228
1177
  # =============================================================================
1229
1178
 
1230
1179
  function Install-Skills {
1231
- $script:SkillsDir = "$script:ClaudeDir\skills"
1232
- $script:SkillsDest = "$script:SkillsDir\neocortex"
1233
- $skillsSource = "$script:SourceDir\core\skills"
1234
-
1235
- # Tier 3 Remote Mode: skills vem do server, nao copiar
1236
- if (-not $LOCAL_MODE) {
1237
- Write-Ok "Skills: delivered by remote server"
1238
- return $true
1239
- }
1240
-
1241
- if (-not (Test-Path $skillsSource -PathType Container)) { return $true }
1242
-
1243
- New-Item -ItemType Directory -Path $script:SkillsDir -Force | Out-Null
1244
-
1245
- if (Test-Path $script:SkillsDest) {
1246
- Remove-Item -Path $script:SkillsDest -Recurse -Force -ErrorAction SilentlyContinue
1247
- }
1248
-
1249
- try {
1250
- Copy-Item -Path $skillsSource -Destination $script:SkillsDest -Recurse -Force
1251
-
1252
- # Count skills
1253
- $skillCount = 0
1254
- Get-ChildItem "$script:SkillsDest\step-skills\*\*.md", "$script:SkillsDest\domain-skills\*\*.md" -File -ErrorAction SilentlyContinue |
1255
- Where-Object { $_.Name -ne "_template.md" } | ForEach-Object { $skillCount++ }
1256
-
1257
- Write-Ok "Skills instaladas ($skillCount skills) [modo local]"
1258
- return $true
1259
- } catch {
1260
- Write-Fail "Falha ao copiar skills"
1261
- return $false
1262
- }
1180
+ Write-Ok "Skills: delivered by remote server"
1181
+ return $true
1263
1182
  }
1264
1183
 
1265
1184
  # =============================================================================
@@ -1268,9 +1187,6 @@ function Install-Skills {
1268
1187
 
1269
1188
  function Install-Agent {
1270
1189
  $claudeTargetDir = Join-Path $script:SourceDir "targets-stubs\claude-code"
1271
- if ((-not (Test-Path $claudeTargetDir)) -and (Test-NeocortexSourceProject $script:SourceDir) -and (Test-Path (Join-Path $script:SourceDir "targets\claude-code") -PathType Container)) {
1272
- $claudeTargetDir = Join-Path $script:SourceDir "targets\claude-code"
1273
- }
1274
1190
  if (-not (Test-Path $claudeTargetDir)) {
1275
1191
  $claudeTargetDir = $script:SourceDir
1276
1192
  }
@@ -1319,25 +1235,6 @@ function Install-Agent {
1319
1235
  Remove-Item "$script:DestDir\workflow.md" -Force -ErrorAction SilentlyContinue
1320
1236
  }
1321
1237
 
1322
- if ($LOCAL_MODE) {
1323
- # Modo local: copiar IP completa (comportamento legado para devs)
1324
- $r = Copy-Silent "$($script:SourceDir)\package.json" "$script:DestDir\"
1325
- if (-not $r) { Write-Fail "Falha ao copiar package.json" }
1326
- $r = Copy-Silent "$($script:SourceDir)\README.md" "$script:DestDir\"
1327
- if (-not $r) { Write-Fail "Falha ao copiar README.md" }
1328
-
1329
- $coreSource = Join-Path $script:SourceDir "core"
1330
- if (Test-Path $coreSource -PathType Container) {
1331
- Copy-Item -Path $coreSource -Destination "$script:DestDir\" -Recurse -Force -ErrorAction SilentlyContinue
1332
- }
1333
-
1334
- foreach ($folder in @("steps-c", "steps-e", "steps-p", "steps-r", "steps-u")) {
1335
- $stepSrc = "$($script:SourceDir)\core\steps\$folder"
1336
- if (Test-Path $stepSrc -PathType Container) {
1337
- Copy-Item -Path $stepSrc -Destination "$script:DestDir\" -Recurse -Force -ErrorAction SilentlyContinue
1338
- }
1339
- }
1340
- }
1341
1238
  # Tier 3 Remote Mode: apenas 2 arquivos de interface (stubs)
1342
1239
 
1343
1240
  return ($script:Errors -eq 0)
@@ -1560,13 +1457,6 @@ function Install-Targets {
1560
1457
  if (Test-Path "$cursorTargetDir\mcp.json") {
1561
1458
  Merge-JsonMcpConfig -StubFile "$cursorTargetDir\mcp.json" -DestFile "$homeDir\.cursor\mcp.json" -RootKey "mcpServers"
1562
1459
  }
1563
- # Skills
1564
- $skillsSource = Join-Path $script:SourceDir "core\skills"
1565
- if (Test-Path $skillsSource -PathType Container) {
1566
- New-Item -ItemType Directory -Path "$homeDir\.cursor\skills" -Force | Out-Null
1567
- Copy-Item -Path "$skillsSource\*" -Destination "$homeDir\.cursor\skills\" -Recurse -Force -ErrorAction SilentlyContinue
1568
- }
1569
-
1570
1460
  Write-Ok "cursor"
1571
1461
  $script:TargetResults += "$target`:OK"
1572
1462
  $script:TargetCount++
@@ -1607,12 +1497,6 @@ function Install-Targets {
1607
1497
  if (Test-Path "$vscodeTargetDir\copilot-instructions.md") {
1608
1498
  Copy-Item -Path "$vscodeTargetDir\copilot-instructions.md" -Destination "$homeDir\.github\copilot-instructions.md" -Force
1609
1499
  }
1610
- $skillsSource = Join-Path $script:SourceDir "core\skills"
1611
- if (Test-Path $skillsSource -PathType Container) {
1612
- New-Item -ItemType Directory -Path "$homeDir\.github\skills" -Force | Out-Null
1613
- Copy-Item -Path "$skillsSource\*" -Destination "$homeDir\.github\skills\" -Recurse -Force -ErrorAction SilentlyContinue
1614
- }
1615
-
1616
1500
  Write-Ok "vscode"
1617
1501
  $script:TargetResults += "$target`:OK"
1618
1502
  $script:TargetCount++
@@ -1646,12 +1530,6 @@ function Install-Targets {
1646
1530
  # Additive merge into ~/.gemini/settings.json (root key is "mcpServers")
1647
1531
  Merge-JsonMcpConfig -StubFile "$geminiTargetDir\settings-mcp.json" -DestFile "$geminiHome\settings.json" -RootKey "mcpServers"
1648
1532
  }
1649
- $skillsSource = Join-Path $script:SourceDir "core\skills"
1650
- if (Test-Path $skillsSource -PathType Container) {
1651
- New-Item -ItemType Directory -Path "$geminiHome\skills" -Force | Out-Null
1652
- Copy-Item -Path "$skillsSource\*" -Destination "$geminiHome\skills\" -Recurse -Force -ErrorAction SilentlyContinue
1653
- }
1654
-
1655
1533
  Write-Ok "gemini"
1656
1534
  $script:TargetResults += "$target`:OK"
1657
1535
  $script:TargetCount++
@@ -1712,13 +1590,6 @@ function Install-Targets {
1712
1590
  if (Test-Path "$antiTargetDir\gemini.md") {
1713
1591
  Copy-Item -Path "$antiTargetDir\gemini.md" -Destination "$homeDir\GEMINI.md" -Force
1714
1592
  }
1715
- $skillsSource = Join-Path $script:SourceDir "core\skills"
1716
- if (Test-Path $skillsSource -PathType Container) {
1717
- $skillsDest = "$homeDir\.agent\skills\neocortex\skills"
1718
- New-Item -ItemType Directory -Path $skillsDest -Force | Out-Null
1719
- Copy-Item -Path "$skillsSource\*" -Destination "$skillsDest\" -Recurse -Force -ErrorAction SilentlyContinue
1720
- }
1721
-
1722
1593
  Write-Ok "antigravity"
1723
1594
  $script:TargetResults += "$target`:OK"
1724
1595
  $script:TargetCount++
@@ -1811,7 +1682,7 @@ function New-ProjectDirectories {
1811
1682
 
1812
1683
  if (Test-NeocortexSourceProject -Path $projectDir) {
1813
1684
  Write-Warn "Recusando -CreateProject dentro do repo fonte do Neocortex"
1814
- Write-Warn "Isso preserva core/ e arquivos de desenvolvimento locais"
1685
+ Write-Warn "Isso preserva arquivos de desenvolvimento locais"
1815
1686
  return
1816
1687
  }
1817
1688
 
@@ -1835,18 +1706,17 @@ function New-ProjectDirectories {
1835
1706
  New-Item -ItemType Directory -Path $_ -Force | Out-Null
1836
1707
  }
1837
1708
 
1838
- # State template
1839
- $stateTemplate = Join-Path $script:SourceDir "core\data\state-template.json"
1709
+ # Public state shell. Never source project state from core/.
1840
1710
  $stateTarget = "$projectDir\.neocortex\state.json"
1841
- if (-not (Test-Path $stateTarget) -and (Test-Path $stateTemplate)) {
1842
- Copy-Item -Path $stateTemplate -Destination $stateTarget -Force
1843
- }
1844
-
1845
- # Core (ONLY in local mode)
1846
- $coreSource = Join-Path $script:SourceDir "core"
1847
- if ($LOCAL_MODE -and (Test-Path $coreSource -PathType Container)) {
1848
- New-Item -ItemType Directory -Path "$projectDir\core" -Force | Out-Null
1849
- Copy-Item -Path "$coreSource\*" -Destination "$projectDir\core\" -Recurse -Force
1711
+ if (-not (Test-Path $stateTarget)) {
1712
+ $stateShell = @'
1713
+ {
1714
+ "schema_version": 1,
1715
+ "stories": {},
1716
+ "epics": {}
1717
+ }
1718
+ '@
1719
+ Write-Utf8NoBom -Path $stateTarget -Content $stateShell
1850
1720
  }
1851
1721
 
1852
1722
  # Target-specific files
@@ -1871,30 +1741,8 @@ function New-ProjectDirectories {
1871
1741
  Remove-Item "$agentDest\workflow.md" -Force -ErrorAction SilentlyContinue
1872
1742
  }
1873
1743
 
1874
- if ($LOCAL_MODE) {
1875
- # Modo local: copiar IP completa (comportamento legado)
1876
- $r = Copy-Silent "$($script:SourceDir)\package.json" "$agentDest\"
1877
- if (-not $r) { Write-Fail "Falha ao copiar package.json (projeto)" }
1878
- $r = Copy-Silent "$($script:SourceDir)\README.md" "$agentDest\"
1879
- if (-not $r) { Write-Fail "Falha ao copiar README.md (projeto)" }
1880
- New-Item -ItemType Directory -Path "$agentDest\core" -Force | Out-Null
1881
- Copy-Item -Path "$coreSource\*" -Destination "$agentDest\core\" -Recurse -Force -ErrorAction SilentlyContinue
1882
- foreach ($folder in @("steps-c", "steps-e", "steps-p", "steps-r", "steps-u")) {
1883
- $stepSrc = "$($script:SourceDir)\core\steps\$folder"
1884
- if (Test-Path $stepSrc -PathType Container) {
1885
- New-Item -ItemType Directory -Path "$agentDest\$folder" -Force | Out-Null
1886
- Copy-Item -Path "$stepSrc\*" -Destination "$agentDest\$folder\" -Recurse -Force -ErrorAction SilentlyContinue
1887
- }
1888
- }
1889
- $skillsSource = Join-Path $script:SourceDir "core\skills"
1890
- if (Test-Path $skillsSource -PathType Container) {
1891
- New-Item -ItemType Directory -Path "$projectDir\.claude\skills\neocortex" -Force | Out-Null
1892
- Copy-Item -Path "$skillsSource\*" -Destination "$projectDir\.claude\skills\neocortex\" -Recurse -Force -ErrorAction SilentlyContinue
1893
- }
1894
- } else {
1895
- # Tier 3 Remote Mode: limpar IP de versoes anteriores no projeto
1896
- Invoke-AutoCleanupLegacyProject -ProjectDir $projectDir
1897
- }
1744
+ # Thin-client mode: clean protected files from legacy installs.
1745
+ Invoke-AutoCleanupLegacyProject -ProjectDir $projectDir
1898
1746
  $targetSummary += "claude-code"
1899
1747
  }
1900
1748
  }
@@ -1917,11 +1765,6 @@ function New-ProjectDirectories {
1917
1765
  New-Item -ItemType Directory -Path "$projectDir\.cursor" -Force | Out-Null
1918
1766
  Merge-JsonMcpConfig -StubFile "$cursorTargetDir\mcp.json" -DestFile "$projectDir\.cursor\mcp.json" -RootKey "mcpServers"
1919
1767
  }
1920
- $skillsSource = Join-Path $script:SourceDir "core\skills"
1921
- if (Test-Path $skillsSource -PathType Container) {
1922
- New-Item -ItemType Directory -Path "$projectDir\.cursor\skills" -Force | Out-Null
1923
- Copy-Item -Path "$skillsSource\*" -Destination "$projectDir\.cursor\skills\" -Recurse -Force -ErrorAction SilentlyContinue
1924
- }
1925
1768
  $targetSummary += "cursor"
1926
1769
  }
1927
1770
  }
@@ -1949,11 +1792,6 @@ function New-ProjectDirectories {
1949
1792
  if (Test-Path "$vscodeTargetDir\copilot-instructions.md") {
1950
1793
  Copy-Item -Path "$vscodeTargetDir\copilot-instructions.md" -Destination "$projectDir\.github\copilot-instructions.md" -Force
1951
1794
  }
1952
- $skillsSource = Join-Path $script:SourceDir "core\skills"
1953
- if (Test-Path $skillsSource -PathType Container) {
1954
- New-Item -ItemType Directory -Path "$projectDir\.github\skills" -Force | Out-Null
1955
- Copy-Item -Path "$skillsSource\*" -Destination "$projectDir\.github\skills\" -Recurse -Force -ErrorAction SilentlyContinue
1956
- }
1957
1795
  $targetSummary += "vscode"
1958
1796
  }
1959
1797
  }
@@ -1986,11 +1824,6 @@ function New-ProjectDirectories {
1986
1824
  New-Item -ItemType Directory -Path "$projectDir\.codex\agents" -Force | Out-Null
1987
1825
  Copy-Item -Path "$codexTargetDir\neocortex.toml" -Destination "$projectDir\.codex\agents\neocortex.toml" -Force
1988
1826
  }
1989
- $skillsSource = Join-Path $script:SourceDir "core\skills"
1990
- if (Test-Path $skillsSource -PathType Container) {
1991
- New-Item -ItemType Directory -Path "$projectDir\.agents\skills" -Force | Out-Null
1992
- Copy-Item -Path "$skillsSource\*" -Destination "$projectDir\.agents\skills\" -Recurse -Force -ErrorAction SilentlyContinue
1993
- }
1994
1827
  $targetSummary += "codex"
1995
1828
  }
1996
1829
  }
@@ -2010,12 +1843,6 @@ function New-ProjectDirectories {
2010
1843
  Copy-Item -Path "$antiTargetDir\workflows\*.md" -Destination "$projectDir\.agent\workflows\" -Force -ErrorAction SilentlyContinue
2011
1844
  }
2012
1845
  if (Test-Path "$antiTargetDir\gemini.md") { Copy-Item -Path "$antiTargetDir\gemini.md" -Destination "$projectDir\GEMINI.md" -Force }
2013
- $skillsSource = Join-Path $script:SourceDir "core\skills"
2014
- if (Test-Path $skillsSource -PathType Container) {
2015
- $skillsDest = "$projectDir\.agent\skills\neocortex\skills"
2016
- New-Item -ItemType Directory -Path $skillsDest -Force | Out-Null
2017
- Copy-Item -Path "$skillsSource\*" -Destination "$skillsDest\" -Recurse -Force -ErrorAction SilentlyContinue
2018
- }
2019
1846
  $targetSummary += "antigravity"
2020
1847
  }
2021
1848
  }
@@ -2093,23 +1920,16 @@ function Show-Result {
2093
1920
  Write-Host " $okTargets plataforma(s) instalada(s)" -ForegroundColor DarkGray
2094
1921
  }
2095
1922
 
2096
- if ($LOCAL_MODE) {
2097
- Write-Host " Modo: Local (IP completa copiada)" -ForegroundColor DarkGray
2098
- Write-Host " Locais:" -ForegroundColor DarkGray
2099
- Write-Host " Agente: ~\.claude\agents\neocortex\" -ForegroundColor DarkGray
2100
- Write-Host " Skills: ~\.claude\skills\neocortex\" -ForegroundColor DarkGray
2101
- } else {
2102
- Write-Host " Mode: Remote (thin client)" -ForegroundColor DarkGray
2103
- Write-Host " Status: Ready to activate" -ForegroundColor DarkGray
2104
- Write-Host ""
2105
- Write-Host " Activate your license:" -ForegroundColor DarkGray
2106
- Write-Host " neocortex activate YOUR-LICENSE-KEY" -ForegroundColor Cyan
2107
- Write-Host ""
2108
- Write-Host " Get your key at: https://neocortex.sh/portal/login" -ForegroundColor DarkGray
2109
- Write-Host ""
2110
- Write-Host " After activation:" -ForegroundColor DarkGray
2111
- Write-Host " @neocortex *menu" -ForegroundColor Cyan
2112
- }
1923
+ Write-Host " Mode: Remote (thin client)" -ForegroundColor DarkGray
1924
+ Write-Host " Status: Ready to activate" -ForegroundColor DarkGray
1925
+ Write-Host ""
1926
+ Write-Host " Activate your license:" -ForegroundColor DarkGray
1927
+ Write-Host " neocortex activate YOUR-LICENSE-KEY" -ForegroundColor Cyan
1928
+ Write-Host ""
1929
+ Write-Host " Get your key at: https://neocortex.sh/portal/login" -ForegroundColor DarkGray
1930
+ Write-Host ""
1931
+ Write-Host " After activation:" -ForegroundColor DarkGray
1932
+ Write-Host " @neocortex *menu" -ForegroundColor Cyan
2113
1933
  Write-Host ""
2114
1934
  Write-Host " Proximo passo:" -ForegroundColor DarkGray
2115
1935
  Write-Host " @neocortex *init @docs/epics.md" -ForegroundColor Cyan