Commit 037fef5
committed
feat(catalog): add st2 catalog migrate-ids
One atomic transaction that makes an existing catalog expressible in decision
0015's identity model without re-keying any durable state.
- A live subject freezes its existing `<host>.<identity>` bus identity as its
explicit `id`, so every runtime identifier, task ID, socket path, and
declaration-anchored state path keeps its exact bytes.
- A structurally archived subject freezes the same bytes when they remain unique
across the combined live-and-archived set. An archived collision — the shape a
re-projecting generator and an archiving supervisor produce together — receives
a UUIDv7 in both its declaration and its tombstone, and the reassignment is
recorded in `.st2/agent-id-migration.json` so a reader of a version-1 durable
record never retypes colliding bytes into the wrong subject.
- Supervisor references resolve against the combined *pre-migration* index and
are rewritten to the parent's migrated ID in the same transaction. A missing or
ambiguous reference refuses before any write with `legacy-supervisor-unresolved`.
- The catalog must already admit: migration re-admits the whole live plane after
its writes, and a plane that already fails admission would fail that
re-admission for a reason migration did not cause, leaving every declaration
rewritten and the generation unmoved. A dry run still reports its full plan.
- `--resume` finishes an interrupted run and may only apply work the interrupted
transaction planned. A plain rerun over a half-migrated plane refuses.
Edits are span-bounded over exact source bytes through the authoring module's
existing insertion helper, so comments, formatting, and every unrelated byte
survive. TOML and JSON declarations refuse. A Nix-owned declaration IS migrated —
the marker guards interactive authoring, not the one transaction that has to
reach the whole plane — and the receipt names it so its generator can be taught
to emit `id` before the next activation re-projects the file without one.1 parent b750a8b commit 037fef5
4 files changed
Lines changed: 2065 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1720 | 1720 | | |
1721 | 1721 | | |
1722 | 1722 | | |
1723 | | - | |
| 1723 | + | |
1724 | 1724 | | |
1725 | 1725 | | |
1726 | 1726 | | |
| |||
1764 | 1764 | | |
1765 | 1765 | | |
1766 | 1766 | | |
1767 | | - | |
| 1767 | + | |
1768 | 1768 | | |
1769 | 1769 | | |
1770 | 1770 | | |
| |||
1793 | 1793 | | |
1794 | 1794 | | |
1795 | 1795 | | |
1796 | | - | |
| 1796 | + | |
1797 | 1797 | | |
1798 | 1798 | | |
1799 | 1799 | | |
| |||
1855 | 1855 | | |
1856 | 1856 | | |
1857 | 1857 | | |
1858 | | - | |
| 1858 | + | |
1859 | 1859 | | |
1860 | 1860 | | |
1861 | 1861 | | |
| |||
1900 | 1900 | | |
1901 | 1901 | | |
1902 | 1902 | | |
1903 | | - | |
| 1903 | + | |
1904 | 1904 | | |
1905 | 1905 | | |
1906 | 1906 | | |
| |||
2038 | 2038 | | |
2039 | 2039 | | |
2040 | 2040 | | |
2041 | | - | |
| 2041 | + | |
2042 | 2042 | | |
2043 | 2043 | | |
2044 | 2044 | | |
| |||
0 commit comments