Skip to content

docs: introduce OKF knowledge bundle and move the architecture out of feature READMEs#3600

Merged
matthiasn merged 28 commits into
mainfrom
docs/okf
Jul 26, 2026
Merged

docs: introduce OKF knowledge bundle and move the architecture out of feature READMEs#3600
matthiasn merged 28 commits into
mainfrom
docs/okf

Conversation

@matthiasn

Copy link
Copy Markdown
Owner

Adopts the Open Knowledge Format v0.2 as the home for Lotti's architecture documentation, and splits documentation by audience.

The split

Where Answers
lib/features/<x>/README.md What does this do, and what does it own? Product behaviour, scope boundary, where the code sits, a link to the concept.
knowledge/features/<x>/ How does it actually work? Runtime flows, state machines, invariants, key classes, gotchas.
docs/adr/ Decisions at a point in time. Concepts cite ADRs rather than restating them.

No fact is written twice. All 40 READMEs under lib/ became product descriptions: 19,269 lines → 1,654. The architecture they carried is now 88 concepts under knowledge/.

The bundle

knowledge/
  index.md              declares okf_version "0.2"
  log.md
  architecture/   8     bootstrap & DI, persistence, navigation, security,
                        logging, platform & release, shared widgets, overview
  domain/         3     JournalEntity + Metadata, entry links, entity definitions
  features/      73     one tree per module under lib/features
  conventions/    4     the bundle's own rules, testing, localization, code style

Every concept carries type, title, description, status, generated, stale_after and sources pointing back at the code it was derived from. verified is deliberately unset — that field records independent confirmation, and self-certifying generated text would defeat it. Reviewers adding verified: { by: human:<id>, at: ... } is the intended way to raise a concept's trust tier.

What keeps it from rotting

tool/okf/ validates OKF §11 conformance, but the load-bearing check is stricter: every markdown link and every sources[].resource leaving the bundle must resolve to a real path in the repo, or CI fails. A rename that invalidates the docs breaks the build for the person holding the context to fix it.

  • make okf_check
  • .github/workflows/okf-validate.yml (new Knowledge Bundle check)
  • 33 tests in test/tool/okf/, including one that guards the real bundle
  • AGENTS.md states the split rule and requires make okf_check after touching knowledge/

It earned its keep during the migration, catching profile_locality.dart documented under util/ when it lives in helpers/, and two Daily OS prompt files documented under agents/domain/ after they had moved.

Stale content found while grounding

Writing each concept against the code rather than copying prose surfaced drift the READMEs had accumulated:

Also

  • lib/features/sync/current_architecture.mddocs/architecture/sync_current_architecture.md. An investigation log is not product documentation.
  • yaml added to dev_dependencies for the validator.

Rebase note

Rebased onto main after #3596#3598. Those three PRs had just edited four of the READMEs this branch rewrites, so the architecture facts they added were carried into the concepts in a separate commit rather than dropped — including automaticAgentWakesEnabled, inferenceRouteIdentityTiers, the DesignSystemButton dense tier, and the tightened Daily OS write-path guards.

Verification

flutter analyze clean across the project, formatter clean, validator tests pass, bundle validates with 0 errors, 0 warnings.

Tracked in the maintainer tracker as lotti3-arp.

matthiasn added 21 commits July 26, 2026 05:15
Adopts the Open Knowledge Format v0.2 as the home for Lotti's architecture
documentation, at knowledge/.

