refactor(core): simplify system context to a belief model
Reconcile never rewrites the baseline; only rebaseline (compaction) and
initialize (first turn) produce baseline text. The durable Applied record
tracks what the model was last told, per source.
- Incompatible stored values re-announce the source baseline as an update
instead of forcing a full replacement
- Sources removed without removal text retain the model's belief silently;
entries self-clean at the next rebaseline
- Rebaseline restates unobservable sources from their last-applied values
instead of blocking; ReplacementBlocked and ReplacementReady are gone
- Rename Snapshot to Applied and Generation to Baseline {text, applied}
This commit is contained in:
parent
7d598b5610
commit
bf5294121a
10 changed files with 267 additions and 271 deletions
|
|
@ -16,10 +16,10 @@ describe("ReferenceGuidance", () => {
|
|||
const guidance = yield* ReferenceGuidance.Service
|
||||
const generation = yield* SystemContext.initialize(yield* guidance.load())
|
||||
|
||||
expect(generation.baseline).toContain("<available_references>")
|
||||
expect(generation.baseline).toContain("<name>docs</name>")
|
||||
expect(generation.baseline).toContain("<path>/docs</path>")
|
||||
expect(generation.baseline).toContain("<description>Use for product documentation</description>")
|
||||
expect(generation.text).toContain("<available_references>")
|
||||
expect(generation.text).toContain("<name>docs</name>")
|
||||
expect(generation.text).toContain("<path>/docs</path>")
|
||||
expect(generation.text).toContain("<description>Use for product documentation</description>")
|
||||
}).pipe(
|
||||
Effect.provide(
|
||||
guidanceLayer(
|
||||
|
|
@ -47,7 +47,7 @@ describe("ReferenceGuidance", () => {
|
|||
Effect.gen(function* () {
|
||||
const guidance = yield* ReferenceGuidance.Service
|
||||
const generation = yield* SystemContext.initialize(yield* guidance.load())
|
||||
expect(generation.baseline).toBe("")
|
||||
expect(generation.text).toBe("")
|
||||
}).pipe(Effect.provide(guidanceLayer(Layer.mock(Reference.Service, { list: () => Effect.succeed([]) })))),
|
||||
)
|
||||
|
||||
|
|
@ -55,7 +55,7 @@ describe("ReferenceGuidance", () => {
|
|||
Effect.gen(function* () {
|
||||
const guidance = yield* ReferenceGuidance.Service
|
||||
const generation = yield* SystemContext.initialize(yield* guidance.load())
|
||||
expect(generation.baseline).toBe("")
|
||||
expect(generation.text).toBe("")
|
||||
}).pipe(
|
||||
Effect.provide(
|
||||
guidanceLayer(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue