---
id: 11408
title: Delete obsolete migrate-substrate-11360 script
state: CLOSED
labels:
  - enhancement
  - ai
  - refactoring
  - 'agent-task:in-progress'
  - architecture
assignees:
  - neo-gpt
createdAt: '2026-05-15T09:55:14Z'
updatedAt: '2026-05-15T10:40:23Z'
githubUrl: 'https://github.com/neomjs/neo/issues/11408'
author: neo-gpt
commentsCount: 0
parentIssue: 11372
subIssues: []
subIssuesCompleted: 0
subIssuesTotal: 0
blockedBy: []
blocking: []
closedAt: '2026-05-15T10:40:23Z'
---
# Delete obsolete migrate-substrate-11360 script

## Context

ADR 0004 moved `resources/content/` to the Universal Ordinal-100 Content Architecture and explicitly anchors recovery on clean deletion plus `sync_all` regeneration. During PR #11403 follow-up review, `ai/scripts/migrate-substrate-11360.mjs` stood out as leftover one-shot substrate code from the pre-ADR #11360 cleanup path.

This ticket exists because the script now points in the wrong architectural direction: it preserves a migration affordance after the architecture has chosen a clean cut.

## The Problem

`ai/scripts/migrate-substrate-11360.mjs` is a one-shot repair script introduced for #11360 / PR #11362. It remains tracked after that migration completed and after ADR 0004 established the new source-of-truth model.

Current evidence:

- `ai/scripts/migrate-substrate-11360.mjs:2` identifies itself as a one-shot script for Epic #11187 Phase 6 sub-issue #11360.
- `ai/scripts/migrate-substrate-11360.mjs:29-31` still advertises manual `--dry-run` / `--apply` execution.
- `ai/scripts/migrate-substrate-11360.mjs:56` defines local `chunkPath()` for the retired pre-ADR ID-range model.
- `ai/scripts/migrate-substrate-11360.mjs:171`, `:208`, and `:232-233` still generate retired `resources/content/issues/<NNN>xx/` and `resources/content/pulls/pr-<NNN>xx/` paths.
- `rg migrate-substrate-11360` found no live consumer outside the script itself.
- Git history preserves the audit trail: `559c73d43` introduced the script for #11360 / #11362, and `79ac1f8c9` only adjusted its comment while deleting retired path helpers for #11390 / #11403.

## The Architectural Reality

ADR 0004 is the source of authority:

- `learn/agentos/decisions/0004-github-content-architecture.md:51-53` states `resources/content/` and `.sync-metadata.json` are regeneratable; `sync_all` is the recovery mechanism.
- `learn/agentos/decisions/0004-github-content-architecture.md:68-84` defines the target shape as universal `chunk-N/` directories with no `<NNN>xx/`, no GitHub-ID-stream math, and one primitive.
- `learn/agentos/decisions/0004-github-content-architecture.md:284-294` rejects deprecation or coexistence windows for retired primitives and prescribes deletion when migration lands.

Keeping the old script creates a misleading executable artifact for future agents and conflicts with the clean-cut mental model. Git history is sufficient audit trail; tracked executable substrate should reflect the current architecture.

## The Fix

Delete `ai/scripts/migrate-substrate-11360.mjs`.

Do not replace it with a new migration script, shim, wrapper, or compatibility alias. If local `resources/content/` state needs repair, the operator or agent should use the ADR 0004 recovery path: clean substrate deletion where needed, then run `sync_all` from `dev`.

Coordinate with #11406 if its retired-primitive grep enforcement lands first or in parallel, so the deleted script does not require a special allowlist.

## Acceptance Criteria

- [ ] `ai/scripts/migrate-substrate-11360.mjs` is deleted.
- [ ] No new migration script or compatibility shim is added for #11360.
- [ ] `rg "migrate-substrate-11360|function chunkPath|pr-\\$\\{chunkPath|issues/\\$\\{chunkPath" ai buildScripts test package.json` finds no live-code reference requiring the retired ID-range model.
- [ ] The PR body cites ADR 0004 and explains that Git history preserves the #11360 audit trail.
- [ ] If #11406 grep enforcement is already merged, its check passes without an allowlist entry for this deleted script.

## Out of Scope

- Rewriting `contentPath.mjs` or syncer chunk semantics.
- Mutating `resources/content/` data files.
- Running `sync_all` from a feature branch.
- Deleting or rewriting historical GitHub issue, PR, or ADR content that references the old model.
- Updating unrelated release JSDoc comments unless the close-out lane explicitly owns that scope.

## Related

- Parent Epic: #11372
- Predecessor cleanup ticket: #11360
- PR #11362 introduced the one-shot script for the old cleanup path.
- PR #11403 deleted the retired shared path helpers and exposed this script as the remaining live executable artifact.
- #11406 tracks CI grep-fail enforcement for retired primitive imports.
- ADR 0004: `learn/agentos/decisions/0004-github-content-architecture.md`

Origin Session ID: 56d01d8b-ce3f-4194-9441-e4941ae07be8

Handoff Retrieval Hint: "ADR 0004 migrate-substrate-11360 clean cut sync_all retired chunkPath"

## Timeline

- 2026-05-15T09:55:15Z @neo-gpt added the `enhancement` label
- 2026-05-15T09:55:15Z @neo-gpt added the `ai` label
- 2026-05-15T09:55:16Z @neo-gpt added the `refactoring` label
- 2026-05-15T09:55:16Z @neo-gpt added the `agent-task:pending` label
- 2026-05-15T09:55:16Z @neo-gpt added the `architecture` label
- 2026-05-15T09:55:30Z @neo-gpt added parent issue #11372
- 2026-05-15T09:59:17Z @neo-gpt removed the `agent-task:pending` label
- 2026-05-15T09:59:17Z @neo-gpt added the `agent-task:in-progress` label
- 2026-05-15T09:59:18Z @neo-gpt assigned to @neo-gpt
- 2026-05-15T10:05:42Z @neo-gpt cross-referenced by PR #11409
- 2026-05-15T10:40:23Z @tobiu referenced in commit `8cbc81f` - "chore(ai): delete obsolete migration script (#11408) (#11409)

Co-authored-by: tobiu <tobiasuhlig78@gmail.com>"
- 2026-05-15T10:40:23Z @tobiu closed this issue

