Repository navigation
Preserve brain dump reuse and schedules through approval - #1000
Conversation
There was a problem hiding this comment.
Important
The new display-date normalization can silently change a child habit from its inherited weekday schedule to daily tracking. Preserve the effective schedule before merging.
Reviewed changes Reviewed the chat proposal, preview, revision, and approval paths, including the sibling client's existing preview contract.
- Argument preparation: Bulk creation normalizes zero-second clocks and derives missing dates recursively before validation, preview, and execution.
- Reuse identity: Supplied IDs determine stored title spelling, and localization preserves those reuse titles.
- Approval editing: Anchored due dates become read-only, with matching displayed dates synchronized when the anchor changes.
- Instructions and coverage: Brain dump read guidance, bilingual copy documentation, captured fixtures, and replay tests are updated. Focused suites passed with 79 Application and 22 Infrastructure tests; an additional isolated persistence reproduction confirmed the inline regression.
gpt-6.1-sol | 𝕏
There was a problem hiding this comment.
No new issues found.
Reviewed changes Reviewed the changes from f14cc68d through bd74452e and verified that the resolved weekday-inheritance finding is fixed.
- Preserved inherited weekdays: Kept omitted weekdays distinct from explicit empty arrays when an anchored child receives a display date, without changing the date-only default.
- Added persistence coverage: Exercised existing and newly created parents through preview, revision, refresh, approval, and saved schedule readback. All 50
BulkCreateAgentOperationTestspassed locally.
gpt-6.1-sol | 𝕏
|




Tracks thomasluizon/orbit-tickets#1856
Brain dumps that copied a suggested habit's zero-second clock values could hold a preview but fail approval. Recurring items carrying only a start anchor also lacked a visible first date, and source-text localization could overwrite a reused habit's stored title casing.
BulkCreateHabitsTool.Arguments.cs prepares the same typed arguments for capacity checks, validation, preview and execution. It converts zero-second suggestion times to minute precision and includes a supplied recurring start date as due_date when absent. Existing validators still reject invalid times, and the existing commands and domain guards remain authoritative. ProcessUserChatCommand.Resolution.cs prioritizes an existing ID and binds its stored title; HabitProposals.cs and HabitProposalValidator.cs keep localization from undoing that binding. PendingOperationChangePreviewer.Reuse.cs marks due_date as display-only when start_date controls recurrence. PendingOperationRevisionService.cs keeps a matching displayed date synchronized when the anchor is edited. No message pattern selects, triggers or rewrites tools.
HabitModelInstructions.cs and the bulk, lookup, calendar and habit-month descriptions limit brain dump preparation to the message, query_habits for reuse and suggest_habits for requested ideas. Prompt and tool text in English, with pt-BR review translations, is inventoried in BrainDumpCopy.md. No new user-facing runtime sentence is added. AnswerComposition.md and the tools README describe the behavior.
The captured reuse calls already supply habit_id, including English r1. The API retains entityId and the habit_id field's proposed UUID through JSON and SSE. The paired eval visible-preview.mjs projection removes those identity values; that remaining projection work belongs to the existing paired tickets thomasluizon/orbit-tickets#1863 and thomasluizon/orbit-tickets#1864. The ideas r2 and r3 approval message about duplication or changed fixtures was a row-count check after failed execution: the persistence replay exposes the actual HH:mm validation failure. After normalization, all three new records are saved and both stored fixtures remain byte-for-byte equivalent on fresh-context readback.
Assumptions
Test evidence
Before changing tests or implementation:
dotnet test tests/Orbit.Application.Tests --filter FullyQualifiedName~BrainDump --logger 'console;verbosity=minimal': exit 0, 23 passed with the defects present.dotnet test tests/Orbit.Infrastructure.Tests --filter FullyQualifiedName~BrainDump --logger 'console;verbosity=minimal': exit 0, 12 passed with the defects present.Strengthened tests before their fixes:
dotnet test tests/Orbit.Application.Tests --filter FullyQualifiedName~BrainDump_GateNine --logger 'console;verbosity=minimal': exit 1. BrainDump_GateNineCaptureKeepsIdentityAndEffectiveStartDate failed both captured mixed cases because the due_date field was absent; four captured reuse cases already passed.dotnet test tests/Orbit.Infrastructure.Tests --filter FullyQualifiedName~BrainDump_GateNine --logger 'console;verbosity=minimal': exit 1. BrainDump_GateNineIdeaApprovalPreservesEveryStoredFixture failed both captured ideas r2/r3 approvals with due_time must use HH:mm format or null. The test baseline was read from a fresh context to avoid SQLite DateTime kind serialization differences.The final edit-path safeguard was also observed red before its fix:
dotnet test tests/Orbit.Application.Tests --filter FullyQualifiedName~BrainDump_GateNineCapture --logger 'console;verbosity=minimal': exit 1, seven captured cases offered an editable due_date even though start_date controls creation.dotnet test tests/Orbit.Infrastructure.Tests --filter FullyQualifiedName~BrainDump_GateNineStartDateEdit --logger 'console;verbosity=minimal': exit 1, both captured mixed cases kept the old due_date after changing the anchor. These persistence replays pass the captured arguments through TerminalWriteDirective.ExecutionArguments, matching the production chat boundary's removal of its completion marker.After the fixes:
dotnet test tests/Orbit.Application.Tests --filter 'FullyQualifiedName~BrainDump|FullyQualifiedName~ExistingHabitSuggestion|FullyQualifiedName~HabitProposalValidator' --logger 'console;verbosity=minimal': exit 0, 79 passed.dotnet test tests/Orbit.Application.Tests --filter 'FullyQualifiedName~BrainDump|FullyQualifiedName~PendingOperationChangePreviewer' --logger 'console;verbosity=minimal': exit 0, 160 passed after the editability safeguard.dotnet test tests/Orbit.Infrastructure.Tests --filter FullyQualifiedName~BrainDump --logger 'console;verbosity=minimal': exit 0, 22 passed, including fresh-context approval readback for the captured ideas, reuse and mixed cases, plus start-date edits in both languages.dotnet build Orbit.slnx -c Release: exit 0, zero errors. OpenAPI regeneration left every supported artifact unchanged.python3 .github/scripts/openapi_artifacts.py freshness: exit 0.node tools/capability-inventory.mjs --check: exit 0.Full Release suite, each run with
dotnet test tests/<project> -c Release --no-build --logger 'console;verbosity=minimal':The skipped Infrastructure cases require the existing optional PostgreSQL test environment.
Ten fixture files in tests/Orbit.Application.Tests/Fixtures/BrainDumps retain the real g9a tool arguments, results and readback evidence. They come from API 74c6e4f with eval harness fba2380cc; GateNine.md records provenance and replay behavior. No new external runtime response fields are read. The model schema's habit_id is optional in the authored schema and becomes required with a nullable string type through StrictToolSchema, consistent with OpenAI's function calling guidance. The real captured values and the existing typed API result establish the identity contract, rather than a guessed fixture field.
Live pass^3 evals, paired UI/eval updates and copy approval remain with the coordinator. No browser or application server was started, and no second repository was edited.
Review round 1 (
bd74452e)daysand carries astart_datekeepsdays = nullwhen the preview's displaydue_dateis added, soCreateSubHabitCommandinherits the parent's weekdays through preview, revision and approval. Explicitdays(including[]) and dated items withoutstart_datekeep their behaviour.BulkCreateAgentOperationTests.InheritedWeekdays.csfailed onf14cc68d(six failures, empty saved weekdays) and passes now; 50 of 50BulkCreateAgentOperationTestspass with persisted readback.main3277ebfe(orbit-api#999) is merged in the same commit; it sharedAnswerComposition.md,PendingOperationChangePreviewer.csandChat/Tools/README.md.