Skip to content

fix(metadata): rename form_* metadata files so filename matches the name field - #527

Open
RazvanZegheanu wants to merge 1 commit into
stablefrom
fix/oob-metadata-filename-matches-name
Open

fix(metadata): rename form_* metadata files so filename matches the name field#527
RazvanZegheanu wants to merge 1 commit into
stablefrom
fix/oob-metadata-filename-matches-name

Conversation

@RazvanZegheanu

Copy link
Copy Markdown

What

Renames 139 metadata files so the filename prefix matches the name field inside the file, for the 11 form_* IRS-form packages:

1040__31__metadata.json          ->  form_1040__31__metadata.json
1040ScheduleC__22__metadata.json ->  form_1040ScheduleC__22__metadata.json
...

Rename only — no file contents change (139 files changed, 0 insertions(+), 0 deletions(-), all R100). In particular name and displayName are untouched.

Why

The AI Center OOB installer derives the package name it queries with from the metadata filenamestrings.Split(fileName, "__")[0] in oobartifactsmanager.go:189 — but ai-pkgmanager stores and filters on the metadata body's name field. The installer never parses the body; it passes it through as an opaque string.

For these 11 packages the two disagreed (1040 vs form_1040), so:

  1. GET /v1/mlpackages?...&name=10400 hits (the row is name=form_1040)
  2. installer takes the create branch instead of add-version
  3. POST /v1/mlpackages409 {"respCode":20005,"respMsg":"MLPackage with name form_1040 already exists"}
  4. repeat for every version 2..N

The other 54 packages already have filename == name == displayName and work correctly — this brings the remaining 11 in line.

Impact today

  • Only version 1 of each of these 11 packages ever installs. Versions 2..N are silently dropped on every install — including installs that pass, because a 409 does not fail the job (the gate is succeedPkgList.IsEmpty() && len(errs) > 0, an AND, and plenty of other packages succeed).
  • ~130 doomed creates + ~260 409s per installer attempt, repeated on every retry (the broken packages never make progress, so they are re-attempted in full each time). This contributes to the aicenter Argo PostSync hook exceeding its 20-minute budget and timing out Automation Suite installs on ETE PR-gate builds (def 15144 DO_NOT_FORCE_MERGE_IF_RED) — e.g. builds 13009164 (24.10) and 13017145 (2025.10.4).

Why rename the files rather than change name

name is user-visible — it's what the AI Center catalog shows and what deployed ML Skills / activities reference. Renaming form_10401040 would be a breaking change for existing customers, and on an install that already has form_1040 rows the installer would create a second package rather than reconcile.

Renaming the files achieves the same lookup fix with zero customer-visible impact: the catalog still shows form_1040 with displayName 1040, and existing skills keep resolving.

Blast radius checked

  • form_ appears nowhere outside metadata/ — no code, config, or test in the ai-center monorepo references these names.
  • No sibling directory (gpu/, database/, orchestrator/, platform/, patches/, language_version_metadata/) uses these prefixes.
  • metadata_generate_new_du_versions.ps1 matches ^([a-zA-Z0-9_]+)__([0-9]+)__metadata\.json$ — underscores already allowed, so it keeps working unchanged.
  • The airgap path (blobmanager.go) parses blob paths (<name>/<version>/*.zip), a separate naming scheme — unaffected by this rename.

⚠️ One caller that must be updated in lockstep

aifabric-packaging/scripts/airgap-bundle/bundle.sh:97 fetches metadata by operator-supplied MODEL:VERSION:

wget ".../metadata/${MODEL}__${VERSION}__metadata.json"

It exit 1s on a 404. Nothing hardcodes the model list (it comes from the bundle invocation), but anyone building an airgap bundle must now pass form_1040:31 instead of 1040:31 for these 11 packages. Worth calling out in the airgap runbook / release notes.

Verification

metadata files: 869
packages      : 65
MISMATCHED    : 0        <-- was 11

Re-run after checkout:

cd metadata
python3 -c "
import json,glob,re,collections
byname=collections.defaultdict(list)
for f in glob.glob('*__metadata.json'):
    m=re.match(r'(.+?)__(\d+)__metadata\.json',f)
    if m: byname[m.group(1)].append(int(m.group(2)))
mism=[p for p,v in byname.items() if json.load(open(f'{p}__{max(v)}__metadata.json')).get('name')!=p]
print('packages:',len(byname),' mismatched:',len(mism), mism)
"

displayName preserved (spot check):

filename prefix name displayName
form_1040 form_1040 1040
form_1040ScheduleC form_1040ScheduleC 1040ScheduleC
form_4506T form_4506T 4506T

Notes

  • form_990 is included for consistency but is currently filtered out before any POST by the isSupported / minAIFabricVersion check (its imagePath is du-semistructured:v22.10-10.10-rc01), so it is latent rather than actively failing.
  • This fixes catalog correctness. It does not by itself fix the install timeouts — those are driven mainly by ~9 HTTP calls per package-version (redundant health / tenants / projects / probe calls re-issued ~770× per run). That needs a separate change in oob-model-tool.

…ame field

The OOB installer derives the ML package name it queries with from the
metadata *filename* (strings.Split(fileName, "__")[0] in
oobartifactsmanager.go:189), but ai-pkgmanager stores and filters on the
metadata body's `name` field. For these 11 IRS-form packages the two
disagreed -- filename `1040` vs name `form_1040` -- so the installer's
lookup `GET /v1/mlpackages?name=1040` always returned empty, it took the
"create" branch, and every version 2..N failed with
HTTP 409 / respCode 20005 "MLPackage with name form_1040 already exists".

Effect today: only version 1 of each of these packages ever installs; the
rest are silently dropped on every install, including installs that pass
(a 409 does not fail the job -- the gate is
`succeedPkgList.IsEmpty() && len(errs) > 0`, an AND). The wasted work also
contributes ~130 doomed creates + ~260 409s per attempt to the aicenter
PostSync hook, which has been timing out AS installs on ETE PR-gate builds.

Rename only: `1040__31__metadata.json` -> `form_1040__31__metadata.json`
for all 139 affected files. No file contents change (139 files, 0
insertions, 0 deletions) -- in particular `name` and `displayName` are
untouched, so nothing customer-visible changes: the catalog still shows
`form_1040` / displayName `1040`, and existing ML Skills keep resolving.

After this change all 65 packages satisfy filename == name, matching the
convention the other 54 already follow.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants