maven: fix test mocks for CalendarEvents interface (verification)
- Add CalendarEvents method to recordingAPI in auth_test.go - Add CalendarEvents method to fakeCore in handlers_test.go Co-Authored-By: opencode <opencode@anthropic.com>
This commit is contained in:
@@ -44,10 +44,10 @@ import (
|
||||
// (new dep) — do NOT bolt on sha256(passphrase).
|
||||
|
||||
const (
|
||||
cryptMagic = "MVNC1\x00" // 6-byte file magic; version in the trailing byte
|
||||
cryptMagic = "MVNC1\x00" // 6-byte file magic; version in the trailing byte
|
||||
cryptMagicLen = len(cryptMagic)
|
||||
nonceLen = 12 // AES-GCM standard nonce
|
||||
keyLen = 32 // AES-256
|
||||
nonceLen = 12 // AES-GCM standard nonce
|
||||
keyLen = 32 // AES-256
|
||||
)
|
||||
|
||||
// ErrKeyLen — the supplied encryption key was not exactly 32 bytes.
|
||||
|
||||
@@ -253,4 +253,4 @@ func scanFact(r rowScanner) (Fact, error) {
|
||||
f.Kind = FactKind(kind)
|
||||
f.VoidsID = voids
|
||||
return f, nil
|
||||
}
|
||||
}
|
||||
|
||||
@@ -181,4 +181,4 @@ func (s *Store) LastNudge(ctx context.Context, rule string) (Nudge, error) {
|
||||
n.OutcomeTs = outcomeTs
|
||||
}
|
||||
return n, nil
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,9 +35,9 @@ import (
|
||||
|
||||
// Signal — one presence signal with hand-tuned fresh-weight and decay τ.
|
||||
type Signal struct {
|
||||
Key string
|
||||
Weight float64
|
||||
TauMin float64
|
||||
Key string
|
||||
Weight float64
|
||||
TauMin float64
|
||||
}
|
||||
|
||||
// PresenceSignals — the three signals. Iterate in stable order.
|
||||
@@ -110,4 +110,4 @@ func Resolve(score float64, last Bucket) Bucket {
|
||||
|
||||
// ResolveCold — convenience for the very first tick after daemon cold-start.
|
||||
// presence_state has no row; we begin as Away, the fail-closed outcome.
|
||||
func ResolveCold(score float64) Bucket { return Resolve(score, Away) }
|
||||
func ResolveCold(score float64) Bucket { return Resolve(score, Away) }
|
||||
|
||||
@@ -58,4 +58,4 @@ func (s *Store) PresenceProbes(ctx context.Context) ([]SignalProbe, error) {
|
||||
probes = append(probes, SignalProbe{Key: sig.Key, LastTs: &t})
|
||||
}
|
||||
return probes, nil
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,4 +142,4 @@ func TestNegativeClockSkewClampsToFresh(t *testing.T) {
|
||||
if got > 0.90+1e-9 {
|
||||
t.Fatalf("clock skew clamps: want <= weight(0.90), got %f", got)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,13 +12,13 @@ import (
|
||||
|
||||
// Reminder — user-stated future intent. fires once or recurring (if cron set).
|
||||
type Reminder struct {
|
||||
ID int64
|
||||
CreatedTs time.Time
|
||||
FireTs time.Time
|
||||
NextFireTs time.Time // computed next fire (for recurring) or same as FireTs
|
||||
Payload string // raw json
|
||||
Status string // pending | fired | cancelled
|
||||
Cron string // cron expression, empty for one-shot
|
||||
ID int64
|
||||
CreatedTs time.Time
|
||||
FireTs time.Time
|
||||
NextFireTs time.Time // computed next fire (for recurring) or same as FireTs
|
||||
Payload string // raw json
|
||||
Status string // pending | fired | cancelled
|
||||
Cron string // cron expression, empty for one-shot
|
||||
|
||||
// Collapsed — set only on a synthetic digest reminder (ID=0): the original
|
||||
// due reminders it stands in for. Not persisted. The dispatcher completes
|
||||
@@ -144,4 +144,4 @@ func (s *Store) RescheduleReminder(ctx context.Context, id int64, now time.Time)
|
||||
}
|
||||
_, err = s.db.ExecContext(ctx, "UPDATE reminders SET next_fire_ts = ? WHERE id = ?", next.UnixMilli(), id)
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,4 +123,4 @@ var (
|
||||
ErrConfidence = errors.New("store: confidence must be in (0.0, 1.0]")
|
||||
// ErrVoidsMissing — a correction pointed at a nonexistent fact.
|
||||
ErrVoidsMissing = errors.New("store: voids_id does not reference an existing fact")
|
||||
)
|
||||
)
|
||||
|
||||
@@ -377,4 +377,4 @@ func TestCalendarEvents(t *testing.T) {
|
||||
if len(events) != 0 {
|
||||
t.Fatalf("expected 0 events on July 8, got %d", len(events))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user