Repository navigation
Conversation
hackmd_get_note with local_path returned the tracked note's note_id but not its workspace. A remote_changed file is brought down with hackmd_pull_note, which takes a note_ref, and a bare ID without team_path resolves to the personal workspace, so a team-tracked file had no way to name its own note. The check now reports team_path beside note_id (null for a personal note), and push's remote_changed hint names both. The server instructions gain the sync workflow: check with local_path, pull on remote_changed, push on local_changed or conflict and follow the hint the push returns. They warn against passing the check's remote_body_hash as expected_remote_hash, which a two-sided change would accept as a merge and so overwrite the remote with an unmerged file. The conflict hint now covers a snapshot_error, the one outcome it left unexplained. A test checks every word with an underscore in the instructions and in both push hints against the registered tools, their input parameters, the serialized statuses, and a listed set of output fields, so a rename that leaves the prose behind fails the build rather than misleading an agent.
The output fields the instructions and push hints name were a typed list, so renaming one such as remote_body_hash left the test green while the prose still advertised the old name. The test now serializes a fully populated PushNoteOutput and takes its keys, which covers every output field the sync workflow names; a field added to the struct fails to compile until the test sets it. Only folder_ids, note_url, and unconfirmed_fields, which no sync tool reports, stay listed.
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.
hackmd_get_notewithlocal_pathreported the tracked note'snote_idbut not its workspace. Onremote_changedthe agent pulls withhackmd_pull_note, and a bare ID withoutteam_pathresolves to the personal workspace, so a team-tracked file could not name its own note. The sync check now reportsteam_pathbesidenote_id(nullfor a personal note), and push'sremote_changedhint names both. This adds an output field and changes no input, so existing callers are unaffected.The server instructions now describe the sync workflow, including a warning not to pass the check's
remote_body_hashasexpected_remote_hash: on a two-sided change, push accepts it as a merge and overwrites the remote with an unmerged file. The conflict hint now coverssnapshot_error. A new test checks every word with an underscore in the instructions and both push hints against the registered tools, their input parameters, the serialized statuses, and a listed set of output fields, so a rename that leaves the prose behind fails the build.Verified with
make check(417 unit tests plus the integration targets),cargo clippy --all-targets --all-features -- -D warnings, andcargo fmt --check. The new test was checked by introducing a misspelled status in the instructions and a misspelled field in the conflict hint; each made it fail naming the word. Reviewed by Codex and an independent Claude pass with no remaining findings.Left out: letting
hackmd_pull_notetake its target from the sync record whennote_refis omitted, as push already does. That would remove the need to copynote_idandteam_pathbetween tools, but it changes the pull input contract and belongs in its own PR.Summary by cubic
Fixes
hackmd_get_note'slocal_pathsync check to report theteam_patharemote_changedpull needs, besidenote_id(nullfor a personal note). Without it a bare ID resolved to the personal workspace, so team-tracked files could not be pulled. Theremote_changedhint now names both, and the server instructions walk through the sync workflow, warning not to reuse the check'sremote_body_hashasexpected_remote_hash. A new test fails the build if any underscored word in the instructions or push hints doesn't name a real tool, parameter, status, or output field; the output fields come from serializing a fully populated push result, so a field rename there fails the build too.Written for commit 778d6cc. Summary will update on new commits.