aios-core 4.0.4 → 4.2.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 (107) hide show
  1. package/.aios-core/cli/commands/migrate/analyze.js +6 -6
  2. package/.aios-core/cli/commands/migrate/backup.js +2 -2
  3. package/.aios-core/cli/commands/migrate/execute.js +4 -4
  4. package/.aios-core/cli/commands/migrate/index.js +5 -5
  5. package/.aios-core/cli/commands/migrate/rollback.js +6 -6
  6. package/.aios-core/cli/commands/migrate/update-imports.js +2 -2
  7. package/.aios-core/cli/commands/migrate/validate.js +2 -2
  8. package/.aios-core/cli/commands/pro/index.js +52 -0
  9. package/.aios-core/cli/index.js +1 -1
  10. package/.aios-core/core/ids/registry-updater.js +29 -3
  11. package/.aios-core/core/migration/migration-config.yaml +2 -2
  12. package/.aios-core/core/migration/module-mapping.yaml +2 -2
  13. package/.aios-core/core/registry/README.md +2 -2
  14. package/.aios-core/core/synapse/context/context-builder.js +34 -0
  15. package/.aios-core/core/synapse/diagnostics/collectors/consistency-collector.js +168 -0
  16. package/.aios-core/core/synapse/diagnostics/collectors/hook-collector.js +129 -0
  17. package/.aios-core/core/synapse/diagnostics/collectors/manifest-collector.js +82 -0
  18. package/.aios-core/core/synapse/diagnostics/collectors/output-analyzer.js +134 -0
  19. package/.aios-core/core/synapse/diagnostics/collectors/pipeline-collector.js +75 -0
  20. package/.aios-core/core/synapse/diagnostics/collectors/quality-collector.js +252 -0
  21. package/.aios-core/core/synapse/diagnostics/collectors/relevance-matrix.js +174 -0
  22. package/.aios-core/core/synapse/diagnostics/collectors/safe-read-json.js +31 -0
  23. package/.aios-core/core/synapse/diagnostics/collectors/session-collector.js +102 -0
  24. package/.aios-core/core/synapse/diagnostics/collectors/timing-collector.js +126 -0
  25. package/.aios-core/core/synapse/diagnostics/collectors/uap-collector.js +83 -0
  26. package/.aios-core/core/synapse/diagnostics/report-formatter.js +484 -0
  27. package/.aios-core/core/synapse/diagnostics/synapse-diagnostics.js +95 -0
  28. package/.aios-core/core/synapse/engine.js +73 -20
  29. package/.aios-core/core/synapse/runtime/hook-runtime.js +60 -0
  30. package/.aios-core/core-config.yaml +6 -0
  31. package/.aios-core/data/agent-config-requirements.yaml +2 -2
  32. package/.aios-core/data/aios-kb.md +4 -4
  33. package/.aios-core/data/entity-registry.yaml +210 -10
  34. package/.aios-core/data/registry-update-log.jsonl +52 -0
  35. package/.aios-core/development/agents/architect.md +10 -10
  36. package/.aios-core/development/agents/devops.md +93 -50
  37. package/.aios-core/development/agents/qa.md +94 -40
  38. package/.aios-core/development/agents/ux-design-expert.md +25 -25
  39. package/.aios-core/development/scripts/activation-runtime.js +63 -0
  40. package/.aios-core/development/scripts/generate-greeting.js +9 -8
  41. package/.aios-core/development/scripts/unified-activation-pipeline.js +102 -2
  42. package/.aios-core/development/tasks/{db-expansion-pack-integration.md → db-squad-integration.md} +5 -5
  43. package/.aios-core/development/tasks/{integrate-expansion-pack.md → integrate-squad.md} +2 -2
  44. package/.aios-core/development/tasks/next.md +3 -3
  45. package/.aios-core/development/tasks/pr-automation.md +2 -2
  46. package/.aios-core/development/tasks/publish-npm.md +257 -0
  47. package/.aios-core/development/tasks/release-management.md +4 -4
  48. package/.aios-core/development/tasks/setup-github.md +1 -1
  49. package/.aios-core/development/tasks/squad-creator-migrate.md +1 -1
  50. package/.aios-core/development/tasks/squad-creator-sync-ide-command.md +14 -14
  51. package/.aios-core/development/tasks/update-aios.md +1 -1
  52. package/.aios-core/development/tasks/validate-next-story.md +99 -2
  53. package/.aios-core/docs/standards/AIOS-COLOR-PALETTE-QUICK-REFERENCE.md +1 -1
  54. package/.aios-core/docs/standards/AIOS-COLOR-PALETTE-V2.1.md +5 -5
  55. package/.aios-core/docs/standards/AIOS-LIVRO-DE-OURO-V2.1-COMPLETE.md +21 -21
  56. package/.aios-core/docs/standards/AIOS-LIVRO-DE-OURO-V2.2-SUMMARY.md +25 -25
  57. package/.aios-core/docs/standards/OPEN-SOURCE-VS-SERVICE-DIFFERENCES.md +4 -4
  58. package/.aios-core/docs/standards/QUALITY-GATES-SPECIFICATION.md +3 -3
  59. package/.aios-core/docs/standards/STANDARDS-INDEX.md +13 -13
  60. package/.aios-core/docs/standards/STORY-TEMPLATE-V2-SPECIFICATION.md +1 -1
  61. package/.aios-core/framework-config.yaml +4 -0
  62. package/.aios-core/infrastructure/scripts/codex-skills-sync/index.js +182 -0
  63. package/.aios-core/infrastructure/scripts/codex-skills-sync/validate.js +172 -0
  64. package/.aios-core/infrastructure/scripts/ide-sync/README.md +14 -0
  65. package/.aios-core/infrastructure/scripts/ide-sync/index.js +6 -0
  66. package/.aios-core/infrastructure/scripts/tool-resolver.js +4 -4
  67. package/.aios-core/infrastructure/scripts/validate-paths.js +142 -0
  68. package/.aios-core/infrastructure/templates/aios-sync.yaml.template +11 -11
  69. package/.aios-core/infrastructure/templates/github-workflows/README.md +1 -1
  70. package/.aios-core/install-manifest.yaml +193 -109
  71. package/.aios-core/local-config.yaml.template +2 -0
  72. package/.aios-core/manifests/agents.csv +29 -1
  73. package/.aios-core/manifests/tasks.csv +80 -3
  74. package/.aios-core/product/README.md +2 -2
  75. package/.aios-core/product/data/integration-patterns.md +1 -1
  76. package/.aios-core/product/templates/ide-rules/cline-rules.md +1 -1
  77. package/.aios-core/product/templates/ide-rules/codex-rules.md +65 -0
  78. package/.aios-core/product/templates/ide-rules/copilot-rules.md +1 -1
  79. package/.aios-core/product/templates/ide-rules/roo-rules.md +1 -1
  80. package/.aios-core/user-guide.md +15 -14
  81. package/.aios-core/workflow-intelligence/engine/output-formatter.js +1 -1
  82. package/.claude/hooks/synapse-engine.js +9 -20
  83. package/README.md +14 -7
  84. package/bin/aios-init.js +255 -184
  85. package/bin/aios-minimal.js +2 -2
  86. package/bin/aios.js +4 -4
  87. package/package.json +6 -1
  88. package/packages/aios-pro-cli/bin/aios-pro.js +75 -2
  89. package/packages/aios-pro-cli/package.json +5 -1
  90. package/packages/aios-pro-cli/src/recover.js +100 -0
  91. package/packages/installer/src/__tests__/performance-benchmark.js +382 -0
  92. package/packages/installer/src/config/ide-configs.js +12 -1
  93. package/packages/installer/src/config/templates/core-config-template.js +2 -2
  94. package/packages/installer/src/installer/aios-core-installer.js +2 -2
  95. package/packages/installer/src/installer/file-hasher.js +97 -0
  96. package/packages/installer/src/installer/post-install-validator.js +41 -1
  97. package/packages/installer/src/pro/pro-scaffolder.js +335 -0
  98. package/packages/installer/src/utils/aios-colors.js +2 -2
  99. package/packages/installer/src/wizard/feedback.js +1 -1
  100. package/packages/installer/src/wizard/ide-config-generator.js +2 -2
  101. package/packages/installer/src/wizard/index.js +58 -19
  102. package/packages/installer/src/wizard/pro-setup.js +931 -0
  103. package/packages/installer/src/wizard/questions.js +20 -14
  104. package/packages/installer/src/wizard/validators.js +1 -1
  105. package/scripts/code-intel-health-check.js +343 -0
  106. package/scripts/package-synapse.js +323 -0
  107. package/scripts/validate-package-completeness.js +317 -0
@@ -1,3 +1,6 @@
1
+ // SYN-14: Boot time captured before ANY require — measures cold start
2
+ const _BOOT_TIME = process.hrtime.bigint();
3
+
1
4
  /**
2
5
  * Unified Activation Pipeline - Single Entry Point for All 12 Agents
3
6
  *
@@ -38,6 +41,7 @@
38
41
 
39
42
  const path = require('path');
40
43
  const fs = require('fs').promises;
44
+ const fsSync = require('fs');
41
45
  const yaml = require('js-yaml');
42
46
 
43
47
  const GreetingBuilder = require('./greeting-builder');
@@ -158,7 +162,7 @@ class UnifiedActivationPipeline {
158
162
  // Race: full pipeline vs timeout (clear timer to prevent leak)
159
163
  const { promise: timeoutPromise, timerId } = this._timeoutFallback(agentId, pipelineTimeout);
160
164
  const result = await Promise.race([
161
- this._runPipeline(agentId, options, coreConfig),
165
+ this._runPipeline(agentId, options, coreConfig, startTime),
162
166
  timeoutPromise,
163
167
  ]);
164
168
  clearTimeout(timerId);
@@ -198,7 +202,7 @@ class UnifiedActivationPipeline {
198
202
  * @param {Object} coreConfig - Pre-loaded core config (shared, not read again)
199
203
  * @returns {Promise<{greeting: string, context: Object, quality: string, metrics: Object}>}
200
204
  */
