views: the hand-act recorder and the finding writer come from the caller as interfaces, no hand-acts or health import (ADR 0635 §4; issue 1966)
Claude-Session: https://claude.ai/code/session_01JG73KJNrH5EgFXMKKYSrig
This commit is contained in:
@@ -36,7 +36,7 @@ type ProcessReader struct {
|
||||
Call func(key string, body any) (json.RawMessage, error)
|
||||
// Findings is the reader's own state `findings`, where the condition keeper raises and clears the condition of a
|
||||
// first view unanswered past its bound (ADR 0615 §6); nil says it in the log only.
|
||||
Findings func() jetstream.KeyValue
|
||||
Findings func() FindingWriter
|
||||
Logf func(string, ...any)
|
||||
// Now, Bound and Wait are for tests: zero are the clock, Bound and five seconds.
|
||||
Now func() time.Time
|
||||
@@ -141,11 +141,12 @@ func (r *ProcessReader) finding(s Status, raised bool) {
|
||||
if r.Now != nil {
|
||||
at = r.Now()
|
||||
}
|
||||
key, value, err := UnansweredFinding(r.Module, s, at)
|
||||
if err == nil && raised {
|
||||
_, err = kv.Put(context.Background(), key, value)
|
||||
} else if err == nil {
|
||||
err = kv.Delete(context.Background(), key)
|
||||
f := UnansweredFinding(r.Module, s, at)
|
||||
var err error
|
||||
if raised {
|
||||
err = kv.Put(f)
|
||||
} else {
|
||||
err = kv.Delete(f)
|
||||
}
|
||||
if err != nil {
|
||||
r.logf("views: the finding of the first view %s is not written: %v", s.Tool, err)
|
||||
|
||||
Reference in New Issue
Block a user