Skip to content

chore(ci): consolidate release pipeline (T5508)#54

Closed
kryptobaseddev wants to merge 64 commits intomainfrom
chore/validate-ci-protection
Closed

chore(ci): consolidate release pipeline (T5508)#54
kryptobaseddev wants to merge 64 commits intomainfrom
chore/validate-ci-protection

Conversation

@kryptobaseddev
Copy link
Owner

Summary

  • Delete npm-publish.yml — redundant with release.yml, not in OIDC trust, caused E404 during v2026.3.14 publish attempt
  • Fix release.yml idempotency — replace softprops/action-gh-release@v2 with direct gh release CLI that deletes+recreates (safe to re-run, no more "too many retries" failures)
  • Single-job consolidation — was 3 separate jobs each rebuilding the project; now one job builds once and publishes everything
  • Add workflow_dispatch break-glass — can now manually trigger release for a specific version without re-pushing tags
  • Security — all ${{ }} expressions passed via env: vars, no injection surface

Why directly to main

CI-only change needed to unblock the v2026.3.14 npm publish. Once merged, will trigger workflow_dispatch on the existing v2026.3.14 tag to complete the release.

AI Bot and others added 30 commits March 2, 2026 21:10
- Removed LEGACY_DOMAIN_ALIASES (clean break from legacy domains)
- Migrated patterns/learnings from JSONL to brain.db
- Removed alias resolution from MCP adapter
- Updated VERB-STANDARDS.md to remove legacy references
- Updated operation-constitution.schema.json for full validation
- Reworked CLI help to group by domain

53 files modified, 11 new files added
… domain implementation

MAJOR CHANGES:
- T5276: Merged sharing domain into nexus (sharing→nexus.share.*)
- T5267-T5275: Created sticky domain with 5 operations (sticky.add/list/show/convert/archive)
- T5291: Fixed sticky domain tier restriction in projections.ts
- T5292: Removed 83 domain alias Constitution violations

ARCHITECTURE:
- CANONICAL_DOMAINS now exactly 10 domains (no aliases)
- Sticky domain: src/core/sticky/, src/dispatch/domains/sticky.ts, src/dispatch/engines/sticky-engine.ts
- Sharing moved to src/core/nexus/sharing/
- Database: brain_sticky_notes table in brain.db

SKILLS:
- ct-cleo: Updated with sticky references
- ct-stickynote: New skill created and registered

DOCUMENTATION:
- STICKY-NOTES-SPEC.md created
- Constitution updated with 10 canonical domains
- CLEO-SYSTEM-FLOW-ATLAS updated

TESTS:
- 12 sticky domain tests passing
- Build verified: npm run build passes

CRITICAL AUDIT:
- 171 tasks.json references identified (T5284 epic created)
- 6 CRITICAL files need immediate fix (T5293-T5297)
- Sticky convert FIXED to use SQLite accessor
CRITICAL FIXES - 5 files updated to use SQLite accessor pattern:

T5293: src/core/paths.ts - getTaskPath() returns tasks.db, added @deprecated

T5294: src/core/tasks/task-ops.ts - coreTaskNext() uses accessor.loadTaskFile()

T5295: src/core/tasks/plan.ts - getCurrentPhase() async, uses getAccessor()

T5296: src/cli/commands/restore.ts - defaults to tasks.db, updated messages

T5297: src/cli/commands/nexus.ts - cross-project reads use getAccessor()

Build: PASS | TypeScript: No errors
…e (T5298)

Fixed error messages and comments referencing legacy tasks.json:

src/core/tasks/task-ops.ts:

  - Error: 'No valid tasks.json found' → 'No valid task data found'

  - Error: 'already exists in tasks.json' → 'already exists in active tasks'

  - Comment: 'Move back to tasks.json' → 'Move back to active tasks'

src/core/validation/validate-ops.ts:

  - Comment: 'validation report on tasks.json' → 'tasks database'

  - Error: 'Duplicate IDs in tasks.json' → 'tasks database'

  - Error: 'IDs in both tasks.json and archive' → 'tasks database and archive'

src/core/paths.ts:

  - Comment: 'tasks.json (canonical)' → 'tasks.db (current)'

Build: PASS | 10 error messages updated
…nerate (T5298)

- Fix systemInjectGenerate to pass DataAccessor to generateInjection so it
  reads from SQLite instead of trying to parse tasks.db as JSON (caused
  success: false in brain-operations E2E tests)
