Skip to content

fix(import): read folded and literal YAML descriptions - #44

Merged
vincentkoc merged 4 commits into
openclaw:mainfrom
SebTardif:fix/folded-yaml-description
Oct 1, 2026
Merged

vincentkoc merged 4 commits into
openclaw:mainfrom
SebTardif:fix/folded-yaml-description

Conversation

@SebTardif

@SebTardif SebTardif commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Complete Sebastien Tardif's folded/literal YAML description support with one shared scalar reader.
  • Preserve header comments, single-digit indentation indicators, breaks around more-indented content, repeated blank lines, and clip/strip/keep chomping.
  • Preserve the closing frontmatter line break, LF/CRLF body bytes, next-line scalar metadata, and next-key boundaries.
  • Related issue: none. This is not a general YAML parser and adds no dependency.

Compatibility

  • Source apps: Claude Code and Codex Markdown contributions.
  • Affected surfaces: generated command, agent, and output-style descriptions; copied skill frontmatter.
  • Existing next-line keep-coding-instructions values remain supported.
  • Copied skill bodies and support files remain intact. Malformed block headers reject regeneration and retain the previous generated files.
  • No command names, tool names, manifest contracts, installation ownership, or trust permissions change.
  • README compatibility table, detailed reference, changelog, and contributor credit updated.

Verification

Exact head: ace8b59ed5f410287770a9716f21583aa1819c5d, against main cc96f880659d979db360d9065880b1af2512feb8.

  • Focused tests: 121 passed across Markdown, native tools, bundle plugins, and Git install.
  • npm run check: build and 181 tests passed in 11 files.
  • npm run pack:check: 24 files, 288417 unpacked bytes.
  • README compatibility table and changelog updated.
  • No private paths, secrets, or generated artifacts in the diff.
  • Independent final exact-head review: no actionable introduced findings or integration regressions.

The expected-value fixtures cover YAML 1.2.2 block-scalar cases: comments, indentation indicators in either order, more-indented content, repeated blanks, clip/strip/keep, empty blocks, missing final line breaks, and invalid headers. Real regeneration tests exercise commands, agents, output styles, copied skills/assets, both LF and CRLF, unchanged metadata/body handling, and rollback after a malformed description.

The independent review's next-line metadata finding was fixed and re-reviewed. Prior MCP/Stop/expansion repairs were integrated only to resolve actual main conflicts; the final introduced diff remains scoped to scalar import behavior.

Fresh ClawSweeper and exact-head CI, low-memory, and CodeQL remain required before merge.

A one-line description match treated the block marker as the
description and left the indented lines in generated frontmatter.
Commands, agents, and output styles all use that match.

Folded lines join with spaces. Literal lines keep their breaks.
One-line descriptions stay the same.

Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
@clawsweeper

clawsweeper Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@SebTardif
SebTardif marked this pull request as ready for review September 30, 2026 15:51
@clawsweeper clawsweeper Bot added P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 30, 2026
@clawsweeper

clawsweeper Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Codex review: needs maintainer review before merge. Reviewed October 1, 2026, 5:54 AM ET / 09:54 UTC (Revision 2).

ClawSweeper review

What this changes

The PR adds a shared reader for folded and literal YAML descriptions and preserves surrounding metadata, copied skill content, and regeneration rollback.

Merge readiness

✅ Ready for maintainer review

The repaired head resolves all three prior findings, and no actionable introduced defect remains. The fix is still needed because current main retains the faulty one-line description reader.

Priority: P2
Reviewed head: ace8b59ed5f410287770a9716f21583aa1819c5d

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The focused repair resolves prior blockers and retains useful production-path proof with substantial compatibility coverage.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): Retained earlier terminal proof exercises the built install path feeding generated command and output-style descriptions on a temporary macOS setup; the completed review records correct literal and folded output. Repaired-head LF/CRLF and rollback fixtures are supplemental, with execution reported by vincentkoc. The original transcript is no longer in the captured body. No stored-data format or schema changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): Retained earlier terminal proof exercises the built install path feeding generated command and output-style descriptions on a temporary macOS setup; the completed review records correct literal and folded output. Repaired-head LF/CRLF and rollback fixtures are supplemental, with execution reported by vincentkoc. The original transcript is no longer in the captured body. No stored-data format or schema changes.
Evidence reviewed 9 items Pinned introduced change: Read all nine introduced file diffs between the pinned main and original PR head. The changes are confined to scalar import behavior, focused tests, and compatibility documentation; dependencies, public contracts, and trust permissions are unchanged.
Current main still needs the repair: Main's command conversion reads only the description header and removes only that header from preserved metadata. A block marker therefore becomes the description while its indented content remains. Output-style discovery also uses a one-line matcher.
Prior findings resolved: The header reader accepts trailing comments, folding preserves breaks around more-indented content and repeated blanks, and README's compatibility table now documents block descriptions. Generated-skill fixtures exercise the previously reported parsing cases.
Findings None None.
Security None None.

How this fits together

Babelfish imports plugin Markdown from Claude Code and Codex into OpenClaw skills. Its frontmatter reader supplies descriptions for generated skills and output styles while preserving other source metadata.

flowchart LR
A[Plugin Markdown] --> B[Split frontmatter and body]
B --> C[Read description scalar]
C --> D[Fold or preserve line breaks]
D --> E[Generated skills and output styles]
B --> F[Copied skills and assets]
E --> G[OpenClaw]
F --> G
Loading

Before merge

None.

Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Production and test delta production +99/-10; tests +204/-3 Production growth implements one shared scalar reader, with broader regression coverage for its import and compatibility boundaries.

Technical review

Best possible solution:

Keep one bounded scalar reader shared by the import paths, with supported YAML semantics documented and existing metadata and transactional regeneration preserved.

Do we have a high-confidence way to reproduce the issue?

Yes, from source: current main reads a block marker as the description and leaves its continuation lines in generated frontmatter. This review did not execute the importer.

Is this the best way to solve the issue?

Yes. A shared scalar reader repairs both affected import paths without adding dependencies or changing public contracts, and the repaired fixtures cover the prior failures.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against cc96f880659d.

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): Retained earlier terminal proof exercises the built install path feeding generated command and output-style descriptions on a temporary macOS setup; the completed review records correct literal and folded output. Repaired-head LF/CRLF and rollback fixtures are supplemental, with execution reported by vincentkoc. The original transcript is no longer in the captured body. No stored-data format or schema changes.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: This repairs a source-proven Markdown import defect with a bounded compatibility surface.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): Retained earlier terminal proof exercises the built install path feeding generated command and output-style descriptions on a temporary macOS setup; the completed review records correct literal and folded output. Repaired-head LF/CRLF and rollback fixtures are supplemental, with execution reported by vincentkoc. The original transcript is no longer in the captured body. No stored-data format or schema changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. Retained earlier terminal proof exercises the built install path feeding generated command and output-style descriptions on a temporary macOS setup; the completed review records correct literal and folded output. Repaired-head LF/CRLF and rollback fixtures are supplemental, with execution reported by vincentkoc. The original transcript is no longer in the captured body. No stored-data format or schema changes.

Evidence

What I checked:

  • Pinned introduced change: Read all nine introduced file diffs between the pinned main and original PR head. The changes are confined to scalar import behavior, focused tests, and compatibility documentation; dependencies, public contracts, and trust permissions are unchanged. (ace8b59ed5f4)
  • Current main still needs the repair: Main's command conversion reads only the description header and removes only that header from preserved metadata. A block marker therefore becomes the description while its indented content remains. Output-style discovery also uses a one-line matcher. (src/native-tools.ts:410, cc96f880659d)
  • Prior findings resolved: The header reader accepts trailing comments, folding preserves breaks around more-indented content and repeated blanks, and README's compatibility table now documents block descriptions. Generated-skill fixtures exercise the previously reported parsing cases. (src/markdown.ts:23, ace8b59ed5f4)
  • Compatibility and rollback coverage: LF/CRLF regeneration fixtures verify commands, agents, output styles, copied skill bodies/assets, and preserved metadata. A malformed description then rejects regeneration while retaining the prior manifest, registry, and copied skill. The existing production backup/restore path remains intact; no stored schema or serialized-format contract changes. (src/native-tools.test.ts:446, ace8b59ed5f4)
  • Retained real-run proof: The completed earlier review at fix(import): read folded and literal YAML descriptions #44 (comment) records inspected terminal evidence from a built Babelfish install on macOS with Node 26 against a temporary local plugin, showing correct generated literal-command and folded-output-style descriptions. That evidence belongs to a98b87f; it is retained as proof of the central import path, not represented as a fresh execution of the repaired head. The current captured body contains test results rather than the original terminal transcript. (a98b87f3a895)
  • Maintainer re-review context: vincentkoc's fix(import): read folded and literal YAML descriptions #44 (comment) requests review of this exact repaired head and reports focused121/full181/package validation, LF/CRLF regeneration, and malformed-input rollback. These reported checks supplement source inspection; they were not executed by this read-only review. (ace8b59ed5f4)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • RomneyDa: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • vincentkoc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-30T15:56:10.370Z sha a98b87f :: needs changes before merge. :: [P2] Accept comments after block scalar headers | [P2] Preserve breaks around more-indented folded lines | [P3] Document block descriptions in the compatibility table

@vincentkoc vincentkoc self-assigned this Oct 1, 2026
@vincentkoc

Copy link
Copy Markdown
Member

@clawsweeper re-review

Exact head ace8b59ed5f410287770a9716f21583aa1819c5d.

The reviewed scalar repair now preserves comments, indentation, more-indented line breaks, repeated blanks, clip/strip/keep semantics, frontmatter closing boundaries, and existing next-line metadata. Focused121/full181/package checks and independent exact-head review passed. Real LF/CRLF regeneration and malformed-input rollback are covered; the updated body states the bounded compatibility contract.

Please supersede the prior-head verdict and review this repaired head.

@clawsweeper

clawsweeper Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 1, 2026
@vincentkoc
vincentkoc merged commit e03fb18 into openclaw:main Oct 1, 2026
11 of 12 checks passed
@SebTardif
SebTardif deleted the fix/folded-yaml-description branch October 1, 2026 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants