Tier 2 deploy hardening + Save-a-Copy converter fix#42
Open
kirkabowman wants to merge 6 commits into
Open
Conversation
- analyze.py: change glob() to rglob() so folder-nested CFs are found; filter out folder separator pseudo-files via stub XML existence check; add folder_path to CF data and index loader - fmcontext.sh: fix sanitized body path lookup to be subfolder-relative (flat lookup silently missed nested CFs, misclassifying all as functional); add FolderPath as 7th column to custom_functions.index header and output; replace mapfile with while-read loop for bash 3.2 compatibility on macOS
- build_cf_names: use rglob instead of iterdir so custom functions nested inside folder-group subdirectories are discovered - parse_scripts: extend bracket guard to include lines with ']' so zero-argument CF calls on expression-continuation lines are not skipped Made-with: Cursor
Hardens deploy.py --tier 2 against the silent failure modes that surface during real-world bulk deploys (hidden target files, prefix-collision in file names, cross-file Script Workspace context, missing fmextscriptaccess privilege, tabs not switching after MBS OpenScript) by adding a pre-flight privilege probe, a post-deploy verification step, a Show-Window submenu fallback for hidden files, anchored window-title matching, and a fail-fast tab-click guard. Fixes a silent data-loss bug in fm_xml_to_snippet.py where Save a Copy as XML dropped its destination path and analysis-tools flag, and patches the install template (filemaker/agentic-fm.xml) so new installs ship with the corrected Agentic-fm Paste (Open Script Workspace + 3x ExpandScriptFolders before OpenScript) needed for deploys to scripts in collapsed folders. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The original commit added pre-flight + post-deploy verification but the fail-fast tab-click guard inside _paste_applescript was missing — when no Script Workspace tab matched the target script (because MBS OpenScript silently failed, or the wrong file's SW was frontmost), the AppleScript silently fell through to the keystroke paste sequence and clobbered whatever tab had focus. Now Phase 2 returns "ERROR: no SW tab matching" before any paste keystroke, and _tier2 surfaces it as success=False. Caught when "Get Text Embedding" deploy clobbered Agentic-fm Paste in A2X_General because A2X_General_data was hidden and the Show Window fallback hadn't yet brought it forward when Phase 2 ran. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Same lost-edits pattern as the previous fail-fast commit. The
_switch_to_document helper (and its inline duplicate in _tier3) was
still using `whose name contains "X"` for Window menu matching, which
collides on prefixes (e.g. "A2X_General" matches "A2X_General_data") and
returns nothing for hidden files. Restored:
- Anchored matching: `name is "X" or name starts with "X ("` so
"A2X_General" never picks "A2X_General_data" or vice versa.
- Excludes "Script Workspace " prefixed entries which sort first and
would be picked instead of the database window.
- Show Window submenu fallback: when no visible window matches, click
the matching entry in Window > Show Window submenu to unhide before
proceeding.
Caught when "Get Text Embedding" deploy to A2X_General_data (hidden)
returned ERROR from the new fail-fast guard — fix here unhides the
target file so MBS OpenScript can route correctly.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Promotes four recurring-mistake rules from Claude-Code-specific personal memory into project-shared agent-instructions doc, so any AI tool (Cursor, Copilot, Aider, Codex CLI, etc.) inherits them via the four agent-instructions symlinks: - Use FM Script Workspace step row numbers, not HR .txt line numbers (with awk one-liner for converting HR line → FM row) - Always resolve real script names from scripts.index — sanitized filenames strip ':' and '|' - "Perform Script — Specified: From list" is the hardcoded variant - '# (comment)' steps support multi-line text Adds a warning to CONVERTERS.md about tx_generic silently dropping unhandled param types (flagBoolean, text-typed UniversalPathList) — the class of bug that hid the Save a Copy as XML data loss for years. Bumps the hand-coded translator count from 48 to 49. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
ead9848 to
ed53906
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
agent/scripts/deploy.py --tier 2against silent failure modes that surface during real-world bulk deploys: hidden target files, prefix-collision in file names (A2X_General⇄A2X_General_data), cross-file Script Workspace context, missingfmextscriptaccessprivilege, tabs not switching afterMBS OpenScript, locked sibling files aborting AppleScript probes.-10004with an actionable message, and a post-deploy verification step that confirms the paste landed in the right SW + tab + step count.agent/scripts/fm_xml_to_snippet.py:Save a Copy as XMLwas dropping its destination path (UniversalPathList) and the analysis-tools flag (flagBoolean). Adds hand-codedtx_save_copy_as_xmltranslator.filemaker/agentic-fm.xml) so new installs ship with the correctedAgentic-fm Paste(Open Script Workspace+ 3×ExpandScriptFoldersbeforeOpenScript). Without this, fresh installs hit the collapsed-folder bug whenever the target script lives in a folder.agent/docs/TIER2_DEPLOY.mddocuments prerequisites, real-vs-sanitized name resolution, bulkpipefaildiscipline, the failure-mode table, and AppleScript debug snippets..claude/CLAUDE.mdstep 7 to reference TIER2_DEPLOY.md before any Tier 2 deploy.Compatibility with existing PRs
This PR overlaps two open PRs on this fork:
feat/save-copy-as-xml-translator— identicalfm_xml_to_snippet.pycontent. If that PR merges first, this one's diff for that file disappears cleanly.fix/deploy-targeting— overlaps anchored matching incompanion_server.pyand somedeploy.pylines. Maintainer can land that PR first and rebase this one, or land this one and close that.Test plan
A2X_Generalspecifically (notA2X_General_data) — anchored matching prevents prefix collisionExpandScriptFolders(in patched install template) unblocks itSave a Copy as XMLviafm_xml_to_snippet.py— destination path + Option flag preserved🤖 Generated with Claude Code