- Update stale cleo_query reference in MVI template text to query
- Fix projections.test.ts: replace non-existent validate domain with sticky,
  remove lifecycle/release/system assertions that have no registry entries
Replace non-migration tasks.json/todo.json runtime access with DataAccessor/SQLite task data across nexus, system, release, and utility modules. Keep legacy JSON references only in migration/upgrade compatibility paths.
Create shared test-db-helper.ts with createTestDb(), seedTasks(), and
makeTaskFile() that use createSqliteDataAccessor for real SQLite setup.
Replace writeFile tasks.json pattern with accessor-based initialization
across 20 test files. Also fix stale paths.test.ts assertion (tasks.json
-> tasks.db) and update migration tests for tasks.db reality. (T5244)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove backward-compat aliases: admin.config.get, tasks.reopen,
tools.issue.create.{bug,feature,help}. Canonical operations unchanged.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…5246)

- query.ts: Remove legacy QueryDomain aliases (sharing, research, lifecycle,
  validate, system, issues, skills, providers); update to canonical 10 domains
- mutate.ts: Remove legacy domain cases from validateOperationParams switch;
  rename validation helpers to canonical names (validateCheckParams,
  validateAdminParams, validateStageParams, validateSkillSubParams); fix all
  error response domain strings to use canonical names
- query.test.ts: Add legacy domain rejection test covering all 10 legacy names
- mutate.test.ts: Add sharing and brain to legacy domain rejection list

Gateways now reject non-canonical domains with E_INVALID_DOMAIN.
124 tests pass, 0 TypeScript errors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove .alias('reopen'), .alias('unarchive'), .alias('uncancel') from restore command
- Remove .alias('search') from find and memory recall commands
- Update comments to use canonical verb terminology
- CLI help now reflects canonical operations only (restore, find, recall)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…250)

- Add convert verb §43 to VERB-STANDARDS (37 enforced verbs)
- Add 7 verbs to Constitution §4 (check/verify/validate/timeline/convert/unlink/compute)
- Add 6 missing ops to Constitution §6 (orchestrate.spawn.execute + 5 tools ops)
- Remove 5 legacy aliases (tasks.reopen, admin.config.get, tools.issue.create.*)
- Fix operation count from 212 to 207 across all docs (118q + 89m)
- Fix per-domain counts to match registry SSoT
- Update schemas: sharing→sticky domain in operation-constitution and system-flow-atlas
- Update AGENTS.md: sharing→sticky, 112→118 query ops, 201→207 total ops
- Update CLEO-VISION.md: 212→207, 201→207
- Update tier counts: tier 0=135, tier 2=36

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…(T5251)

- Create tests/integration/parity-gate.test.ts: verifies 207 ops, 10 domains,
  per-domain counts, zero aliases, handler file existence, resolvability
- Fix 18 nexus test failures across 5 files: migrate from legacy todo.json
  fixtures to SQLite tasks.db using createSqliteDataAccessor + seedTasks
- Update parity.test.ts stale count expectations (212→207, 119q→118q, 93m→89m)
- Adapt cross-project dependency tests for SQLite FK constraints

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix release-engine.test.ts: 4 pre-existing failures resolved
- Fix release-push-guard.test.ts: 1 pre-existing failure resolved + 51s hang
  eliminated (was attempting real git push due to missing manifest entry)
- Both files now use createSqliteDataAccessor + seedTasks pattern

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…rmance (T5319, T5311)

T5319 (critical): add drizzle-brain/ to package.json files array so brain.db
migration files are included in published npm package. Brain.db init was
failing on npm install due to missing migrations folder.

T5311 (medium): cap vitest fork workers at maxForks:4 for parallel execution
(400s → 129s, ~67% faster). Batch beforeEach task creation into beforeAll pool
in mutate integration tests. Replace dead local expect mock in integration-setup
with vitest's real expect. Wire verifyResponseFormat into error-handling e2e tests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
AI Bot and others added 27 commits March 4, 2026 19:08
…284)

T5309: Add docs/specs/CLEO-LOGGING-CONTRACT.md
- Canonical two-store logging contract (Pino + SQLite audit_log)
- 11 sections: store boundaries, correlation fields (projectHash/requestId/
  sessionId/taskId), level policy, startup/install/upgrade coverage,
  25-event actionable taxonomy, MCP-first + CLI parity rules, retention policy

