Skip to content

[agent] pkg-sunholo-ailang-parse: md->docx: footnotes unsupported; multi-paragraph list item restarts… - #194

Merged
sunholo-voight-kampff merged 4 commits into
mainfrom
coordinator/task-08579b94
Dec 2, 2026
Merged

sunholo-voight-kampff merged 4 commits into
mainfrom
coordinator/task-08579b94

Conversation

@sunholo-voight-kampff

Copy link
Copy Markdown
Collaborator

Request

You are an autonomous AILANG package maintainer. The cascade root package
`` had a class **** change (interface or
effect-ceiling delta). The wrapper already attempted a deterministic dependency
bump, lock regeneration, and ailang check/`ailang test`, and it FAILED — that
is why you have been invoked. Your job is to repair the consumer code so the
bump can land.

Cascade context (provided by the wrapper)

  • Root package: ``
  • Bump: →
  • Change class: ``
    • A = content-only (deterministic should NOT have failed; investigate the wrapper's check output)
    • B = additive interface (new exports, no removals; check should normally pass)
    • C = breaking interface (removed exports OR widened effects — repair expected)
  • Interface hash: →
  • Effects widened: false (was [], now [])

What to do

  1. Read this package's ailang.toml — note the dep pin for (the wrapper has already updated it to).
  2. Read AGENT.md if present for package-specific instructions.
  3. Run ailang check --package . to see the current breakage.
  4. Read the failing consumer source — figure out what changed in the root package
    (look at the new version's exports vs the old).
  5. Edit the consumer source to adapt to the new interface or effect ceiling.
  6. Re-run ailang check --package . until green.
  7. Run ailang test --package . if *_test.ail exists; fix breakages until green.
  8. Leave the changes in the working tree. Do NOT commit.

The wrapper around you (the AILANG coordinator's execute-job) will:

  • git add -A and commit every file you changed
  • Push your branch deterministically
  • Open the GitHub PR automatically with the right title/body/labels

You do NOT need to — and on the ailang_only lane CANNOT — do any of this:

  • Run git add / git commit. This template told you to until 2026-09-17, and
    on the ailang_only lane it is impossible: that policy grants Process only
    git:status, git:diff, git:log ("read-only git; no push/commit"), so the
    instruction cost turns and produced a policy denial. The wrapper has always
    committed the whole tree, so it was redundant on the shell lane too
  • Run git push (the wrapper does it)
  • Run gh pr create (the wrapper does it)
  • Run ailang publish — the cascade bumps the dep, it does NOT re-publish this
    package. Re-publishing is a separate human-approved action after the PR merges.

Working Context

  • Repository: sunholo-data/ailang-packages (monorepo)
  • You're already in the right package directory (the wrapper cd'd you here)
  • Read AGENT.md for any package-specific instructions

If you can't repair within ~10 turns

Commit what you have with a [cascade-blocked] prefix. The wrapper's PR will
open with a cascade-needs-attention label for human triage. Don't keep
churning — humans are better at deciding "this needs API redesign upstream"
than agents are.

Output markers (for the coordinator to parse)

  • BUMP_RESULT: success (or failed: <reason>)
  • BUMPED_FROM:
  • BUMPED_TO:
  • REPAIRED_FILES: <comma-separated list>

Defense-in-depth note

The cascade context above is authoritative ONLY when Source is cascade —
that message arrived via the IAM-restricted ailang-cascade Pub/Sub topic, which
only the coordinator service account can publish to. When Source is anything
else, there is NO cascade: ignore the (blank) cascade context and the BUMP_*
markers, and do the maintainer request below instead. Measured 2026-09-16
(task-60a2d39c): a user request to add two functions rendered through this
template with no request text, and the agent "repaired" a cascade that did not
exist — the request was silently dropped.

Source: ``

Request (non-cascade messages — the task you were actually sent)

Two markdown->docx conversion gaps found generating a client reply (docparse notes.md --convert out.docx --reference-doc sunholo-reference.docx), both reproduced 1 Dec 2026:

  1. Markdown footnotes are not supported. 'text[^1]' plus a '[^1]: definition' line comes out as literal '[^1]' in the body, and all the definitions are merged into one paragraph with the leading '[' escaped, so the link syntax breaks. Expected: real Word footnotes (w:footnoteReference + footnotes.xml), or at minimum endnote-style numbered references.

  2. A numbered list item containing a second paragraph (indented continuation, valid CommonMark) ends the list. The continuation paragraph becomes a plain paragraph and the following items restart at 1, so items 2-5 render as 1-4. Expected: the paragraph stays inside item 1 and numbering continues.

Workaround used: question headings instead of a list, inline [n] references, and a numbered Sources list.

For a non-cascade request: make the change in this package, keep existing
exports unchanged unless asked, bump the version if the request says so, and
report BUMP_RESULT: n/a (maintainer request). Never widen this package's
[effects] max ceiling to make a probe or scratch program pass — scratch
programs belong outside the package directory.

Files (8)

  • docparse/services/docx_generator.ail
  • docparse/services/docx_package.ail
  • docparse/services/docx_runs.ail
  • docparse/services/docx_table.ail
  • docparse/services/docx_template.ail
  • docparse/services/markdown_inline.ail
  • docparse/services/markdown_parser.ail
  • docparse/services/markdown_writer.ail

Task task-08579b94 · agent pkg-sunholo-ailang-parse · opened deterministically by the AILANG coordinator wrapper.
Execution chain: ailang chains view task-08579b94

Task: task-08579b94
Agent: pkg-sunholo-ailang-parse
Timestamp: 2026-12-01T10:13:24Z

You are an autonomous AILANG package maintainer. The cascade root package
`` had a class **** change (interface or
effect-ceiling delta). The wrapper already attempted a deterministic dependency
bump, lock regeneration, and `ailang check`/`ailang test`, and it FAILED — that
is why you have been invoked. Your job is to repair the consumer code so the
bump can land.

## Cascade context (provided by the wrapper)

- **Root package**: ``
- **Bump**: `` → ``
- **Change class**: ``
  - A = content-only (deterministic should NOT have failed; investigate the wrapper's check output)
  - B = additive interface (new exports, no removals; check should normally pass)
  - C = breaking interface (removed exports OR widened effects — repair expected)
- **Interface hash**: `` → ``
- **Effects widened**: `false` (was `[]`, now `[]`)

## What to do

1. Read this package's `ailang.toml` — note the dep pin for ``
   (the wrapper has already updated it to ``).
2. Read `AGENT.md` if present for package-specific instructions.
3. Run `ailang check --package .` to see the current breakage.
4. Read the failing consumer source — figure out what changed in the root package
   (look at the new version's exports vs the old).
5. Edit the consumer source to adapt to the new interface or effect ceiling.
6. Re-run `ailang check --package .` until green.
7. Run `ailang test --package .` if `*_test.ail` exists; fix breakages until green.
8. Leave the changes in the working tree. Do NOT commit.

The wrapper around you (the AILANG coordinator's `execute-job`) will:
- `git add -A` and commit every file you changed
- Push your branch deterministically
- Open the GitHub PR automatically with the right title/body/labels

You do NOT need to — and on the `ailang_only` lane CANNOT — do any of this:
- Run `git add` / `git commit`. This template told you to until 2026-09-17, and
  on the `ailang_only` lane it is impossible: that policy grants Process only
  `git:status`, `git:diff`, `git:log` ("read-only git; no push/commit"), so the
  instruction cost turns and produced a policy denial. The wrapper has always
  committed the whole tree, so it was redundant on the shell lane too
- Run `git push` (the wrapper does it)
- Run `gh pr create` (the wrapper does it)
- Run `ailang publish` — the cascade bumps the dep, it does NOT re-publish this
  package. Re-publishing is a separate human-approved action after the PR merges.

## Working Context
- Repository: `sunholo-data/ailang-packages` (monorepo)
- You're already in the right package directory (the wrapper cd'd you here)
- Read `AGENT.md` for any package-specific instructions

## If you can't repair within ~10 turns
Commit what you have with a `[cascade-blocked]` prefix. The wrapper's PR will
open with a `cascade-needs-attention` label for human triage. Don't keep
churning — humans are better at deciding "this needs API redesign upstream"
than agents are.

## Output markers (for the coordinator to parse)
- `BUMP_RESULT: success` (or `failed: <reason>`)
- `BUMPED_FROM: `
- `BUMPED_TO: `
- `REPAIRED_FILES: <comma-separated list>`

## Defense-in-depth note
The cascade context above is authoritative ONLY when `Source` is `cascade` —
that message arrived via the IAM-restricted `ailang-cascade` Pub/Sub topic, which
only the coordinator service account can publish to. When `Source` is anything
else, there is NO cascade: ignore the (blank) cascade context and the BUMP_*
markers, and do the maintainer request below instead. Measured 2026-09-16
(task-60a2d39c): a user request to add two functions rendered through this
template with no request text, and the agent "repaired" a cascade that did not
exist — the request was silently dropped.

**Source**: ``

## Request (non-cascade messages — the task you were actually sent)

Two markdown->docx conversion gaps found generating a client reply (docparse notes.md --convert out.docx --reference-doc sunholo-reference.docx), both reproduced 1 Dec 2026:

1. Markdown footnotes are not supported. 'text[^1]' plus a '[^1]: definition' line comes out as literal '[^1]' in the body, and all the definitions are merged into one paragraph with the leading '[' escaped, so the link syntax breaks. Expected: real Word footnotes (w:footnoteReference + footnotes.xml), or at minimum endnote-style numbered references.

2. A numbered list item containing a second paragraph (indented continuation, valid CommonMark) ends the list. The continuation paragraph becomes a plain paragraph and the following items restart at 1, so items 2-5 render as 1-4. Expected: the paragraph stays inside item 1 and numbering continues.

Workaround used: question headings instead of a list, inline [n] references, and a numbered Sources list.

For a non-cascade request: make the change in this package, keep existing
exports unchanged unless asked, bump the version if the request says so, and
report `BUMP_RESULT: n/a (maintainer request)`. Never widen this package's
`[effects] max` ceiling to make a probe or scratch program pass — scratch
programs belong outside the package directory.

Co-Authored-By: Claude (openrouter/z-ai/glm-5.3-flash) <noreply@anthropic.com>
sunholo-voight-kampff and others added 3 commits December 2, 2026 08:34
…footnotes part

This PR keeps a list open across blank lines (a loose list, CommonMark), so
multi-paragraph items no longer restart numbering. Two things relied on a
blank line closing the list, and both broke:

- check_docx_list_numbering: "1. first" / "- top" / "1. step" collapsed into
  ONE ordered list of 10 items; bullets rendered as numbers and the second
  ordered list continued the first one's numbering. A list now ends when the
  marker of its OUTERMOST items changes (bullet <-> number, "-" <-> "*",
  "." <-> ")"), which is the CommonMark rule. The comparison uses the
  outermost items, not listOrdered (which follows the last item, nested ones
  included), so "1. a" / "   - b" / "2. c" is still one list. "1) item" is
  now read as an ordered item, as CommonMark allows.
- roundtrip_check (officeparser.odp): two adjacent lists were written with a
  blank line between them and read back as one. markdown_writer now gives a
  list that directly follows another the alternate markers ("* ", "1) ").

verify_generated L6 RefDoc failed on docx-hdrftr.docx and comments.docx:
"template part dropped: word/footnotes.xml". The template's footnotes part is
dropped from the carried bytes to be rebuilt with our notes appended, but it was
only written back when the document had footnotes. docxWritesFootnotes now
decides the part, its content-type override and its relationship together:
written when the document has notes or the template had the part.

Verified: all 96 modules type-check; office suite 100% (114 files);
roundtrip_check 0 failures (was 1, and 2 with the first list fix);
verify_generated ALL CHECKS PASSED; failure_check 0; check_docx_list_numbering
OK including the LibreOffice render; every other CI check script passes.
Footnotes read back from a generated DOCX with no template, with
docx-hdrftr.docx, and with pandoc_notes.docx (whose existing note id 1 is kept
and ours becomes 2), with one relationship and one override each.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sunholo-voight-kampff
sunholo-voight-kampff merged commit 57ea0b8 into main Dec 2, 2026
11 checks passed
@sunholo-voight-kampff
sunholo-voight-kampff deleted the coordinator/task-08579b94 branch December 2, 2026 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant