Skip to content

Read and edit devbook sync directions in the Devbook panes - #939

Merged
github-actions[bot] merged 2 commits into
mainfrom
claude/backlog-sync-directions-b8d810
Oct 3, 2026
Merged

github-actions[bot] merged 2 commits into
mainfrom
claude/backlog-sync-directions-b8d810

Conversation

@JSdotNet

@JSdotNet JSdotNet commented Oct 3, 2026 •

Copy link
Copy Markdown
Owner

Summary

Devbook 1.16.0 (contract 25) adds a sync field: which way changes flow between a unit and its code — push, pull, sync, report or off — stated on a folder overview, a context.md, a context page or a unit's root chapter, and resolved nearest-wins (unit → page → context → folder → report). This PR lets Backlog read it, store it, show it beside each block's status in the Devbook panes, and edit it.

Changes

  • Database — node.sync and chapter.sync (schema v4), written identically by tools/devbook/build-database.mjs and DevbookDatabaseBuilder; the parity fixture now carries sync values so the new columns are compared.
  • Schema and findings — sync is a known field on MetadataRecord; DevbookSchema.SyncValues; DevbookMetadataFindings reports a value outside the five, and a block that is no sync level (an owned chapter, a requirements/invariants page, tech/ai), mirroring the checker's syncIssues.
  • DevbookSync — places a block (level or refusal) and resolves a unit's direction with the level it came from.
  • UI — DevbookSyncSelector beside the status in MetadataView: a picker whose empty entry inherits and names its source ("sync push · from context"), a badge on a read-only branch, the bare word where nothing places the block. Panes cascade a DevbookSyncScope; MetadataFileView draws a file's headline when its block takes a direction even if it states nothing else (the building block view's empty fence).
  • Writing — DevbookMarkdownSyncWriter beside DevbookMarkdownStatusWriter, through DevbookWriteGuard.WritablePath; refuses a value or a block the rule refuses. DevbookSyncReading reads a document plus its context and folder overview once per chapter load. Domain, arc42 and design panes wired.
  • Storybook — "The sync direction, beside the status" on devbook/state.
  • Devbook vendoring — the 1.16.0 tools/rules/stamp; identical to what Name each domain event's raiser and adopt devbook 1.16.0 #937 landed on main meanwhile, so it merges as a no-op.

Testing

  • CI build (Backlog.WithoutAppHeads.slnf, Release, warnings as errors): clean. Full suite: 10830 passed, 0 failed, 1 skipped (E2E needs a live AppHost). Parity tests pass; re-run after merging main.
  • New: DevbookSyncTests (placement matrix, nearest-wins, findings, rule-text pin against .agents/rules/devbook-chapter-metadata.md), DevbookSyncSelectorTests, DevbookSyncWriteTests (writer + reading across files), a domain-pane and an arc42-pane test.
  • Playwright QA with Aspire monitoring: domain units/pages/context map, cascade and write/clear, arc42 building block view, design components, tech/ai show none, Storybook story. Two first-pass findings — same-page units not refreshed after a file-level pick, and no picker on an empty file block — fixed and re-validated. Logs: only an unrelated sync startup timeout.
  • node .devbook/_tools/devbook-meta/build.mjs --check passes; check-metadata.mjs 0 blocking.

Verification — spec verdicts

Against the plan item and devbook 1.16.0's "Sync direction" rule (.agents/rules/devbook-chapter-metadata.md).

Item Verdict Evidence / what it calls for
sync known in DevbookSchema, DevbookMetadataFindings, devbook-schema.sql, build-database.mjs, DevbookDatabaseBuilder aligned DevbookSyncTests, DevbookBuilderParityTests (fixture carries sync)
Levels and refusals (folder / context / page / unit; owned chapters and pages, tech/ai refused) aligned DevbookSyncTests placement matrix; rule-text pin of directions, default, unit/owned types, overview files, page bases
Nearest-wins with the level it came from, report default, unknown value skipped aligned DevbookSyncTests, DevbookSyncWriteTests (reading across files)
Shown beside status on each unit in the devbook panes aligned Playwright QA (domain, arc42, design; tech/ai none); domain-pane and arc42-pane bUnit tests
Picker writes through a writer beside the status writer, under DevbookWriteGuard, only where allowed aligned DevbookSyncWriteTests (refusals leave the file untouched), QA write/clear scenarios
Picker in the domain pane's context/document action bar spec-ahead (minor) Not built — only the open file view carries it; new work if wanted
Backlog's own devbook describing the field's UI and storage code-ahead Chapter change for a flow-spec session (the plan item's last step)

Unverified scenarios: none — the item carries no #### Scenario: cases.

Related

Backlog plan item backlog-sync-field of plan devbook-sync-sweeps (after units-tool, JSdotNet/devbook#208). No GitHub issue.

Not in this PR: the domain pane's context/document action bar has no sync picker (the open file view has it), and Backlog's own devbook chapters for this feature are a follow-up flow-spec session.

Checklist

  • Scope is focused and excludes unrelated changes
  • Documentation or instruction files were updated when governance or behavior changed — devbook chapters follow in a separate session
  • Running Aspire instances for this checkout were stopped before PR creation
  • Follow-up work is captured when the implementation is intentionally partial
  • Issues this PR closes are linked with a closing keyword, or there are none

🤖 Generated with Claude Code

JSdotNet and others added 2 commits October 3, 2026 02:30
Devbook 1.16.0 (contract 25) adds a `sync` field saying which way changes
flow between a unit and its code: push, pull, sync, report or off, stated
on a folder overview, a context.md, a context page or a unit's root
chapter and resolved nearest-wins.

- Vendor devbook 1.16.0: devbook-meta tools (units.mjs, naming.mjs),
  four rules, and the components.devbook stamp at contract 25.
- Carry `sync` in the devbook database (node.sync, chapter.sync, schema
  v4) from both the Node writer and the C# builder, in parity.
- Know the field in the metadata reader, the schema and the findings,
  which report a bad value or a block that cannot take one.
- DevbookSync places a block and resolves a unit's direction with the
  level it came from; DevbookSyncSelector shows it beside the status, a
  picker where the folder is writable and a badge where it is not.
- DevbookMarkdownSyncWriter writes it beside the status writer under the
  write guard; the domain, arc42 and design panes cascade a scope built
  from DevbookSyncReading so each record asks for its own block.

Backlog plan item backlog-sync-field (devbook-sync-sweeps).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions
github-actions Bot merged commit f09992d into main Oct 3, 2026
14 of 16 checks passed
JSdotNet added a commit that referenced this pull request Oct 3, 2026
Main registered IDevbookReferenceResolver inline in both desktop heads
(#938) while this branch moved those blocks into the shared composition;
the registration now sits in AddDevbookAdapters beside the search tiers,
and DevbookModuleServices lists it so both heads are checked to resolve
it. DevbookMarkdownSyncWriter.cs, added on main (#939), joins the
file-IO ratchet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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