Skip to content

adf fmt --write folds sections with unrecognised headers (multi-word key, doubled U+FE0F) into the previous section #389

Closed

Description

@stackbilt-admin

Found in the #383 review (#351). Reproduced on main @ 64ff57d.

charter adf fmt --write silently restructures a file that has a section header the parser doesn't recognise, such as a multi-word key (🔐 SENSITIVITY TIERS:) or a decoration with a doubled U+FE0F (⚠️️ CONSTRAINTS:). The parser doesn't treat those lines as headers, so it reads them as continuation lines of the previous section. The formatter then rewrites them indented inside that section, prints [ok] Reformatted and exits 0:

📐 RULES:
  - keep me

🔐 SENSITIVITY TIERS:
  - tier one

becomes

📐 RULES:
  - keep me
  
  🔐 SENSITIVITY TIERS:
  - tier one

The text is still there, but the section is gone as a section. Bundling, routing and doctor no longer see SENSITIVITY TIERS, and RULES gains stray content. This repo's own .ai/typed-data-access.adf has this header shape.

Expected, either of:

  • adf fmt (and --check) reports an unparseable header line and refuses to write, exiting non-zero; or
  • the parser accepts multi-word keys and repeated variation selectors, so they round-trip.

Related, minor: charter adf init suggests charter adf fmt .ai/core.adf --check as a next step, but a fresh scaffold fails --check because the templates are not in canonical section order.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions