[BUG] APM 0.33.0: apm update fails to integrate Azure Skills because frozen hook metadata is not JSON serializable
I maintainer di solito rispondono entro 2 giorni
@MohammedAlkindi ci sta già lavorando.
Dal 9/10/2026.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 90/100
Direzione di ricerca
Inizia da src/apm_cli/integration/hook_native_formats.py: esegui lo snippet di riproduzione dell'issue (json.dumps(_to_claude_hook_entries([{'bash': 'echo test', 'env': {'APM_TEST': 'value'}}]))) per vedere l'errore mappingproxy, poi traccia dove dict(handler.metadata), dict(binding.metadata) e i percorsi delle voci grezze fanno solo una copia superficiale del IR congelato prodotto da _freeze in src/apm_cli/hook_contract.py. Aggiungi un materializzatore ricorsivo (Mapping -> dict, list/tuple -> list, scalari conservati) applicato a handler, binding e voci grezze sia nei percorsi di rendering annidati che piatti. Fatto quando la riproduzione viene serializzata, i test esistenti dell'adapter di hook passano ancora e nuovi test coprono i round trip JSON per Claude/Codex/Gemini/nested-flat Antigravity, la conservazione dell'env annidato e la non mutazione del IR congelado.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
With APM CLI 0.33.0, apm update fails while integrating microsoft/azure-skills:
[x] 1 package failed:
+- microsoft/azure-skills -- Failed to integrate primitives: Object of type mappingproxy is not JSON serializable
[x] Installation failed with 1 error(s).
Environment
- APM CLI: 0.33.0
- Reported installation: Windows, WinGet standalone executable and macOS 27.01 (Homebrew)
- Dependency: microsoft/azure-skills
- Targets: claude, codex, copilot
Steps to reproduce
Use APM CLI 0.33.0.
Add microsoft/azure-skills to an APM project with the following configuration.
Run apm update.
name: apm-hook-repro
version: 1.0.0
description: Minimal Azure Skills integration reproduction
author: APM user
targets:
- claude
- codex
- copilot
dependencies:
apm:
- microsoft/azure-skills
The dependency is not pinned here; reproduction depends on it containing hooks with nested metadata, such as an env object.
Expected behavior
APM integrates the hooks successfully, preserving their environment variables
and other metadata in the generated native JSON documents.
Actual behavior
Integration fails with the error above, and the install transaction is not committed.
Root cause
src/apm_cli/hook_contract.py recursively freezes hook metadata in _freeze:
dictionaries become MappingProxyType instances, and lists become tuples.
This is appropriate for the immutable intermediate representation (IR).
However, src/apm_cli/integration/hook_native_formats.py only makes a shallow
copy with dict(handler.metadata) and dict(binding.metadata). Nested mappings
remain frozen. The raw-entry paths also return frozen metadata directly.
Consequently, JSON serialization fails when it encounters a nested mapping proxy.
The failure can be reproduced without downloading Azure Skills or executing hooks:
import json
from apm_cli.integration.hook_native_formats import _to_claude_hook_entries
entries = [{
"bash": "echo test",
"env": {"APM_TEST": "value"},
}]
json.dumps(_to_claude_hook_entries(entries))
Proposed fix
Recursively materialize metadata at the native rendering boundary:
- Convert
Mappingvalues to new dictionaries. - Convert lists and tuples to new lists, recursively converting their elements.
- Preserve scalar values.
- Apply the conversion to handler metadata, binding metadata, and raw entries in
both the nested and flat rendering paths.
Keep the IR immutable. Do not stringify unsupported values with default=str,
discard env, or change dependency declarations as a workaround.
Regression coverage
- JSON round trips for Claude, Codex, Gemini, and nested/flat Antigravity adapters.
- Preservation of nested
env, extension metadata, arrays, and scalar values. - Preservation of commands, timeout conversion, matchers, and provenance.
- Raw-entry round trips, including mappings inside arrays.
- Mutation of rendered output does not mutate the source or frozen IR.
- Gemini's in-place compatibility conversion preserves
env.
- Lingua principale
- Python
- Stelle
- 4k
- Fork
- 387
- Merge medio
- 5g 44m
- PR unite (30g)
- 60
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di microsoft/apm
-
status/accepted
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
microsoft/apm#3259 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
type/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 2 giorni
-
[BUG] Flat hook entries without `type` reach `.codex/hooks.json` without the required `type: command`Forse già presa @Parth-Vasave l’ha presa 1 giorno fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
microsoft/apm#3249 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
type/automation type/performance
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di microsoft/apm
Issue simili
-
docs: the dev-setup table and AGENTS.md name the reviewed_by guard that CI's Changelog job runsApertaarea: tools documentation good first issue ready for a contributor
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
eyalgolan/statecraft-israel#873 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Add cover art to song rowsApertaenhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 5 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
bug good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno