fix(core): harden core super update governance and lifecycle - #802
Conversation
Introduce .grok/ integration with token-efficient agent profiles, slash skills, roles, personas, and compact rules. Add regenerable sync script (npm run sync:skills:grok) so Grok stays aligned with .source agents under .aiox-core/development/agents/.
Clarify the generator module purpose so entity-registry extraction no longer picks an unrelated CodeRabbit comment string.
Make Claude subagent governance validate the core aiox-* set instead of exact directory equality, and guard dev-context-loader cacheHits when status/shape is incomplete.
CI Install Manifest Validation failed because data/entity-registry.yaml hash no longer matched install-manifest.yaml after IDS updates.
Escape YAML/TOML scalars, constrain generated write paths under .grok/, block git push for squad-creator, label markdown fences, and keep the cacheHits > 0 assertion in dev-context-loader.
Keep install-manifest hash aligned with entity-registry so CI Install Manifest Validation stays green.
Branch off PR #800 (Grok). Captures P0–P2 waves for SDC skills, runtime hygiene, orchestration merge, IDE parity, and selective constitution updates without importing Sinkra product or enterprise IP. Note: docs/stories is gitignored; force-add for this framework epic only.
MVP cut (A+B), hard A3 merge gates, B0 lean spike, denylist CI story, deferred D5/E4/F3, semver ship train, tightened A1 ACs. Full finding resolution table embedded in epic (100% resolved).
…first) Address architect-first findings: public versionable path (no force-add gitignored docs/stories), drop stale stories index, ARCH-A slice, A2 as #797 residual investigation (unref already present), permissions metric clarified (extend not replace), Wave B–E blocked until per-wave ARCH, hard ban on workspace/ in OSS, hub XI/XII numbering locked for constitution.
…s/docs Engine already resolves AIOX_SYNAPSE_PIPELINE_TIMEOUT_MS > core-config synapse.pipelineTimeoutMs > 100ms default with clamp and timeout warn. Add unit coverage for precedence/invalid values/soft-fail path and document knobs in config-override-guide. Closes #798 when merged.
…config Export resolvePipelineTimeoutMs (env > config > 100ms default, clamp 1-30000), soft-fail remaining layers with console.warn. Config key synapse.pipelineTimeoutMs. Completes CORE-SU.A1 implementation.
unref() alone still allows post-teardown callbacks. Skip setInterval when JEST_WORKER_ID is set; keep production timer + unref; gate logs on AIOX_DEBUG; export disposeConfigCacheTimers. Applies to core and infrastructure copies. CORE-SU.A2 YOLO.
Extend core/permissions without replacing PermissionMode/OperationGuard. OSS path deny list excludes product workspace/ trees. Unit tests for traversal, injection patterns, private/metadata SSRF. Wave A P0.
Add scan for hub/enterprise leakage (workspace product paths, sinkra_*, mux-adapter, coolify, machine paths). npm run validate:port-denylist; doctor check port-denylist. Completes Wave A.
Ship OSS lean SDC skill wrappers (validate → develop → review → apply-qa-fixes → close + full-sdc orchestrator) with tasks as SOT. Wire grok-skills-sync to copy development/skills → .grok/skills/aiox-*. Sequence Lock: only close-story sets Done. No product harvest trees.
Add lean SDC/wave engines under .aiox-core/core/sdc with aiox sdc and aiox wave CLI for plan/next/verify/progress. Upgrade full-sdc skill to EXECUTE loop; add wave-execute that dispatches full-sdc children via DAG + file-ownership batches. Grok skills synced; unit tests included.
Close CORE-SU.A1 with hook-runtime synapse config wiring and QA PASS. Add ARCH-C and wave-run advance/mark/cascade/report CLI. Normalize A2–A4 to Done; package scripts sdc/wave; unit tests for wave-run.
Scan .claude surfaces; fail closed on unreadable paths; doctor wraps scan errors. Apply lint formatting to sdc/wave-run modules.
Execute CORE-SU-C wave: dispatch-adapter (parallel/sequential pool), epic-glue + aiox wave from-epic, tests (23). Stories C2–C4 Done; wave report completed. Skills updated for from-epic flow.
Add install-time hint, doctor windows-npx-install check (17 total), and docs for cold-cache lock timeout. ARCH-D/E drafts unlock stretch planning. Wave CORE-SU-F completed via full-sdc.
Remove pm.sh echo-stub: invoke CLAUDE_CMD/claude or fail closed. Port OSS-safe Articles XI (Squad-First) and XII (Model Governance). Add ide-sync-contract (D1) and closeout stories for wave-execute.
Official policy: docs/framework/epics/ for versioned framework OSS work; docs/stories/ remains project L4 (gitignored template). Align AGENTS.md, CLAUDE.md, story-lifecycle paths, and Grok sync prompts. Gitignore .codex/ until absolute paths / force-push wording are hardened for OSS.
Add npm run diff:framework-3way (peer discovery via env/flags), doctor advisory framework-3way-diff (18 checks), and ANALYSIS-3WAY-CORRECTIONS from verified OSS×hub×enterprise facts. Prefer enterprise lean full-sdc as skill enrichment base; never blind-merge OSS-wins modules.
Cold/warm timeouts, processSessionDigest + debounced reinforce worker, OSS global-heuristic-hints.yaml, and heuristics unit tests. Does not replace hook-runtime wholesale. Graceful when MIS absent.
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.claude/skills/full-sdc/SKILL.md:
- Around line 98-100: Make the remediation failure path in the
apply-qa-fixes/review loop explicit: if apply_qa_fixes --mark fails, halt and
escalate without returning to review or incrementing qgIterations; only perform
those steps after verification succeeds.
In
`@docs/framework/epics/core-super-update/STORY-CORE-SU.R1-REVIEW-REMEDIATION.md`:
- Line 798: Revise the Performance statement in
STORY-CORE-SU.R1-REVIEW-REMEDIATION.md to qualify the claim: acknowledge the
orchestration process and I/O overhead introduced by the mandatory preflight
before each phase, and state that no significant product-runtime regression was
observed instead of claiming zero runtime cost.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 0e5472e2-ec6f-4db8-8c8a-db770f2fc339
📒 Files selected for processing (8)
.aiox-core/data/entity-registry.yaml.aiox-core/development/skills/full-sdc/SKILL.md.aiox-core/install-manifest.yaml.claude/skills/full-sdc/SKILL.md.grok/skills/aiox-full-sdc/SKILL.mddocs/framework/epics/core-super-update/LIFECYCLE-AUDIT.mddocs/framework/epics/core-super-update/STORY-CORE-SU.R1-REVIEW-REMEDIATION.mdtests/unit/lifecycle-close-contract.test.js
✅ Files skipped from review due to trivial changes (2)
- docs/framework/epics/core-super-update/LIFECYCLE-AUDIT.md
- .aiox-core/install-manifest.yaml
🚧 Files skipped from review as they are similar to previous changes (2)
- .aiox-core/data/entity-registry.yaml
- tests/unit/lifecycle-close-contract.test.js
|
CI failure on run |
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
Correções do review incremental publicadas.
Gates locais: 376 suites / 9.013 testes, build, lint (0 erros), typecheck, denylist, sync IDE 109/109, paridade, manifesto e registry determinístico. Threads tratadas e resolvidas. |
|
@coderabbitai resume |
|
@coderabbitai review |
✅ Action performedReview finished.
|
✅ Action performedReviews resumed. |
Pedrovaleriolopez
left a comment
There was a problem hiding this comment.
Review — terminal-spawner hardening + dispatch governance
Reviewed with focus on the orchestration/spawner surface (this PR supersedes #803, which independently fixed the same terminal-window bug — closed in favor of this one).
Strengths ✅
- Root-cause fix for the Terminal.app window storm:
detectEnvironment()now short-circuits on explicit inline (AIOX_INLINE_MODE/AIOX_NO_VISUAL_TERMINAL) and detects test runners (NODE_ENV=test/JEST_WORKER_ID) before granting a visual terminal. Confirmed this matches the field failure (external installs on macOS bursting dozens of Terminal windows on everynpm test). - The offending test is now hermetic:
should accept valid agent ID formatscalls the newly-exportedvalidateArgs()directly instead of realspawnAgent()— better than stubbing. - Shell safety is real:
execFileSync('bash', [scriptPath, ...args])kills the interpolated-execSyncinjection path;printf -v quoted '%q'on every value composingfull_cmd; osascript now receives the command via argv (on run argv) instead of string interpolation — AppleScript injection closed. The sentinel test (terminal-spawner-shell-safety.test.js) locks these in. - Dispatch governance (Constitution XII): mandatory positive
AIOX_MODEL_BUDGET_CEILING_USD, story binding with status validation for implementation tasks, intent scanning, dedicated exit code 5. This is what protected the affected machines from token burn while the window bug was live. - Nice catch on the
_executeWithTimeouttimer leak (clearTimeoutinfinally).
Suggestion (non-blocking) ⚠️
pm.sh spawn_terminal() still only checks INLINE_MODE at the shell level. Anyone invoking bash pm.sh dev test DIRECTLY (not via the Node spawner) from a native macOS shell — a script, a doc example, a future test — still opens a real Terminal window. The JS guard covers all Node callers, but defense in depth at the shell layer is one line:
if [[ "$INLINE_MODE" == "true" || -n "${JEST_WORKER_ID:-}" || "${AIOX_NO_VISUAL_TERMINAL:-false}" == "true" ]]; then(and mention AIOX_NO_VISUAL_TERMINAL in the pm.sh --help env-vars section). Fine as a follow-up.
Observations (informational)
- The
spawnInline()tests still execute the realpm.sh— now safely blocked by the dispatch guard (exit 5, no model call), but each test spawns bash+node and implicitly depends on the guard existing. StubbingCLAUDE_CMDor mockingchild_processwould make them hermetic. Cosmetic. scanAutomatedIntentINT-003 (rm -rf,child_process,eval() may false-positive on legitimate story/context content that describes shell commands. Worth watching in practice since it hard-blocks dispatch.
Verdict: APPROVE. CI is green across all platforms; the fix resolves the reported field issue at the root.
🤖 Generated with Claude Code
|
🎉 This PR is included in version 5.3.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
|
@oalanicolas heads-up — follow-through do merge: ✅ O fix está no 📦 v5.3.0 publicada hoje com este fix: O follow-up do review (guard shell-level no |
…802 follow-up) (#805) The #802 review approved with one non-blocking follow-up: spawn_terminal() only checked INLINE_MODE at the shell level, so a DIRECT `bash pm.sh dev test` invocation (script, doc example, future test) on native macOS still opened a real Terminal.app window — the Node spawner's detectEnvironment() guard only covers Node callers. - pm.sh spawn_terminal(): guard now mirrors detectEnvironment() — forces the inline path when JEST_WORKER_ID is set, NODE_ENV=test, CI=true, or AIOX_NO_VISUAL_TERMINAL=true (in addition to AIOX_INLINE_MODE). - pm.sh --help: documents AIOX_NO_VISUAL_TERMINAL and the implied signals. - terminal-spawner-shell-safety.test.js: sentinel locks the guard in (same source-assertion pattern as the existing shell-safety sentinels). Verified behaviorally on native macOS: each of the four signals routes a direct `bash pm.sh dev <task>` into inline mode (dispatch-governance exit 5, no model call) with zero Terminal windows opened. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Resumo
Story
commit:a1a43dc895655adfbee6c6634e31242dc1887ff1Evidências de qualidade
npm run lint: PASS, sem erros.npm run typecheck: PASS.npm run build: PASS, publish safety gate com 2.140 arquivos.git diff --check: PASS.Escopo excluído
Os artefatos preexistentes abaixo foram preservados fora do stage/commit/PR:
tests/integration/wizard-debug.temp.test.jstests/unit/squad/temp-sqs10-resolve-1783638410431/Summary by CodeRabbit
aiox sdc preflight(PASS/JSON evidence); governance rejections exit with code5.aiox sdc markforreviewwith--outcome, enforcing valid outcomes and persisting them.