T5310: Instrument 4 startup/lifecycle logging gaps
- Fix stale logger reference in MCP startup (re-acquire after initLogger)
- Add version + projectHash to MCP startup info log
- Replace console.warn in lifecycle/evidence.ts with getLogger('lifecycle:evidence')
- Replace console.warn in hooks/registry.ts with getLogger('hooks')
- Add src/mcp/__tests__/startup-logging.test.ts (4 tests)

Gate: TSC clean, 3912 tests pass / 0 fail.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Update all documentation and source code to use canonical 'query'/'mutate'
instead of 'cleo_query'/'cleo_mutate' for MCP gateway names:

- AGENTS.md: Architecture diagram and agent notes
- README.md: MCP tool usage examples
- docs/specs/CLEO-LOGGING-CONTRACT.md: Gateway type documentation
- .cleo/adrs/ADR-007, ADR-019: Architecture and audit documentation
- src/cli/commands/*: Command help text and comments
- src/dispatch/*: Type definitions, error messages, and constants
- src/mcp/lib/README.md: Router examples

Maintains backward compatibility in mcp.ts adapter for existing integrations.
- Add purgeSticky core function to permanently delete sticky notes
- Add stickyPurge engine wrapper and domain handler
- Register sticky.purge operation in dispatch registry
- Add CLI command: cleo sticky purge <id>
- Add comprehensive unit tests for purge functionality
- Fix generateProjectHash export in nexus registry
- Update test operation counts to reflect registry additions
  - sticky: 4 mutate ops (was 3)
  - nexus: 14 mutate ops (was 13)
  - Total: 247 ops (was 241)
4 workstreams, 38 atomic tasks completed:

Workstream A — Hooks: All 8 CAAMP hook events wired end-to-end
  (onError, onFileChange, onPromptSubmit, onResponseComplete + guards + 25 tests)

Workstream B — BRAIN Phase 3-5: PageIndex graph CRUD, pluggable embedding
  interface, vector similarity, hybrid search, reason.why/similar, temporal
  decay, memory consolidation, session bridge, MCP wiring (256 ops total)

Workstream C — Warp/Protocol Chains: WarpChain type system, default RCASD
  chain, chain validation engine, storage (Drizzle migration), composition
  operators, MCP pipeline/check wiring

Workstream D — MEOW Declarative Workflows: Tessera types, instantiation
  engine, orchestrate domain wiring, E2E workflow test

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
MCP tools are defined as `query` and `mutate` — the provider prefix
is added automatically by the client (e.g., `cleo_query`). Updated
all source, test, doc, and config references to use the base names.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Consolidate and update all specification documents with [IMPLEMENTED]/[TARGET] markers:

DELETED (superseded/consolidated):
- CLEO-OPERATIONS-REFERENCE.md (superseded by Constitution)
- CLEO-STRATEGIC-ROADMAP-SPEC.md (consolidated into ROADMAP.md)
- VITEST-V4-MIGRATION-PLAN.md (migration complete)
- CAAMP-1.6.1-API-INTEGRATION.md (consolidated)
- CAAMP-CLEO-INTEGRATION-REQUIREMENTS.md (consolidated)
- T5236-CAAMP-SPAWN-ADAPTER-DESIGN.md (consolidated)
- T5237-UNIVERSAL-HOOKS-DESIGN.md (consolidated)

UPDATED:
- ROADMAP.md: Added [IMPLEMENTED] and [TARGET] markers with epic references
- VERB-STANDARDS.md: Added 'purge' verb
- CLEO-OPERATION-CONSTITUTION.md: Synced to 256 operations
- MCP-SERVER-SPECIFICATION.md: 10 canonical domains, 256 ops, MCP-only BRAIN
- MCP-AGENT-INTERACTION-SPEC.md: Refreshed progressive disclosure framework
- PORTABLE-BRAIN-SPEC.md: Added portability section, NEXUS sync
- CLEO-METRICS-VALIDATION-SYSTEM-SPEC.md: Removed Bash refs, documented TS
- CLEO-DATA-INTEGRITY-SPEC.md: Marked partially implemented
- PROTOCOL-ENFORCEMENT-SPEC.md: Archived pending T5492 review

NEW:
- CAAMP-INTEGRATION-SPEC.md: Consolidated CAAMP docs with [TARGET] sections

Epics created for all [TARGET] items: T5492-T5506
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…5239)

- Update commit count 51→55 and theme count 10→13
- Add OpenCode spawn adapter + Tessera engine section (T5236, T5239)
- Add NEXUS reconcile CLI section (T5368)
- Add Specification Consolidation section with deleted/updated/new doc inventory (T5492-T5506)
- Add Conduit Protocol Specification section (T5524)
- Expand hook infrastructure table with all 8 events and full detail (T5237)
… plugin dirs (T5239)

The test asserted paths.length > 0 but getSkillSearchPaths filters to
only existing directories, which are absent in CI runners. Removed the
assertion since an empty array is valid behavior.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
On macOS, Date.now() can return the same millisecond value for
rapid consecutive calls, causing primary key collisions when
multiple observations are created in quick succession (e.g.,
during persistSessionMemory). This resulted in the second insert
throwing a UNIQUE constraint error, reducing observationsCreated
from 3 to 2 in CI.

Fix: append a monotonic sequence number to the observation ID
to guarantee uniqueness even within the same millisecond.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add step in CI workflow to prepend node_modules/.bin to GITHUB_PATH
  on Windows runners, so tests that spawn `cleo` as a child process
  can find the binary.
- Fix CLEO_SKILL_PATH splitting in skill-paths.ts to use path.delimiter
  instead of hardcoded ':' which breaks on Windows (where delimiter is ';').

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… (T5508)

- Add closeDb() calls in afterEach for pipeline, stage-record-provenance,
  sessions, and upgrade tests — Windows locks open SQLite files, preventing
  temp directory cleanup with rm()
- Fix path separator in sqlite.ts git-tracking warning: use sep instead of
  hardcoded '/' for basename extraction and path replacement

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…y (T5508)

- paths.test.ts: Replace hardcoded Unix path assertions with
  resolve()/join() calls that produce correct paths on both Unix and
  Windows (e.g. resolve('/my/project', '.cleo') instead of
  '/my/project/.cleo')
- security.test.ts: Use tmpdir()-based project roots and resolve() in
  sanitizePath test assertions instead of hardcoded '/home/user/project'
  paths. Fix "outside project root" test to use relative paths from
  the test root instead of absolute Unix paths like '/etc/passwd'.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…T5508)

Add closeAllDatabases() to sqlite.ts that closes tasks.db, brain.db,
and nexus.db singletons. On Windows, SQLite holds exclusive file handles
on .db/.db-wal/.db-shm files, causing EBUSY errors during test cleanup.

Changes:
- Add closeAllDatabases() async function to src/store/sqlite.ts
- Update 20+ test files to use closeAllDatabases() in afterEach/finally
- Fix fileURLToPath usage in test-environment.ts for Windows paths
- Normalize backslash paths to forward slashes in:
  - collectCleoFiles (sharing/index.ts)
  - getRelativeLogPath (migration/logger.ts)
  - handleFileChange (file-hooks.ts)
- Fix platform-aware test assertions:
  - Skip chmod check on Windows (hooks.test.ts)
  - Use path.basename instead of split('/') (project-info.test.ts)
  - Normalize backslashes in path assertions (mcp-install-verify, stage-record)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- evidence.ts: normalize backslashes in linkProvenance URI
- integration-setup.ts: use double quotes for CLI args on Windows (cmd.exe)
- init-e2e.test.ts: skip chmod permission bit check on Windows
- checksum.ts: close SQLite connection in finally block to prevent EBUSY
- upgrade.test.ts: add retry with delay for rmSync cleanup on Windows
- checksum.test.ts: add retry with delay for rm cleanup on Windows

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… idempotent release (T5508)

- Delete npm-publish.yml: redundant with release.yml, not in OIDC trust list
- release.yml: use gh CLI for GitHub release creation (idempotent — delete+recreate
  handles re-runs gracefully, no more "too many retries" on existing releases)
- release.yml: single job consolidation (was 3 jobs rebuilding project twice)
- release.yml: add workflow_dispatch as break-glass trigger with version input
- release.yml: consolidate dist-tag and is_prerelease logic into one step
- All ${{ }} expressions passed via env: vars (no injection surface)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@kryptobaseddev
Copy link
Owner Author

Superseded by PR #56 (chore/ci-pipeline-cleanup) — clean branch from main with only the CI changes.

@kryptobaseddev kryptobaseddev deleted the chore/validate-ci-protection branch March 6, 2026 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant