Version: v0.1.0
Treat every .atbx edit as a tool contract change across several archive members. A successful edit keeps structure, localized text, metadata, validation logic, execution logic, and package integrity in parity.
Use these five gates throughout the task:
Confirmed, Inferred, or Unverified; never invent missing ArcGIS/GeoScene semantics..atbx archive conventions: forward-slash entry names, no duplicate ZIP entries, UTF-8 XML, UTF-8 JSON with ASCII escaping for non-ASCII text, and $rc: indirection through .rc maps..atbx files that can be opened as ZIP packages..tool/tool.content as the authoritative parameter structure..tool/tool.content.rc as the authoritative localized text source when tool.content uses $rc:.....tool/tool.metadata.xml as a required synchronized projection, not optional documentation.tool.script.validate.py and tool.script.execute.py as part of the same parameter contract whenever parameters, value lists, indexes, defaults, or allowed values change.scripts/inspect_atbx.py before editing.references/atbx-format-notes.md and references/known-file-patterns.md only when package shape, file roles, or edit targets are unclear.scripts/apply_parameter_changes.py for clear, repeatable parameter changes described by a manifest.scripts/patch_atbx.py only for tightly scoped deterministic changes.tool.content, tool.content.rc, tool.script.validate.py, and tool.script.execute.py as required.scripts/sync_tool_metadata.py for every edited tool unless apply_parameter_changes.py already regenerated metadata.scripts/validate_atbx.py on the edited archive. Use --tool ToolName for focused checks when unrelated historical defects exist outside the changed tools.references/validation-checklist.md before final delivery.scripts/atbxlib importable.PYTHONHOME and PYTHONPATH for helper-script processes when the default Python is polluted.ModuleNotFoundError: No module named 'encodings', switch to a known-good Python executable or report that script validation could not run.PYTHONUTF8=1 for that process..content and .rc JSON as UTF-8 with ASCII escaping for non-ASCII text.For any add, remove, rename, reorder, type change, default change, or value-list edit, verify all of:
tool.content parameter list and ordertool.content.rc labels, descriptions, and enum labelstool.metadata.xml parameter list, order, summary, and help texttool.script.validate.py index usage, enable/disable logic, filters, and messagestool.script.execute.py index usage, branches, conversions, and downstream callsHigh-risk patterns:
range(4, 16) after adding or removing parameters.Always synchronize tool.metadata.xml after parameter or text edits. Do not assume ArcGIS Pro or GeoScene ignores metadata.
Use:
python scripts/sync_tool_metadata.py path/to/file.atbx --tool ToolName --output path/to/out.atbx
Use --in-place only when the user explicitly wants the source archive rewritten and a backup is acceptable.
The metadata sync helper:
tool.metadata.xml from tool.contenttool.content.rctool.contentscripts/inspect_atbx.py: inventory, structure, and initial validation.scripts/diff_atbx.py: compare before/after archives by normalized internal path.scripts/apply_parameter_changes.py: default entry point for manifest-driven parameter edits.scripts/patch_atbx.py: narrowly scoped deterministic patches.scripts/sync_tool_metadata.py: regenerate metadata after source changes.scripts/validate_atbx.py: final archive and contract validation.Manifest-driven example:
python scripts/apply_parameter_changes.py path/to/file.atbx \
--manifest references/parameter-change-manifest.example.json \
--output path/to/out.atbx
Supported manifest operation kinds:
set-tool-fieldsrc-setset-parameter-domainadd-parameterremove-parameterrename-parameterupdate-parameterreorder-parametersscript-replace-textscript-replace-regexThe manifest helper applies content and rc changes, refuses structural parameter edits unless validate/execute changes are covered or assume_scripts_already_aligned=true, regenerates metadata, and runs focused validation.
See references/parameter-change-manifest.example.json when constructing a manifest.
tool.metadata.xml and skip tool.content.tool.content and skip metadata sync..atbx still opens as a ZIP..tbx, .pyt, unrelated ArcPy scripting, or read-only license/version audits.Report:
共 2 个版本