Documentation is now split by audience: lib/features/*/README.md describes
what a feature does for a user, knowledge/ describes how it actually runs.
No fact is written twice.

The validator in tool/okf/ enforces OKF conformance and, more importantly,
that every code path a concept points at still exists. A rename that
invalidates the docs fails CI, so the person holding the context is the one
who fixes the prose.

This commit lands the infrastructure and the cross-cutting architecture
layer: bootstrap and DI, persistence, navigation, security and privacy,
logging, and platform/release. Feature migration follows.

Refs lotti3-arp
Splits the 1215-line sync README into seven grounded concepts under
knowledge/features/sync/ and leaves a 66-line product description behind.

Verified every structural claim against the code while migrating, which
surfaced two stale spots: SyncMessage now has twenty families (the README
omitted consumptionEvent) and SyncSequencePayloadType has seven members,
not six.

Also moves current_architecture.md out of lib/ into docs/architecture/,
since an investigation log is not product documentation.

Refs lotti3-arp.4
Splits the 2350-line agents README into eight grounded concepts under
knowledge/features/agents/ and leaves a 71-line product description behind.

Also teaches the validator to skip fenced blocks and inline code when
scanning links, so a documented link form quoted in prose is no longer
reported as a dangling bundle link.

Refs lotti3-arp.4
Splits the 1345-line ai README into ten grounded concepts under
knowledge/features/ai/ and leaves a 67-line product description behind.

The anti-drift check earned its keep here: it caught profile_locality.dart
documented under util/ when it actually lives in helpers/. The README also
claimed nine built-in skills where there are ten.

Refs lotti3-arp.4
Splits the 1756-line daily_os_next README into nine grounded concepts under
knowledge/features/daily_os_next/ and leaves a 68-line product description.

The anti-drift check again caught stale paths the README carried: the prompt
sections and prompt builder had both moved out of agents/domain/.

Completes wave 1 (sync, agents, ai, daily_os_next): 6666 README lines
migrated into 42 concepts.

Refs lotti3-arp.4
Splits the 1386-line tasks README into six grounded concepts under
knowledge/features/tasks/ and leaves a 57-line product description.

Refs lotti3-arp.5
Splits the 603-line journal README into three grounded concepts and leaves a
65-line product description.

Refs lotti3-arp.5
Splits the 616-line design_system README into two grounded concepts and
leaves a 60-line product description.

Refs lotti3-arp.5
JournalEntity and its Metadata envelope, the entry-link union, and the
entity definitions — including why the category automatic-inference flag is
a consent gate rather than a preference.

Refs lotti3-arp.3
settings_v2, whats_new, tts, keyboard, checklist, theming, notifications,
user_activity.

Refs lotti3-arp.6
… and the projection kernel

Refs lotti3-arp.7
Migrates the last seven READMEs — shared widgets, services, AI settings UI,
selection, modal, recording UI and celebration — and adds the corresponding
concepts.

All 40 READMEs under lib/ are now product descriptions: 19,269 lines became
1,654, with the architecture they carried living in 88 concepts under
knowledge/.

Refs lotti3-arp.7
The rebase replaced four READMEs main had just edited, so the facts those
edits added move into the concepts rather than being lost:

- agents: the footer regrouped around two questions, Skip once, the dense
  trigger and accent discipline, the button content-inset translation, and
  inferenceRouteIdentityTiers shedding route segments instead of ellipsising.
- agents/categories/domain: automaticAgentWakesEnabled seeds a task agent's
  automatic updates, is mirrored into the orchestrator, and is a seed rather
  than a gate.
- design system: the DesignSystemButton size ramp and what dense is for.
- daily_os_next: the past-start guard now covers every block type, cal blocks
  are refused on both routes and absent from both tool schemas, and taskId is
  resolved against the journal on both routes. Two concepts described the old
  cal exemption and were wrong.
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 178 files, which is 28 over the limit of 150.

To get a review, narrow the scope:
• coderabbit review --committed # exclude uncommitted changes
• coderabbit review --dir # limit to a subdirectory
• coderabbit review --base # compare against a closer base

Upgrade to a paid plan to raise the limit.

This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 220cd11c-e383-472f-8476-95f085e8e3c2

📥 Commits

Reviewing files that changed from the base of the PR and between 4d3b371 and 62f94da.

⛔ Files ignored due to path filters (1)
  • pubspec.lock is excluded by !**/*.lock
📒 Files selected for processing (178)
  • .github/workflows/okf-validate.yml
  • AGENTS.md
  • Makefile
  • docs/architecture/sync_current_architecture.md
  • docs/implementation_plans/2026-03-11_sync_replay_and_backfill_stabilization.md
  • docs/implementation_plans/2026-05-30_burned_sequence_status.md
  • docs/sync/2026-04-20_inbound_event_queue_design.md
  • docs/sync/2026-04-20_sync_freeze_and_log_bloat_audit.md
  • knowledge/architecture/bootstrap-and-di.md
  • knowledge/architecture/index.md
  • knowledge/architecture/logging-and-diagnostics.md
  • knowledge/architecture/navigation.md
  • knowledge/architecture/overview.md
  • knowledge/architecture/persistence.md
  • knowledge/architecture/platform-and-release.md
  • knowledge/architecture/security-and-privacy.md
  • knowledge/architecture/shared-widgets.md
  • knowledge/conventions/code-style.md
  • knowledge/conventions/index.md
  • knowledge/conventions/knowledge-bundle.md
  • knowledge/conventions/localization.md
  • knowledge/conventions/testing.md
  • knowledge/domain/entity-definitions.md
  • knowledge/domain/entry-links.md
  • knowledge/domain/index.md
  • knowledge/domain/journal-entity.md
  • knowledge/features/agents/index.md
  • knowledge/features/agents/memory-and-compaction.md
  • knowledge/features/agents/overview.md
  • knowledge/features/agents/persistence-and-sync.md
  • knowledge/features/agents/project-and-event-agents.md
  • knowledge/features/agents/task-agents.md
  • knowledge/features/agents/templates-souls-evolution.md
  • knowledge/features/agents/ui-surfaces.md
  • knowledge/features/agents/wake-orchestration.md
  • knowledge/features/agents_projection/index.md
  • knowledge/features/agents_projection/overview.md
  • knowledge/features/ai/activity-visualization.md
  • knowledge/features/ai/attribution.md
  • knowledge/features/ai/conversations-and-tools.md
  • knowledge/features/ai/embeddings-and-search.md
  • knowledge/features/ai/execution-paths.md
  • knowledge/features/ai/index.md
  • knowledge/features/ai/model-evaluation.md
  • knowledge/features/ai/overview.md
  • knowledge/features/ai/profile-resolution.md
  • knowledge/features/ai/provider-routing.md
  • knowledge/features/ai/seeding-and-lifecycle.md
  • knowledge/features/ai/settings-ui.md
  • knowledge/features/ai_chat/index.md
  • knowledge/features/ai_chat/overview.md
  • knowledge/features/ai_consumption/index.md
  • knowledge/features/ai_consumption/overview.md
  • knowledge/features/categories/index.md
  • knowledge/features/categories/overview.md
  • knowledge/features/character/index.md
  • knowledge/features/character/overview.md
  • knowledge/features/checklist/index.md
  • knowledge/features/checklist/overview.md
  • knowledge/features/daily_os_next/agent-identities.md
  • knowledge/features/daily_os_next/capture-and-planning.md
  • knowledge/features/daily_os_next/coordination-protocol.md
  • knowledge/features/daily_os_next/dependency-aware-planning.md
  • knowledge/features/daily_os_next/evaluation.md
  • knowledge/features/daily_os_next/index.md
  • knowledge/features/daily_os_next/overview.md
  • knowledge/features/daily_os_next/processing-outbox.md
  • knowledge/features/daily_os_next/ui-surfaces.md
  • knowledge/features/daily_os_next/wake-prompt.md
  • knowledge/features/dashboards/index.md
  • knowledge/features/dashboards/overview.md
  • knowledge/features/design_system/celebration.md
  • knowledge/features/design_system/component-contracts.md
  • knowledge/features/design_system/index.md
  • knowledge/features/design_system/tokens-and-theming.md
  • knowledge/features/events/index.md
  • knowledge/features/events/overview.md
  • knowledge/features/habits/index.md
  • knowledge/features/habits/overview.md
  • knowledge/features/index.md
  • knowledge/features/insights/index.md
  • knowledge/features/insights/overview.md
  • knowledge/features/journal/browse-and-linking.md
  • knowledge/features/journal/detail-and-saving.md
  • knowledge/features/journal/index.md
  • knowledge/features/journal/overview.md
  • knowledge/features/keyboard/index.md
  • knowledge/features/keyboard/overview.md
  • knowledge/features/knowledge_graph_poc/index.md
  • knowledge/features/knowledge_graph_poc/overview.md
  • knowledge/features/labels/index.md
  • knowledge/features/labels/overview.md
  • knowledge/features/notifications/index.md
  • knowledge/features/notifications/overview.md
  • knowledge/features/onboarding/index.md
  • knowledge/features/onboarding/overview.md
  • knowledge/features/projects/index.md
  • knowledge/features/projects/overview.md
  • knowledge/features/ratings/index.md
  • knowledge/features/ratings/overview.md
  • knowledge/features/settings/index.md
  • knowledge/features/settings/overview.md
  • knowledge/features/settings_v2/index.md
  • knowledge/features/settings_v2/overview.md
  • knowledge/features/speech/index.md
  • knowledge/features/speech/overview.md
  • knowledge/features/speech/recording-ui.md
  • knowledge/features/surveys/index.md
  • knowledge/features/surveys/overview.md
  • knowledge/features/sync/index.md
  • knowledge/features/sync/message-model.md
  • knowledge/features/sync/node-profiles-and-auto-trigger.md
  • knowledge/features/sync/overview.md
  • knowledge/features/sync/receive-path.md
  • knowledge/features/sync/send-path.md
  • knowledge/features/sync/sequence-and-backfill.md
  • knowledge/features/sync/vector-clocks-and-conflicts.md
  • knowledge/features/tasks/checklists.md
  • knowledge/features/tasks/data-model.md
  • knowledge/features/tasks/detail-composition.md
  • knowledge/features/tasks/filtering.md
  • knowledge/features/tasks/index.md
  • knowledge/features/tasks/overview.md
  • knowledge/features/tasks/relationships.md
  • knowledge/features/theming/index.md
  • knowledge/features/theming/overview.md
  • knowledge/features/tts/index.md
  • knowledge/features/tts/overview.md
  • knowledge/features/user_activity/index.md
  • knowledge/features/user_activity/overview.md
  • knowledge/features/whats_new/index.md
  • knowledge/features/whats_new/overview.md
  • knowledge/index.md
  • knowledge/log.md
  • lib/features/agents/README.md
  • lib/features/agents/projection/README.md
  • lib/features/ai/README.md
  • lib/features/ai/ui/settings/README.md
  • lib/features/ai/ui/settings/widgets/form_components/README.md
  • lib/features/ai_chat/README.md
  • lib/features/ai_consumption/README.md
  • lib/features/categories/README.md
  • lib/features/character/README.md
  • lib/features/checklist/README.md
  • lib/features/daily_os_next/README.md
  • lib/features/dashboards/README.md
  • lib/features/design_system/README.md
  • lib/features/design_system/components/celebration/README.md
  • lib/features/events/README.md
  • lib/features/habits/README.md
  • lib/features/insights/README.md
  • lib/features/journal/README.md
  • lib/features/keyboard/README.md
  • lib/features/knowledge_graph_poc/README.md
  • lib/features/labels/README.md
  • lib/features/notifications/README.md
  • lib/features/onboarding/README.md
  • lib/features/projects/README.md
  • lib/features/ratings/README.md
  • lib/features/settings/README.md
  • lib/features/settings_v2/README.md
  • lib/features/speech/README.md
  • lib/features/speech/ui/widgets/recording/README.md
  • lib/features/surveys/README.md
  • lib/features/sync/README.md
  • lib/features/tasks/README.md
  • lib/features/theming/README.md
  • lib/features/tts/README.md
  • lib/features/user_activity/README.md
  • lib/features/whats_new/README.md
  • lib/services/README.md
  • lib/widgets/README.md
  • lib/widgets/modal/README.md
  • lib/widgets/selection/README.md
  • pubspec.yaml
  • test/tool/okf/okf_validator_test.dart
  • tool/okf/okf_validator.dart
  • tool/okf/validate.dart

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/okf

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Jul 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.15%. Comparing base (4d3b371) to head (62f94da).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3600   +/-   ##
=======================================
  Coverage   99.15%   99.15%           