201
- async _runPipeline(agentId, options = {}, coreConfig = {}) {
205
+ async _runPipeline(agentId, options = {}, coreConfig = {}, startTime = Date.now()) {
202
206
  const pipelineStart = Date.now();
203
207
  const metrics = { loaders: {} };
204
208
 
@@ -329,6 +333,12 @@ class UnifiedActivationPipeline {
329
333
  // ACT-11: Determine quality level based on what loaded successfully
330
334
  const quality = this._determineQuality(metrics);
331
335
 
336
+ // SYN-13: Write active agent to SYNAPSE session (fire-and-forget, 20ms budget)
337
+ this._writeSynapseSession(agentId, quality, metrics);
338
+
339
+ // SYN-14: Persist UAP metrics for diagnostics (fire-and-forget)
340
+ this._persistUapMetrics(agentId, quality, metrics, Date.now() - startTime);
341
+
332
342
  return {
333
343
  greeting,
334
344
  context: enrichedContext,
@@ -665,6 +675,96 @@ class UnifiedActivationPipeline {
665
675
  };
666
676
  }
667
677
 
678
+ /**
679
+ * SYN-13: Write active agent to SYNAPSE session bridge file.
680
+ *
681
+ * Writes `.synapse/sessions/_active-agent.json` as a singleton file.
682
+ * Uses fs.writeFileSync directly (not updateSession) to avoid prompt_count
683
+ * side effects. Fire-and-forget with try/catch — never blocks activation.
684
+ *
685
+ * @private
686
+ * @param {string} agentId - Agent ID being activated
687
+ * @param {string} quality - Activation quality ('full'|'partial'|'fallback')
688
+ * @param {Object} metrics - Metrics object for profiling
689
+ */
690
+ _writeSynapseSession(agentId, quality, metrics) {
691
+ const start = Date.now();
692
+ try {
693
+ const sessionsDir = path.join(this.projectRoot, '.synapse', 'sessions');
694
+ if (!fsSync.existsSync(path.join(this.projectRoot, '.synapse'))) {
695
+ // .synapse/ does not exist — project may not have SYNAPSE installed
696
+ const duration = Date.now() - start;
697
+ metrics.loaders.synapseSession = { duration, status: 'skipped', start, end: start + duration };
698
+ return;
699
+ }
700
+
701
+ if (!fsSync.existsSync(sessionsDir)) {
702
+ fsSync.mkdirSync(sessionsDir, { recursive: true });
703
+ }
704
+
705
+ const bridgeData = {
706
+ id: agentId,
707
+ activated_at: new Date().toISOString(),
708
+ activation_quality: quality,
709
+ source: 'uap',
710
+ };
711
+
712
+ const bridgePath = path.join(sessionsDir, '_active-agent.json');
713
+ fsSync.writeFileSync(bridgePath, JSON.stringify(bridgeData, null, 2), 'utf8');
714
+
715
+ const duration = Date.now() - start;
716
+ metrics.loaders.synapseSession = { duration, status: 'ok', start, end: start + duration };
717
+ } catch (error) {
718
+ const duration = Date.now() - start;
719
+ metrics.loaders.synapseSession = { duration, status: 'error', start, end: start + duration, error: error.message };
720
+ console.warn(`[UnifiedActivationPipeline] SYNAPSE session write failed: ${error.message}`);
721
+ }
722
+ }
723
+
724
+ /**
725
+ * SYN-14: Persist UAP metrics to .synapse/metrics/uap-metrics.json.
726
+ * Fire-and-forget — never blocks activation pipeline.
727
+ *
728
+ * @private
729
+ * @param {string} agentId - Agent ID
730
+ * @param {string} quality - Activation quality ('full'|'partial'|'fallback')
731
+ * @param {Object} metrics - Metrics object with loader timings
732
+ * @param {number} totalDuration - Total activation duration in ms
733
+ */
734
+ _persistUapMetrics(agentId, quality, metrics, totalDuration) {
735
+ try {
736
+ const synapsePath = path.join(this.projectRoot, '.synapse');
737
+ if (!fsSync.existsSync(synapsePath)) return;
738
+ const metricsDir = path.join(synapsePath, 'metrics');
739
+ if (!fsSync.existsSync(metricsDir)) {
740
+ fsSync.mkdirSync(metricsDir, { recursive: true });
741
+ }
742
+ const requireChainMs = typeof _BOOT_TIME !== 'undefined'
743
+ ? Number(process.hrtime.bigint() - _BOOT_TIME) / 1e6
744
+ : 0;
745
+ const data = {
746
+ agentId,
747
+ quality,
748
+ totalDuration,
749
+ requireChainMs,
750
+ loaders: {},
751
+ timestamp: new Date().toISOString(),
752
+ };
753
+ for (const [name, info] of Object.entries(metrics.loaders || {})) {
754
+ data.loaders[name] = {
755
+ duration: info.duration || 0,
756
+ status: info.status || 'unknown',
757
+ };
758
+ }
759
+ fsSync.writeFileSync(
760
+ path.join(metricsDir, 'uap-metrics.json'),
761
+ JSON.stringify(data, null, 2), 'utf8',
762
+ );
763
+ } catch {
764
+ // Fire-and-forget: never block the activation pipeline
765
+ }
766
+ }
767
+
668
768
  /**
669
769
  * Get list of all supported agent IDs.
670
770
  * @returns {string[]} Array of agent IDs
@@ -208,11 +208,11 @@ updated_at: 2025-11-17
208
208
 
209
209
  ## Description
210
210
 
211
- Analyze an expansion pack's data requirements and design database integration strategy. Maps pack inputs/outputs/state to database schema, proposes tables/relationships, and generates migration plan.
211
+ Analyze an squad's data requirements and design database integration strategy. Maps pack inputs/outputs/state to database schema, proposes tables/relationships, and generates migration plan.
212
212
 
213
213
  ## Prerequisites
214
214
 
215
- - Expansion pack installed and accessible
215
+ - Squad installed and accessible
216
216
  - Database connection configured (*env-check passed)
217
217
  - Current schema documented or accessible
218
218
 
@@ -221,8 +221,8 @@ Analyze an expansion pack's data requirements and design database integration st
221
221
  ### Step 1: Identify Target Expansion Pack
222
222
 
223
223
  **Elicit from user:**
224
- - Which expansion pack? (mmos, creator-os, innerlens, etc.)
225
- - Path to expansion pack directory
224
+ - Which squad? (mmos, creator-os, innerlens, etc.)
225
+ - Path to squad directory
226
226
 
227
227
  **Actions:**
228
228
  - Verify pack exists and has config.yaml
@@ -578,7 +578,7 @@ next_steps:
578
578
 
579
579
  ## Success Criteria
580
580
 
581
- - [ ] Expansion pack data flows fully documented
581
+ - [ ] Squad data flows fully documented
582
582
  - [ ] Current schema analyzed
583
583
  - [ ] Integration schema designed (follows patterns, has RLS)
584
584
  - [ ] KISS Gate validation passed (database is actually needed)
@@ -208,13 +208,13 @@ updated_at: 2025-11-17
208
208
 
209
209
  ## Description
210
210
 
211
- Connect design system with MMOS, CreatorOS, or InnerLens expansion packs. Generates pack-specific patterns, token variations, and integration documentation.
211
+ Connect design system with MMOS, CreatorOS, or InnerLens squads. Generates pack-specific patterns, token variations, and integration documentation.
212
212
 
213
213
  ## Prerequisites
214
214
 
215
215
  - Design system setup complete
216
216
  - Components built
217
- - Target expansion pack installed
217
+ - Target squad installed
218
218
 
219
219
  ## Workflow
220
220
 
@@ -130,7 +130,7 @@ Options:
130
130
 
131
131
  Examples:
132
132
  *next # Auto-detect context
133
- *next --story docs/stories/v2.1/sprint-10/story-wis-3.md
133
+ *next --story docs/stories/v4.0.4/sprint-10/story-wis-3.md
134
134
  *next --all # Show all suggestions
135
135
 
136
136
  How it works:
@@ -156,7 +156,7 @@ Workflow detection uses:
156
156
  📍 State: in_development (confidence: 92%)
157
157
 
158
158
  Next steps:
159
- 1. `*review-qa docs/stories/v2.1/sprint-10/story-wis-3.md` - Run QA review
159
+ 1. `*review-qa docs/stories/v4.0.4/sprint-10/story-wis-3.md` - Run QA review
160
160
  2. `*run-tests` - Execute test suite manually
161
161
  3. `*pre-push-quality-gate` - Final quality checks
162
162
 
@@ -257,7 +257,7 @@ optimizations:
257
257
  Context:
258
258
  Agent: @dev
259
259
  Last Command: *develop
260
- Story: docs/stories/v2.1/sprint-11/story-wis-3.md
260
+ Story: docs/stories/v4.0.4/sprint-11/story-wis-3.md
261
261
  Branch: feature/wis-3
262
262
 
263
263
  Workflow: story_development
@@ -21,7 +21,7 @@ To help users contribute to the AIOS open-source project (`@synkra/aios-core`) b
21
21
  **Target Repository**: `@synkra/aios-core` (open-source framework)
22
22
 
23
23
  **Contribution Types Supported**:
24
- - Expansion packs (new agents, tasks, workflows)
24
+ - Squads (new agents, tasks, workflows)
25
25
  - Agent improvements (enhanced prompts, new commands)
26
26
  - Task refinements (better checklists, templates)
27
27
  - Tool integrations (new MCP tools)
@@ -183,7 +183,7 @@ To help users contribute to the AIOS open-source project (`@synkra/aios-core`) b
183
183
  ```
184
184
  feat(Squad): add content-creator pack with Instagram agent
185
185
 
186
- Implements a complete content creation expansion pack with:
186
+ Implements a complete content creation squad with:
187
187
  - Instagram content specialist agent
188
188
  - 5 new tasks (create-post, schedule-content, analyze-performance, etc.)
189
189
  - Template library for posts, stories, reels
@@ -0,0 +1,257 @@
1
+ ---
2
+ id: publish-npm
3
+ name: npm Publishing Pipeline (Preview to Latest)
4
+ agent: devops
5
+ category: release
6
+ complexity: high
7
+ tools:
8
+ - github-cli
9
+ - git
10
+ checklists:
11
+ - release-checklist.md
12
+ ---
13
+
14
+ # npm Publishing Pipeline: Preview to Latest
15
+
16
+ ## Purpose
17
+
18
+ Safe, validated npm publishing using a two-phase release strategy:
19
+ 1. **Preview**: Publish to `preview` dist-tag for testing
20
+ 2. **Promote**: After validation, promote `preview` to `latest`
21
+
22
+ This prevents broken releases reaching users (like v4.0.0-v4.0.4 incident).
23
+
24
+ ## Commands
25
+
26
+ ### `*publish-preview` - Publish as Preview
27
+
28
+ Publishes a new version to npm under the `preview` dist-tag.
29
+
30
+ #### Workflow
31
+
32
+ ```
33
+ 1. PRE-FLIGHT CHECKS
34
+ - Verify: branch = main, working tree clean
35
+ - Verify: git is up-to-date with remote (git fetch + compare)
36
+
37
+ 2. QUALITY GATES
38
+ - npm run lint
39
+ - npm run typecheck
40
+ - npm test
41
+
42
+ 3. PACKAGE VALIDATION
43
+ - npm run validate:package
44
+ (runs scripts/validate-package-completeness.js)
45
+ - Confirms: hooks, rules, bin, core config present
46
+ - Confirms: pro/ NOT in tarball
47
+
48
+ 4. VERSION BUMP
49
+ - Ask user: patch | minor | major
50
+ - npm version {type} --no-git-tag-version
51
+ - git add package.json package-lock.json
52
+ - git commit -m "chore(release): bump version to {new_version}"
53
+
54
+ 5. PUBLISH
55
+ - npm publish --tag preview
56
+ - Verify: npm view aios-core@preview version === {new_version}
57
+
58
+ 6. SMOKE TEST
59
+ - Create temp directory
60
+ - npm init -y
61
+ - npm install aios-core@preview
62
+ - Verify critical files exist in node_modules/aios-core/:
63
+ - .claude/hooks/synapse-engine.js
64
+ - .aios-core/core-config.yaml
65
+ - bin/aios.js
66
+ - Clean up temp directory
67
+
68
+ 7. PUSH VERSION COMMIT
69
+ - git push origin main
70
+
71
+ 8. REPORT
72
+ - "v{X.Y.Z} published as preview"
73
+ - "Test with: npm install aios-core@preview"
74
+ - "When ready: *promote-latest"
75
+ ```
76
+
77
+ #### Pre-conditions
78
+
79
+ - [ ] On `main` branch
80
+ - [ ] Working tree clean (no uncommitted changes)
81
+ - [ ] All quality gates pass (lint, typecheck, test)
82
+ - [ ] Package validation passes (validate-package-completeness.js)
83
+ - [ ] npm auth configured (`npm whoami` succeeds)
84
+
85
+ #### Post-conditions
86
+
87
+ - [ ] New version published to npm with `preview` tag
88
+ - [ ] `npm view aios-core@preview` returns new version
89
+ - [ ] Smoke test passes (critical files present in installed package)
90
+ - [ ] Version bump committed and pushed to main
91
+
92
+ ---
93
+
94
+ ### `*promote-latest` - Promote Preview to Latest
95
+
96
+ Promotes a tested `preview` version to the `latest` dist-tag.
97
+
98
+ #### Workflow
99
+
100
+ ```
101
+ 1. VERIFY PREVIEW EXISTS
102
+ - npm view aios-core@preview version
103
+ - If no preview: HALT with "No preview version found"
104
+
105
+ 2. CONFIRM WITH USER
106
+ - Display: "Promote v{X.Y.Z} from preview to latest?"
107
+ - Show current latest: npm view aios-core@latest version
108
+ - Require explicit confirmation
109
+
110
+ 3. PROMOTE
111
+ - npm dist-tag add aios-core@{version} latest
112
+
113
+ 4. VERIFY
114
+ - npm view aios-core@latest version === {version}
115
+ - If mismatch: HALT with error
116
+
117
+ 5. TAG & RELEASE
118
+ - git tag v{version}
119
+ - git push origin v{version}
120
+ - gh release create v{version} --generate-notes --latest
121
+
122
+ 6. REPORT
123
+ - "v{X.Y.Z} promoted to latest"
124
+ - Release URL
125
+ - "Install with: npm install aios-core"
126
+ ```
127
+
128
+ #### Pre-conditions
129
+
130
+ - [ ] Preview version exists (`npm view aios-core@preview`)
131
+ - [ ] User has tested the preview version
132
+ - [ ] npm auth configured
133
+ - [ ] GitHub CLI authenticated (`gh auth status`)
134
+
135
+ #### Post-conditions
136
+
137
+ - [ ] `npm view aios-core@latest` returns promoted version
138
+ - [ ] Git tag `v{version}` created and pushed
139
+ - [ ] GitHub Release created with auto-generated notes
140
+
141
+ ---
142
+
143
+ ### `*test-install` - Test Installation in Clean Environment
144
+
145
+ Tests package installation from a specific dist-tag in a clean temporary directory.
146
+
147
+ #### Workflow
148
+
149
+ ```
150
+ 1. SETUP
151
+ - Create temporary directory
152
+ - npm init -y
153
+
154
+ 2. INSTALL
155
+ - npm install aios-core@{tag} (default: latest)
156
+ - Record: install time, exit code, warnings
157
+
158
+ 3. VERIFY FILES
159
+ - Check node_modules/aios-core/ contains:
160
+ - .aios-core/core-config.yaml
161
+ - .aios-core/constitution.md
162
+ - .aios-core/development/agents/ (non-empty)
163
+ - .aios-core/development/tasks/ (non-empty)
164
+ - .claude/hooks/synapse-engine.js
165
+ - .claude/hooks/precompact-session-digest.js
166
+ - .claude/rules/ (non-empty)
167
+ - bin/aios.js
168
+ - bin/aios-minimal.js
169
+ - Check node_modules/aios-core/ does NOT contain:
170
+ - pro/
171
+ - .env
172
+ - .git/
173
+ - tests/
174
+
175
+ 4. TEST INSTALLER (optional, if --full flag)
176
+ - npx aios-core install --preset minimal
177
+ - Verify: .aios-core/ created
178
+ - Verify: .claude/hooks/ created
179
+ - Verify: .claude/rules/ created
180
+
181
+ 5. CLEANUP
182
+ - Remove temporary directory
183
+
184
+ 6. REPORT
185
+ - Package version installed
186
+ - All critical files: present/missing
187
+ - Excluded content: clean/leaked
188
+ - Overall: PASS/FAIL
189
+ ```
190
+
191
+ #### Parameters
192
+
193
+ - `tag`: dist-tag to test (default: `latest`)
194
+ - `--full`: Also test `npx aios-core install`
195
+
196
+ ---
197
+
198
+ ## Rollback Procedure
199
+
200
+ If a broken version reaches `latest`:
201
+
202
+ ```bash
203
+ # 1. Identify previous good version
204
+ npm view aios-core versions --json
205
+
206
+ # 2. Point latest back to previous version
207
+ npm dist-tag add aios-core@{previous-good-version} latest
208
+
209
+ # 3. Deprecate broken version with message
210
+ npm deprecate aios-core@{broken-version} "Known issues, use v{previous-good-version}"
211
+
212
+ # 4. Verify
213
+ npm view aios-core@latest version
214
+ ```
215
+
216
+ **Important:** `npm deprecate` shows a warning on install but does NOT prevent installation.
217
+ To fully block a version, use `npm unpublish aios-core@{version}` (within 72h of publish only).
218
+
219
+ ---
220
+
221
+ ## Configuration Reference
222
+
223
+ See `core-config.yaml` section `npm_registry` for:
224
+ - Required files list
225
+ - Excluded paths list
226
+ - Smoke test configuration
227
+ - Auth strategy
228
+
229
+ ---
230
+
231
+ ## Error Handling
232
+
233
+ | Error | Cause | Resolution |
234
+ |-------|-------|------------|
235
+ | `npm ERR! 403` | Auth issue | Run `npm login`, check token permissions |
236
+ | `npm ERR! 402` | Paid feature | Ensure package is public (`--access public`) |
237
+ | Smoke test fails | Files missing from tarball | Fix `files` array in package.json, re-validate |
238
+ | promote fails | Version not on preview | Run `*publish-preview` first |
239
+ | Tag already exists | Re-publishing same version | Bump version or use `--force` (with caution) |
240
+
241
+ ---
242
+
243
+ ## Metadata
244
+
245
+ ```yaml
246
+ story: INS-2 (Release Pipeline: Preview to Latest)
247
+ version: 1.0.0
248
+ dependencies:
249
+ - release-management.md
250
+ - github-devops-pre-push-quality-gate.md
251
+ tags:
252
+ - npm
253
+ - release
254
+ - publishing
255
+ - preview
256
+ created: 2026-02-13
257
+ ```
@@ -77,14 +77,14 @@ To automate the complete software release process, including:
77
77
 
78
78
  - **git_tag**: `string`
79
79
  - **Description**: Git tag created
80
- - **Example**: `"v2.1.3"`
80
+ - **Example**: `"v4.0.4.3"`
81
81
 
82
82
  - **changelog**: `string`
83
83
  - **Description**: Generated CHANGELOG.md content for this release
84
84
 
85
85
  - **release_url**: `string`
86
86
  - **Description**: URL to GitHub/GitLab Release
87
- - **Example**: `"https://github.com/user/repo/releases/tag/v2.1.3"`
87
+ - **Example**: `"https://github.com/user/repo/releases/tag/v4.0.4.3"`
88
88
 
89
89
  - **published_packages**: `array<object>`
90
90
  - **Description**: Published packages with URLs
@@ -120,8 +120,8 @@ To automate the complete software release process, including:
120
120
  ```
121
121
 
122
122
  3. **Analyze Commits Since Last Release**
123
- - Get last version tag (e.g., `v2.1.2`)
124
- - Get commits since last tag: `git log v2.1.2..HEAD`
123
+ - Get last version tag (e.g., `v4.0.4.2`)
124
+ - Get commits since last tag: `git log v4.0.4.2..HEAD`
125
125
  - Parse commit messages (Conventional Commits)
126
126
 
127
127
  4. **Determine Version Bump**
@@ -866,7 +866,7 @@ Write-Host "✅ Setup report saved to .aios/devops-setup-report.yaml"
866
866
  - [GitHub Actions Documentation](https://docs.github.com/en/actions)
867
867
  - [GitHub Branch Protection API](https://docs.github.com/en/rest/branches/branch-protection)
868
868
  - [CodeRabbit Documentation](https://docs.coderabbit.ai/)
869
- - [Story 5.10 - GitHub DevOps Setup](docs/stories/v2.1/sprint-5/story-5.10-github-devops-user-projects.md)
869
+ - [Story 5.10 - GitHub DevOps Setup](docs/stories/v4.0.4/sprint-5/story-5.10-github-devops-user-projects.md)
870
870
 
871
871
  ---
872
872
 
@@ -37,7 +37,7 @@ Migrates legacy squad formats to AIOS 2.1 standard.
37
37
  # Migrate with detailed output
38
38
  *migrate-squad ./squads/my-squad --verbose
39
39
 
40
- # Migrate expansion pack
40
+ # Migrate squad
41
41
  *migrate-squad ./expansion-packs/my-pack --verbose
42
42
  ```
43
43
 
@@ -122,7 +122,7 @@ active_ides:
122
122
  # - gemini # .gemini/
123
123
 
124
124
  # Mapeamento de diretório → prefixo de comando
125
- pack_aliases:
125
+ squad_aliases:
126
126
  legal: Legal
127
127
  copy: Copy
128
128
  hr: HR
@@ -134,7 +134,7 @@ sync_mappings:
134
134
  source: 'squads/*/agents/'
135
135
  destinations:
136
136
  claude:
137
- - path: '.claude/commands/{pack}/agents/'
137
+ - path: '.claude/commands/{squad_alias}/agents/'
138
138
  format: 'md'
139
139
  cursor:
140
140
  - path: '.cursor/rules/'
@@ -142,9 +142,9 @@ sync_mappings:
142
142
  wrapper: 'cursor-rule'
143
143
  ```
144
144
 
145
- ### Pack Aliases
145
+ ### Squad Aliases
146
146
 
147
- O `pack_aliases` mapeia o nome do diretório do squad para o prefixo usado nos comandos:
147
+ O `squad_aliases` mapeia o nome do diretório do squad para o prefixo usado nos comandos:
148
148
 
149
149
  | Diretório | Alias | Comando Claude |
150
150
  | --------------- | ------- | --------------------------- |
@@ -163,7 +163,7 @@ O `pack_aliases` mapeia o nome do diretório do squad para o prefixo usado nos c
163
163
  │ ↓ │
164
164
  │ 2. Load .aios-sync.yaml │
165
165
  │ ↓ (not found → create default) │
166
- │ 3. Resolve pack alias
166
+ │ 3. Resolve squad alias
167
167
  │ ↓ │
168
168
  │ 4. Locate source files in squads/ │
169
169
  │ ↓ (not found → error) │
@@ -243,7 +243,7 @@ A description é extraída de:
243
243
  Sincroniza um arquivo de agent:
244
244
 
245
245
  - Source: `squads/{squad}/agents/{name}.md`
246
- - Claude: `.claude/commands/{Pack}/agents/{name}.md`
246
+ - Claude: `.claude/commands/{SquadAlias}/agents/{name}.md`
247
247
  - Cursor: `.cursor/rules/{name}.mdc`
248
248
 
249
249
  ### Task (`*command task {name}`)
@@ -251,14 +251,14 @@ Sincroniza um arquivo de agent:
251
251
  Sincroniza um arquivo de task:
252
252
 
253
253
  - Source: `squads/{squad}/tasks/{name}.md`
254
- - Claude: `.claude/commands/{Pack}/tasks/{name}.md`
254
+ - Claude: `.claude/commands/{SquadAlias}/tasks/{name}.md`
255
255
 
256
256
  ### Workflow (`*command workflow {name}`)
257
257
 
258
258
  Sincroniza um arquivo de workflow:
259
259
 
260
260
  - Source: `squads/{squad}/workflows/{name}.yaml`
261
- - Claude: `.claude/commands/{Pack}/workflows/{name}.yaml`
261
+ - Claude: `.claude/commands/{SquadAlias}/workflows/{name}.yaml`
262
262
 
263
263
  ### Squad (`*command squad {name}`)
264
264
 
@@ -276,7 +276,7 @@ Sincroniza TODOS os componentes de um squad:
276
276
  | Error | Causa | Solução |
277
277
  | ---------------------- | ------------------------------- | --------------------------- |
278
278
  | `Source not found` | Arquivo não existe em squads/ | Verifique o nome e tipo |
279
- | `Pack alias not found` | Squad não está em pack_aliases | Adicione ao .aios-sync.yaml |
279
+ | `Squad alias not found` | Squad não está em squad_aliases | Adicione ao .aios-sync.yaml |
280
280
  | `File exists` | Destino já existe | Use --force ou escolha ação |
281
281
  | `IDE not active` | IDE não está em active_ides | Ative no .aios-sync.yaml |
282
282
  | `Invalid YAML` | Arquivo fonte com YAML inválido | Corrija o arquivo fonte |
@@ -300,7 +300,7 @@ if (!validTypes.includes(type)) {
300
300
  // 3. Carregar configuração
301
301
  const syncConfig = loadYaml('.aios-sync.yaml');
302
302
  const activeIdes = syncConfig.active_ides || ['claude'];
303
- const packAliases = syncConfig.pack_aliases || {};
303
+ const squadAliases = syncConfig.squad_aliases || syncConfig.pack_aliases || {};
304
304
 
305
305
  // 4. Localizar source
306
306
  let sourceFiles = [];
@@ -317,14 +317,14 @@ if (type === 'squad') {
317
317
  sourceFiles = [sourceFile];
318
318
  }
319
319
 
320
- // 5. Determinar pack alias
320
+ // 5. Determinar squad alias
321
321
  const squadName = extractSquadName(sourceFiles[0]);
322
- const packAlias = packAliases[squadName] || capitalize(squadName);
322
+ const squadAlias = squadAliases[squadName] || capitalize(squadName);
323
323
 
324
324
  // 6. Verificar existentes
325
325
  for (const file of sourceFiles) {
326
326
  for (const ide of activeIdes) {
327
- const destPath = getDestPath(ide, packAlias, file);
327
+ const destPath = getDestPath(ide, squadAlias, file);
328
328
  if (fs.existsSync(destPath) && !flags.force) {
329
329
  const action = await askUser(`${destPath} exists. Overwrite?`);
330
330
  if (action === 'skip') continue;
@@ -337,7 +337,7 @@ if (flags.dryRun) {
337
337
  output('DRY RUN - Would sync:');
338
338
  for (const file of sourceFiles) {
339
339
  for (const ide of activeIdes) {
340
- output(` ${file} → ${getDestPath(ide, packAlias, file)}`);
340
+ output(` ${file} → ${getDestPath(ide, squadAlias, file)}`);
341
341
  }
342
342
  }
343
343
  return;
@@ -146,6 +146,6 @@ git checkout -- .aios-core/
146
146
  | Version | Date | Changes |
147
147
  |---------|------|---------|
148
148
  | 4.0.0 | 2026-01-31 | **SIMPLIFIED:** Git-native approach, 15-line bash script replaces 847-line JS |
149
- | 3.1.0 | 2026-01-30 | Dynamic protection for expansion pack commands |
149
+ | 3.1.0 | 2026-01-30 | Dynamic protection for squad commands |
150
150
  | 3.0.0 | 2026-01-29 | YOLO mode with rsync |
151
151
  | 1.0.0 | 2026-01-29 | Initial version (verbose, interactive) |