Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk5 min

A YAML Comment Truncated an AI Coding Success Criterion — and the Gate Still Passed

A YAML inline comment was dropped by the parser, so a spec-lane gate compared a shortened criterion to a matching shortened entry and passed. Here is how it happened and what v0.11.0 changed.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A YAML inline comment silently removed part of a success criterion before it reached a verification gate in the open-source tool spec-lane. The gate did what it was built to do: it compared the values it received, and both sides had been shortened to the same text. The check passed. Maintainer Yusuke Shiki’s write-up describes the failure, a control case that exposes it, and a source-aware guard shipped in v0.11.0.

The one line that lost its last clause

The criterion was written as an unquoted YAML plain scalar with an inline comment:

As an Amazon Associate I earn from qualifying purchases.

- ledger has exactly one PhaseGate row # include the negative case too

To a person reading the file, the comment reads as part of the requirement. It says the criterion covers a negative case. To the YAML parser, everything from the # onward is a comment, so it is not part of the value. In the reported example, using [email protected], the parsed JavaScript value was only:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
ledger has exactly one PhaseGate row

The comment text stayed in intent.yaml on disk. It never appeared in the data the tool worked with. Nothing in that chain looked wrong, because YAML’s comment rule is working as specified. The problem is that the human’s intent lived in a part of the file the parser is designed to discard.

Why the gate passed

spec-lane keeps success criteria in intent.yaml and the matching verification-matrix records in verification.yaml. The gate compares a criterion against a matrix entry. It never reads the raw source text of intent.yaml, so it had no way to see the comment.

The reproduction used a matrix entry that was also shortened to ledger has exactly one PhaseGate row. Both values matched. On the revision immediately before the fix in PR #48, validation and advancement into the verification phase succeeded with exit code 0.

That result shows the gate is consistent. Given matching values, it accepts them. It does not show that the criterion a person wrote was enforced. Shiki is explicit on this point: the fixture’s evidence and negation-test entries were declarations, and the ledger test named in them was never created and run as proof of the intended behavior. A matrix row naming a test is a claim that the test exists and covers the criterion. It is not a record that the test ran.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The control case: quoting the criterion

Shiki then wrapped the same criterion in double quotes so the comment text became part of the string:

- "ledger has exactly one PhaseGate row # include the negative case too"

He kept the shortened matrix entry and the pre-fix CLI. Validation and advancement failed with exit code 3, and the phase stayed at 3_implement. The full criterion no longer matched the shortened matrix entry, so the gate refused to advance.

The comparison below sets the two source forms side by side:

Source form in intent.yaml Value the gate receives Matches shortened matrix entry (pre-fix) Pre-fix result Result under v0.11.0
Unquoted plain scalar with trailing # ... Text before the # only Yes Exit code 0; advanced to verification Rejected by the source-aware check
Same text wrapped in double quotes Full text, including the comment-like clause No Exit code 3; stayed at 3_implement Not stated in the author’s account

The pre-fix behavior is the core of the story. The gate failed closed on the quoted version, but only because the quoted value was longer than the matrix entry. The unquoted version passed for the same underlying reason: the shortened value was the one that reached the gate on both sides.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The v0.11.0 fix: check the source before the value arrives

spec-lane v0.11.0 moved the check to the point where intent.yaml is read. As Shiki describes it, the check:

  • walks the YAML abstract syntax tree;
  • inspects the original source ranges of each node;
  • flags unquoted plain scalars that are followed by whitespace and then #;
  • rejects candidate values that appear among the parsed success criteria.

Shiki notes that the check does not rely only on an AST comment property. YAML anchor forms can attach a comment to a different node than the one a reader would expect, so a property-only check could miss the case or flag the wrong node. Inspecting the source ranges directly avoids that dependency.

The fix is tracked as issue #45 and PR #48 in the spec-lane repository. The implementation details above come from the author’s description and should be read that way.

The false-positive trade-off

The guard can be wrong in the other direction. If a different criterion has an unquoted plain scalar with a trailing comment, and its parsed text happens to equal a quoted success criterion, the check rejects the document. In that case the quoted criterion was never truncated, but the document still fails.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Shiki describes this as a fail-closed heuristic aimed at a known silent-truncation path. It is not a proof that the author’s full intent has been preserved, and it does not evaluate meaning. The trade-off is deliberate: a noisy rejection is easier to notice than a gate that advances on a shortened criterion.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

What a passing gate does and does not establish

Three separate things can each look like confirmation, and none of them is enough alone:

  • Schema validity. A schema validator checks the structure of the value it receives. As Shiki puts it, a schema validator can validate the structure it receives. It cannot recover text that the parser discarded before validation began.
  • A matching matrix row. A row that names a test shows a claimed link between a criterion and evidence. It does not show the test was written or executed.
  • A zero exit code. A successful command means the gate’s checks passed on the values it was given. It does not mean the property the human cared about was demonstrated.

The lesson Shiki draws is about the order of work. When implementation is handed to a coding agent, the definition of done should exist before the implementation does, and that definition should survive the path from source file to gate intact. Shiki states this as: “When I hand implementation work to a coding agent, I want the definition of ‘done’ to exist before the implementation does.”

Practical steps for criteria with # in them

  1. Quote any success criterion that contains #, so the parser keeps the full text.
  2. Keep explanatory notes in a separate comment on their own line rather than trailing a criterion.
  3. Check the parsed value of each criterion before relying on it. A quick script that prints the parsed strings will show anything that was cut.
  4. Treat a passing gate as evidence that the recorded values agree, and check separately that the tests named in the matrix exist and have actually been run.
  5. If you use spec-lane, upgrade to v0.11.0 or later, and expect occasional rejections of documents that contain an unquoted commented scalar matching a quoted criterion. Quote the criterion to clear them.

The underlying point is narrow but general: a verification gate can only be as faithful as the values that reach it. When a human’s intent passes through a parser, the safe place to check is the source.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Source: Yusuke Shiki’s write-up of the spec-lane reproduction and fix. The YAML behavior described here follows the YAML 1.2.2 specification, revision dated 2021-10-01, which defines # as the comment indicator and describes plain and quoted scalar styles.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.