=======================================
  Files        1784     1784           
  Lines      131122   131122           
=======================================
+ Hits       130009   130010    +1     
+ Misses       1113     1112    -1     
Flag Coverage Δ
glados 14.07% <ø> (ø)
standard 98.90% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 46d0768959

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tool/okf/okf_validator.dart Outdated
Comment thread tool/okf/okf_validator.dart Outdated
Comment thread tool/okf/okf_validator.dart Outdated
Comment thread tool/okf/okf_validator.dart Outdated
Comment thread docs/sync/2026-04-20_inbound_event_queue_design.md
Comment thread knowledge/features/ai/seeding-and-lifecycle.md
Six review findings, all real:

- Require stale_after and sources as house keys. Both were only validated
  when present, so a new concept could omit exactly the metadata that makes
  drift detectable.
- Guard the root index.md loadYaml. Invalid YAML there threw past the issue
  list and took the CLI down with a stack trace instead of reporting a
  file-scoped diagnostic.
- Scan reference-style link definitions. `[impl]: ../../lib/gone.dart` matched
  no pattern, so a dangling code pointer passed make okf_check. Footnote
  definitions stay excluded — §5.1 keys those to sources[].id and their body
  is prose.
- Validate real calendar dates and times. DateTime rolls out-of-range
  components over rather than rejecting them (2026-99-99 parses as 2034-06-07,
  99:99:99 as an instant four days later), so shape-only regexes accepted
  impossible metadata. Range-check first, then round-trip for day-of-month.
- Repoint the three remaining references to the moved sync document.
- Add the AI-config lifecycle diagram. That concept documents deleteConfig,
  hardDeleteConfig and restoreConfig as distinct transitions, and AGENTS.md —
  added in this PR — requires a diagram for a real state machine.

The test fixtures now build from one house-key block, so a future required
key is a single edit rather than thirty. Verified the new reference-link and
date tests fail with their fix removed.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e71e359123

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tool/okf/okf_validator.dart Outdated
Comment thread tool/okf/okf_validator.dart Outdated
Comment thread knowledge/conventions/knowledge-bundle.md Outdated
Comment thread knowledge/architecture/platform-and-release.md Outdated
…ance

Four further findings, all real:

- `sources[].resource` must be a non-empty *string*. `resource: 123` passed
  the presence check and was then skipped by _resourceTargets, which only
  yields strings — so a present entry could carry no usable attribution while
  make okf_check succeeded.
- A root index.md carrying a frontmatter mapping without `okf_version` emitted
  nothing, because the fallback warning only fires when the whole block is
  absent.
- Seven workflows listen on tag pushes, not six. The prose and the frontmatter
  description disagreed with the diagram directly below them, which already
  listed all seven.
- Refresh provenance dates for the files this branch itself modifies —
  AGENTS.md and the Makefile. A bundle whose selling point is honest
  provenance should not ship with dates its own commit invalidated.

The moved sync document keeps 2026-05-30: the rename changed its path and not
one byte of its content, so that remains its accurate content recency.

Both new guards are covered by tests verified to fail with the guard removed.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ba6ff3c037

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tool/okf/okf_validator.dart
Comment thread tool/okf/okf_validator.dart
Comment thread tool/okf/okf_validator.dart
Comment thread knowledge/features/design_system/celebration.md Outdated
Comment thread tool/okf/okf_validator.dart Outdated
Comment thread knowledge/features/design_system/celebration.md Outdated
Comment thread knowledge/architecture/platform-and-release.md Outdated
Comment thread knowledge/features/user_activity/overview.md Outdated
Comment thread knowledge/features/onboarding/overview.md Outdated
…or gaps

Three of these were assertions in the bundle that the code contradicts, which
is the failure mode this bundle exists to prevent:

- user_activity: I listed Daily OS as an activity-gate consumer. UserActivityGate
  has zero references in daily_os_next — DayProcessingRuntime drains on startup,
  outbox changes, retries and connectivity without waiting for idle. I inferred
  that consumer from the sync pattern rather than checking. Now stated as the
  real difference it is.
- onboarding: "skipping persists nothing" is wrong. The modal records
  welcomeSkipped, and the auto-show path writes the shown count and
  first-shown timestamp before opening. What a skip preserves is the grace
  period, not storage neutrality.
- celebration/checklists: "haptics always fire" is wrong as an absolute. The
  animation switches and reduce-motion do not silence haptics, but a separate
  haptics preference does, honoured via onCelebrate: null.

Plus a CI map that mis-described its own triggers (type-check has no path
filter; flatpak-foreign-deps filters PRs but not branch pushes), and a
celebration concept that repeated its README verbatim — the duplication the
split exists to prevent. Verbatim sentence overlap between the two is now zero.

Validator gaps closed:

- `sources: null` and `sources: []` both satisfied their checks while leaving a
  concept with no provenance.
- A bundle-absolute `sources[].resource` (`/domain/x.md`, legal per §6.2) was
  checked by nothing: validateRepoReferences skips `/` prefixes and the
  body-link scanner never sees frontmatter.
- Angle-bracket destinations `[t](<path with space>)` never matched the
  whitespace-free pattern, so a dangling pointer written that way passed.
- log.md heading validation now strips fences, as the link scanner already did,
  so a `## example` inside a fenced sample is not read as a heading.

51 tests. All five new ones verified to fail with their guard removed — two of
my first revert attempts silently failed to apply, so those checks were redone
rather than trusted.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7ac56b0be2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tool/okf/okf_validator.dart Outdated
Comment thread tool/okf/okf_validator.dart Outdated
Comment thread lib/features/agents/README.md Outdated
Comment thread lib/features/sync/README.md Outdated
Comment thread knowledge/architecture/security-and-privacy.md Outdated
Comment thread knowledge/architecture/persistence.md Outdated
Comment thread knowledge/features/daily_os_next/ui-surfaces.md Outdated
Comment thread knowledge/architecture/overview.md Outdated
Comment thread knowledge/architecture/shared-widgets.md Outdated
The most important one is security-relevant. I wrote that API keys never touch
SQLite. AiConfigDb.saveConfig() persists a provider as jsonEncode(config.toJson())
and that map includes its apiKey, so provider keys live in ai_config.sqlite —
which the same concept correctly calls unencrypted at rest. A reader would have
derived the opposite threat model. Now stated as the asymmetry it is: Matrix
credentials are in the keychain, AI-provider keys are not, and moving them there
is hardening rather than a docs fix.

Four more claims the code contradicts:

- persistence: "every byte lives in SQLite" is wrong — audio and images are
  separate files read via getAudioPath/getFullImagePath, which my own speech
  concept already described. Backup and migration have to cover both.
