Skip to content

Report the team_path a sync check's pull needs - #34

Merged
jserv merged 2 commits into
mainfrom
dev
Oct 19, 2026
Merged

jserv merged 2 commits into
mainfrom
dev

Conversation

@jserv

@jserv jserv commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

hackmd_get_note with local_path reported the tracked note's note_id but not its workspace. On remote_changed the agent pulls with hackmd_pull_note, and a bare ID without team_path resolves to the personal workspace, so a team-tracked file could not name its own note. The sync check now reports team_path beside note_id (null for a personal note), and push's remote_changed hint 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_hash as expected_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 covers snapshot_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, and cargo 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_note take its target from the sync record when note_ref is omitted, as push already does. That would remove the need to copy note_id and team_path between tools, but it changes the pull input contract and belongs in its own PR.


Summary by cubic

Fixes hackmd_get_note's local_path sync check to report the team_path a remote_changed pull needs, beside note_id (null for a personal note). Without it a bare ID resolved to the personal workspace, so team-tracked files could not be pulled. The remote_changed hint now names both, and the server instructions walk through the sync workflow, warning not to reuse the check's remote_body_hash as expected_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.

View guided diff Turn on auto-fix

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.
cubic-dev-ai[bot]

This comment was marked as resolved.

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.
@jserv
jserv merged commit a549cc1 into main Oct 19, 2026
12 checks passed
@jserv
jserv deleted the dev branch October 19, 2026 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant