More about MD Changes
Big Pickle was bang on target, but rather than let it have its head, I decided to work on a small part at a time:
The detect_changes function needs to be able to handle when the MD file being
read does not have front matter, which means there will be no "old chapter". It will need to
generate a new chapter ID, and there are two cases: new chapter in a new document, or append new
chapter to existing document. detect_changes should not be passed the Chapter object, but will need
a callback function to get the old Chapter, and another function for creating a new Chapter.
The caller would then be able to pass in functions specific for either a new document, or an existing
document. One would be get_chapter, the other create_chapter. If get_chapter returns None, then the
detect_changes would call the create_chapter (which if passed a chapter ID, would use that as
the new chapter's ID, otherwise, it will create a new ID for the new chapter.)
We'll do the wiring for the caller (which will handle the KG side) later.
We'll also consider batching and performance later.
Discuss this.
It replied with a proposed change, which seemed good, so I told it to make the change using the "Workflow" from AGENTS.md.
At this point now I am going to get on with the development using Opencode, and will report back (in the following pages of this blog, about milestones, and also about changes I make to AGENTS.md.