- daily_os_next: StandaloneTag does not exist anywhere in lib. Task-linked is
  the marked case; standalone is the unmarked default. I copied this from the
  old README instead of checking.
- overview: twelve supported locales, not seven.
- shared-widgets: ModalUtils is not the only presentation path — the Daily OS
  planning modal and What's New call WoltModalSheet directly, the former because
  it needs a side panel rather than a dialog.

Also, per this PR's own README contract, the agents and sync READMEs now end at
their knowledge concept rather than at a supplemental reference; swept all 40 to
confirm. And the localization concept named five ARB catalogs as if they were
all twelve — it now states the full set and flags that AGENTS.md's required-edit
list is a subset.

Validator gaps closed: reference definitions accept angle-bracketed
destinations containing whitespace, and a spaced source is only exempted as a
§5.1 scope descriptor when it is not path-shaped — so `../../lib/missing
file.dart` is checked rather than waved through.

53 tests; both new ones verified to fail with their guard removed.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 34f5a77157

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tool/okf/okf_validator.dart
Comment thread tool/okf/okf_validator.dart
Comment thread tool/okf/okf_validator.dart Outdated
Comment thread tool/okf/okf_validator.dart
Comment thread tool/okf/okf_validator.dart
Comment thread tool/okf/okf_validator.dart Outdated
Comment thread knowledge/features/notifications/overview.md
Comment thread knowledge/features/categories/overview.md Outdated
Comment thread tool/okf/okf_validator.dart
Comment thread knowledge/architecture/logging-and-diagnostics.md Outdated
Found in a self-audit of the 'only'/'never' claims, not by review:
'installModel is the only path that downloads from Hugging Face' reads as
global, but the TTS feature fetches its own Supertonic model over a separate
path. Anyone auditing what reaches Hugging Face would have been misled.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6198249be8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tool/okf/okf_validator.dart Outdated
Comment thread knowledge/features/theming/overview.md Outdated
Comment thread knowledge/features/dashboards/overview.md Outdated
Comment thread knowledge/features/tts/overview.md Outdated
Comment thread knowledge/features/settings/overview.md Outdated
Review round 5 on the OKF bundle.

Validator — each gap now has a test that fails with the guard reverted:

* Required house keys were checked for presence only, so `generated:` with
  nothing after the colon passed while carrying no provenance at all; every
  per-field validator treats YAML null like an absent key and stays silent.
  Empty values and non-string title/description are now reported.
* A relative `./missing.dart` source was checked by neither pass: the bundle
  pass looked only at `/`-prefixed resources, the repo pass only at targets
  escaping the bundle. Every path-shaped resource now goes through the bundle
  pass, which already defers escaping ones.
* A bare `missing.dart` was classified as a §5.1 scope descriptor and exempted
  from resolution; a filename-with-extension shape now counts as a path, with an
  extension bound so prose ending in a period stays exempt.
* Link titles in the single-quoted and parenthesised forms made the whole link
  match nothing, hiding the target inside it.
* log.md was the only .md file whose bundle-internal links nothing validated,
  though it is the file that links concepts most densely.
* `computation: false` satisfied §10.3's file form and suppressed the warning
  while pointing at nothing followable.
* An absolute bundle argument resolved every code pointer outside the checkout,
  so a clean bundle reported hundreds of drift errors purely from how it was
  invoked. Normalisation is now a pure, tested function.
* Four-space indented code blocks were scanned for links, so a documented link
  form inside one failed the check — the one failure mode worse than a miss,
  because it blocks a correct change.

Reverting each guard also exposed that index.md link validation had no test at
all; added.

Concepts — six claims the code contradicts:

* Onboarding is not the only writer of `automaticInferenceEnabled`; the category
  settings form owns it from then on, via a conditionally rendered switch. The
  same wrong exclusivity appeared in three concepts.
* Logging has no Insights sink and no in-app viewer — files are the only sink and
  `InsightType` is vestigial.
* Theme sync is arrival-based, not last-write-wins: the local setters never
  advance `THEME_PREFS_UPDATED_AT`. `dailyOsUserName` does advance its
  timestamp, so the two are not the mirror the code comment claims.
* Survey charts write too, through `PersistenceLogic.createSurveyEntry`; and the
  matrix has five variants, not the six I listed — there is no story-time chart.
* TTS synthesis is local, but the weights are not bundled: first speak downloads
  six files from Hugging Face.
* The repaint-rainbow maintenance row hardcodes English, contradicting the
  localization boundary the same concept asserts. Documented as the unfixed
  oversight it is rather than changing 11 locales' UI in a docs PR.

Adds a stateDiagram-v2 for the notification mark lifecycle, which the repo's own
rule requires for a real state machine.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 620c8d5ef8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tool/okf/okf_validator.dart
Comment thread knowledge/architecture/security-and-privacy.md Outdated
Comment thread knowledge/architecture/index.md Outdated
Comment thread knowledge/architecture/security-and-privacy.md Outdated
Comment thread knowledge/domain/journal-entity.md Outdated
Comment thread knowledge/features/user_activity/overview.md Outdated
…t claims

Review round 6 on the OKF bundle.

Validator: a concept whose `sources` all point inside the bundle passed both
passes — the bundle check resolved the sibling file, the repo check skipped it for
staying inside `knowledge/`. That is the one shape whose drift is undetectable,
since a pointer at a sibling concept can never fail when the code moves, so it
defeats the reason `sources` is required at all. Now warns when *nothing* in
`sources` leaves the bundle. Deliberately permissive about what counts: a repo
path, an external URL and a §5.1 scope descriptor all qualify.

Concepts:

* Matrix access tokens do touch SQLite. `SecureStorage` holds only the config
  JSON needed to log in; `MatrixSdkDatabase.insertClient`/`updateClient` put
  `token`, `refreshToken` and `olmAccount` into the unencrypted
  `matrix/lotti_sync.db`. The keychain holds what is needed to log in, that file
  holds what is needed to stay logged in — an attacker with file access needs no
  password. Verified against matrix-8.1.0 rather than assumed.
* The security concept still said logs are "readable only in-app", contradicting
  the logging concept corrected in the previous commit. Restated as the tradeoff
  it actually is: no screen can leak log content, and no screen can show it
  either, so helping with a bug means exporting files.
* The architecture index said six release pipelines where the release concept
  says seven; seven workflows listen on tag pushes.
* `JournalEntity` is not every piece of user data — what the user *configures* is
  `EntityDefinition`, syncing as its own message family, and settings and agent
  state sit outside both. Coverage that walks only `JournalEntity` is incomplete
  by construction, which is the kind of thing backup and migration work reads
  this concept to decide.
* The activity gate does not make the start race-free. `waitUntilIdle()` awaits
  one idle edge and takes no lease, registers no cancellation hook and excludes
  nothing afterwards, so a user resuming just after the edge gets their input
  during a large apply exactly as before. The concept now bounds the promise at
  "delays work to an idle edge, and nothing more".
@matthiasn
matthiasn merged commit 8df28a9 into main Jul 26, 2026
33 checks passed
@matthiasn
matthiasn deleted the docs/okf branch July 26, 2026 06:35

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 62f94da8b3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


