Repository navigation
Fix legacy casting upgrades, portable MCP config, and CRLF preservation #2190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
bradygaster
merged 5 commits into
dev
from
tamirdresher-microsoft-legacy-casting-upgrade-migration
Oct 13, 2026
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
cfba40b
fix: migrate legacy casting before upgrade writes
3b5454d
fix: keep upgrade MCP config portable and preserve newlines
0a91212
fix: copy unknown managed assets byte-for-byte
75bfec3
fix: support evidenced historical casting assignments
1183c83
Merge branch 'dev' into tamirdresher-microsoft-legacy-casting-upgrade…
bradygaster File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| --- | ||
| "@bradygaster/squad-sdk": patch | ||
| --- | ||
|
|
||
| Support historical assigned_at casting timestamps with conflict detection and | ||
| preserved original dates. Provide actionable fail-closed recovery diagnostics | ||
| for missing universe evidence without inventing historical state. Convert | ||
| historical entries/assignments using unambiguous authoritative folder/charter | ||
| identities and explicit assignment membership, preserving timestamps and | ||
| byte-exact originals while rejecting missing or conflicting identity evidence. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| "@bradygaster/squad-sdk": patch | ||
| "@bradygaster/squad-cli": patch | ||
| --- | ||
|
|
||
| Automatically migrate supported unversioned casting state before upgrading managed files, including already-current upgrades. Preserve identities and timestamps, archive original registry/history bytes without overwriting, and fail closed on unsupported or inconsistent state. Dry runs validate without mutating casting state. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| "@bradygaster/squad-cli": patch | ||
| "@bradygaster/squad-sdk": patch | ||
| --- | ||
|
|
||
| Keep standalone squad_state MCP commands portable in shared project configuration while retaining machine-local launch resolution. Preserve existing destination newline style when upgrading managed text files and refreshing coordinator capabilities, avoiding newline-only rewrites. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| import { copyFileSync, existsSync, readFileSync, writeFileSync } from 'node:fs'; | ||
| import { extname } from 'node:path'; | ||
|
|
||
| const MANAGED_TEXT_EXTENSIONS = new Set([ | ||
| '.md', '.json', '.yml', '.yaml', '.js', '.mjs', '.cjs', '.ts', | ||
| '.ps1', '.sh', '.txt', '.template', | ||
| ]); | ||
|
|
||
| function readExisting(filePath: string): string | undefined { | ||
| try { | ||
| return readFileSync(filePath, 'utf8'); | ||
| } catch (error) { | ||
| if ((error as NodeJS.ErrnoException).code === 'ENOENT') return undefined; | ||
| throw error; | ||
| } | ||
| } | ||
|
|
||
| /** Keep destination newlines, and avoid rewriting a newline-only difference. */ | ||
| export function writeManagedText(filePath: string, content: string): boolean { | ||
| const existing = readExisting(filePath); | ||
| const normalize = (text: string) => text.replace(/\r\n?|\n/g, '\n'); | ||
| if (existing !== undefined && normalize(existing) === normalize(content)) return false; | ||
| const eol = existing?.match(/\r\n|\n|\r/)?.[0]; | ||
| const next = eol ? normalize(content).replace(/\n/g, eol) : content; | ||
| writeFileSync(filePath, next, 'utf8'); | ||
| return true; | ||
| } | ||
|
|
||
| export function copyManagedFile(source: string, destination: string): void { | ||
| if (!MANAGED_TEXT_EXTENSIONS.has(extname(source).toLowerCase()) || !existsSync(destination)) { | ||
| copyFileSync(source, destination); | ||
| return; | ||
| } | ||
| const bytes = readFileSync(source); | ||
| const text = bytes.toString('utf8'); | ||
| if (bytes.includes(0) || !bytes.equals(Buffer.from(text, 'utf8'))) { | ||
| copyFileSync(source, destination); | ||
| return; | ||
| } | ||
| writeManagedText(destination, text); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.