Skip to content

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

Merged
RazvanZegheanu merged 1 commit into
testingfrom
fix/oob-metadata-filename-matches-name-testing
Aug 13, 2026
Merged

fix(metadata): rename form_* metadata files so filename matches the name field (testing)#528
RazvanZegheanu merged 1 commit into
testingfrom
fix/oob-metadata-filename-matches-name-testing

Conversation

@RazvanZegheanu

Copy link
Copy Markdown

What

Same change as #527, applied to testing instead of stable.

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). 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

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).

The OOB_METADATA_BRANCH env var on the installer Job selects which branch is read, so testing needs the same fix as stable for any environment pointed at it.

Recomputed, not cherry-picked

testing has diverged from stable, so the rename was regenerated against testing's own contents rather than cherry-picked:

stable testing
metadata files 870 875
packages 65 71
mismatched packages 11 11
files renamed 139 139

The affected set is identical — same 11 packages, same version ranges (1040 18 versions 23–45, 4506T 19 versions 2–47, etc.). The extra 6 packages on testing all already satisfy filename == name.

Verification

Before → after on this branch:

files: 875  packages: 71  MISMATCHED: 11
files: 875  packages: 71  MISMATCHED: 0

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)
"

Checked before renaming: no target filename already existed, no duplicate targets, and every version of each package agreed on its name value (so no package needed splitting).

displayName preserved:

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 on a 22.10 build), so it is latent rather than actively failing.
  • Anyone building an airgap bundle must now pass form_1040:31 instead of 1040:31bundle.sh:97 fetches metadata by operator-supplied MODEL:VERSION and exit 1s on a 404. Nothing hardcodes the model list.
  • Should be merged together with fix(metadata): rename form_* metadata files so filename matches the name field #527 so stable and testing stay consistent.

…ame field

Same change as #527 (which targets stable), applied to testing.

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).

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 rename was recomputed against testing rather than cherry-picked from the
stable branch, since testing has diverged (875 metadata files / 71 packages
vs 870 / 65 on stable). The affected set is identical: the same 11 packages
with the same version ranges, 139 files.

After this change all 71 packages on testing satisfy filename == name.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@RazvanZegheanu
RazvanZegheanu merged commit 1d98fcb into testing Aug 13, 2026
2 checks passed
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