return [
OkfIssue(
severity: Severity.warning,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Fail validation when sources never cite code

Fresh evidence in the follow-up implementation is that a concept sourced only from an existing sibling concept now produces Severity.warning, while validate.dart exits nonzero for warnings only with --warnings-as-errors; neither make okf_check nor the workflow supplies that flag. Such a concept therefore still passes CI without any source pointing at the code it was derived from, so this repository-specific provenance violation needs to be an error.

AGENTS.md reference: AGENTS.md:L120-L123

Useful? React with 👍 / 👎.

}

final _fencedBlockPattern = RegExp(
r'^(```|~~~).*?^\1',

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Ignore fences indented by up to three spaces

When a concept contains a valid Markdown fence indented by one to three spaces, this start-anchored pattern does not remove it; _stripIndentedBlocks also ignores indentation below four spaces. A sample link such as [implementation](../../lib/missing.dart) inside that code block is consequently scanned as a live repository pointer and makes make okf_check fail even though Markdown renders no link.

AGENTS.md reference: AGENTS.md:L130-L131

Useful? React with 👍 / 👎.

multiLine: true,
dotAll: true,
);
final _inlineCodePattern = RegExp(r'`[^`\n]*`');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Ignore multi-backtick code spans

When documentation uses a valid multi-backtick code span such as ``[implementation](../../lib/missing.dart)``, this single-backtick regex removes only the adjacent delimiter pairs and leaves the link text exposed. The repository-reference pass then reports the example as a dangling live pointer and blocks an otherwise valid knowledge change.

AGENTS.md reference: AGENTS.md:L130-L131

Useful? React with 👍 / 👎.

// 'source')` matching nothing at all, so the dangling pointer inside it was
// never even offered for checking.
final _markdownLinkPattern = RegExp(
r'\[[^\]]*\]\(\s*(?:<([^>]*)>|([^)\s]+))'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Parse balanced parentheses in link destinations

When a valid bare Markdown destination contains balanced parentheses—for example [impl](../../lib/foo_(bar).dart)—the [^)\s]+ group stops at the inner ), so the validator checks the truncated path ../../lib/foo_(bar. Even if the real file exists, make okf_check reports it as missing; destination parsing needs to preserve balanced parentheses or use a Markdown parser.

AGENTS.md reference: AGENTS.md:L130-L131

Useful? React with 👍 / 👎.

required String workingDirectory,
}) {
final normalized = bundleRoot.replaceAll(r'\', '/');
if (!normalized.startsWith('/')) return normalized;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Canonicalize relative bundle-root aliases

When the documented positional argument is a relative alias containing .., such as running from the repository root with ../lotti/knowledge, returning it unchanged makes a normal source resolve to ../lotti/lib/...; validateRepoReferences interprets that prefix as escaping the repository and emits an error for every code pointer. Normalize relative roots against the working directory just like absolute roots, or reject aliases that cannot establish the repository boundary.

AGENTS.md reference: AGENTS.md:L130-L132

Useful? React with 👍 / 👎.

Comment on lines +77 to +80
**`sync` is the one domain that routes to its own file.** It is off by default
and far noisier than everything else — a catch-up can produce thousands of lines
in a second — so it goes to `sync-<date>.log` where it can be read in isolation
without burying the rest.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Document the per-domain logging sinks

For every enabled non-sync DomainLogger.log call, production first invokes LoggingService.captureEvent for the general daily log and then synchronously appends a second <domain>-YYYY-MM-DD.log; errors additionally write error-safe and per-domain files. The claim that only sync routes to its own file gives diagnostics and privacy audits an incomplete file inventory, so describe the fan-out rather than the legacy single-route model.

AGENTS.md reference: AGENTS.md:L111-L114

Useful? React with 👍 / 👎.

Comment on lines +57 to +59
`ProfileAutomationService` consults it before **every** automatic path — the
profile-driven one and the direct transcription fallback alike — so this flag, not
the profile, is the switch that decides whether automation runs. See

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Account for synced audio in the consent boundary

When audio recorded on another device syncs to a task with a pinned local profile and an automated transcription assignment, SyncedAudioInferenceDispatcher invokes SkillInferenceRunner directly without loading the category or checking automaticInferenceEnabled; it explicitly bypasses ProfileAutomationService. The category flag therefore does not currently guard every automatic path as claimed, so either add that gate to the synced-audio dispatcher or qualify this consent invariant in all affected concepts.

AGENTS.md reference: AGENTS.md:L111-L114

Useful? React with 👍 / 👎.

Comment on lines +25 to +27
**The visible experience is gated by `enableProjectsFlag`.** With it off there is
no top-level tab, no category projects section and no task project chip. Routes
may still exist, but the normal ways in are hidden.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep the task project picker inside the feature gate

When enableProjectsFlag is off, a categorized task opened in the desktop detail pane still renders its project crumb, watches projectForTaskProvider, and receives an onProjectTap callback that opens ProjectSelectionModalContent; the connector never reads the flag. This remains a normal project entry and write path despite the concept claiming the task project control is hidden, so either gate the header control or qualify the feature-flag boundary.

AGENTS.md reference: AGENTS.md:L111-L114

Useful? React with 👍 / 👎.

Comment on lines +103 to +104
`pause()` and `resume()` exist on the controller but are **not surfaced by the
current modal UI**.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Describe the recording modal's pause control

During an active recording, AudioRecordingModal renders _buildPauseResumeButton, whose localized button toggles AudioRecorderController.pause() and resume() and changes between pause and play states. Saying these methods are not surfaced gives maintainers and feature-parity work the opposite description of the current recording UI; document the control that is already available.

AGENTS.md reference: AGENTS.md:L111-L114

Useful? React with 👍 / 👎.

matthiasn added a commit that referenced this pull request Jul 26, 2026
#3600 moved the daily_os_next architecture out of the feature README and
into knowledge/features/daily_os_next/, which landed after this branch was
cut. The prose belongs there now:

- dependency-aware-planning.md gains the two-carrier table and why the
  corpus alone was not enough.
- evaluation.md gains the third visibility flag and the re-read of
  blockedWithoutCorpus.
matthiasn added a commit that referenced this pull request Jul 26, 2026
#3600 moved the daily_os_next architecture out of the feature README and
into knowledge/features/daily_os_next/, which landed after this branch was
cut. The prose belongs there now:

- dependency-aware-planning.md gains the two-carrier table and why the
  corpus alone was not enough.
- evaluation.md gains the third visibility flag and the re-read of
  blockedWithoutCorpus.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant