Repository navigation
Report the task ID the index will actually store - #41
Merged
Merged
Conversation
fohara
force-pushed
the
fix/add-reports-wrong-id
branch
from
August 9, 2026 15:46
4013ad1 to
91a39fd
Compare
fohara
force-pushed
the
fix/depends-on-line-count
branch
from
August 9, 2026 15:46
f35bede to
dc5d83c
Compare
`lash add "Ship v0.7.0 release notes" -l docs` printed `ship-v0-7-0-release-notes` while the index stored `ship-v070-release-notes-docs`. Anything that copied the printed ID (`lash show`, `lash complete`, `@depends-on`) failed, and a `@depends-on` written against it dangled, which the dangling-reference check then rejected. Two derivations existed and disagreed three ways. `v0.7.0` became `v0-7-0` in the emitter (punctuation to separator) and `v070` in the parser (punctuation deleted). The parser slugged the raw checkbox title, so an inline `#docs` was folded into the identity as a `-docs` suffix. And only the parser truncated at 40 characters. `lash_types::task::synthesize_task_id` is now the one derivation, called by both. It strips inline labels before slugging, because a task's identity should not change when someone tags it, and it truncates, so both sides agree on long titles. That still leaves the numeric suffix the parser appends to break a collision, which the emitter cannot know about. So the creation service re-reads the file it just wrote and reports the ID the parser assigned to the task at that line. If the re-read fails the emitter's ID is kept rather than failing a write that already succeeded. `parse_inline_labels` and the new label stripping share one predicate, `label::is_inline_label`, so a title loses exactly the words that parsing turns into labels. Behaviour change on upgrade: synthesized IDs for existing tasks change where a title held an inline label or punctuation inside a word. `implement-authentication-security` becomes `implement-authentication` and `design-requestresponse-schemas` becomes `design-request-response-schemas`. A `@depends-on` written against an old synthesized ID needs updating. Explicit `@id:` values are untouched. Four CLI snapshots are updated to match; every changed line is one of those two cases. Tests: four integration tests covering all three discrepancies in one title, truncation of a long title, the numeric collision suffix, and the reported ID resolving as a `--depends-on` target. All four fail without the fix.
fohara
force-pushed
the
fix/add-reports-wrong-id
branch
from
August 9, 2026 16:05
91a39fd to
a5b7b11
Compare
This was referenced Aug 9, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #39, which is stacked on #40.
What was wrong
lash add "Ship v0.7.0 release notes" -l docsprintedship-v0-7-0-release-noteswhile the index storedship-v070-release-notes-docs. Anything that copied the printed ID(
lash show,lash complete,@depends-on) failed, and a@depends-onwritten against it dangled, which #27's dangling-reference check then rejected.
Two derivations existed and disagreed three ways:
v0.7.0becamev0-7-0in the emitter (punctuation to separator) andv070in the parser (punctuation deleted). Same input, two normalizations.
#docswas foldedinto the identity as a
-docssuffix. A task's ID should not change becausesomeone added a label.
full and stored short.
The fix
lash_types::task::synthesize_task_idis now the one derivation, called byboth the parser and
lash add. It strips inline labels before slugging andtruncates, so both sides agree on all three points.
That still leaves the numeric suffix the parser appends to break a collision,
which the emitter cannot know about. So the creation service re-reads the file
it just wrote and reports the ID the parser assigned to the task at that line.
If the re-read fails, the emitter's ID is kept rather than failing a write that
already succeeded.
parse_inline_labelsand the new label stripping share one predicate,label::is_inline_label, so a title loses exactly the words that parsing turnsinto labels.
Behaviour change on upgrade
Synthesized IDs for existing tasks change where a title held an inline label or
punctuation inside a word:
implement-authentication-securitybecomesimplement-authenticationdesign-requestresponse-schemasbecomesdesign-request-response-schemasA
@depends-onwritten against an old synthesized ID needs updating. Explicit@id:values are untouched. Four CLI snapshots are updated to match; everychanged line is one of those two cases.
Tests
Four integration tests: all three discrepancies in one title, truncation of a
long title, the numeric collision suffix, and the reported ID resolving as a
--depends-ontarget. All four were confirmed to fail without the fix.