Skip to content

feat(kernel): port fixes, takesOver, locales and a settings cache - #671

Merged
kelvinkipruto merged 4 commits into
mainfrom
feat/v3-kernel-review-changes
Nov 16, 2026
Merged

kelvinkipruto merged 4 commits into
mainfrom
feat/v3-kernel-review-changes

Conversation

@kelvinkipruto

Copy link
Copy Markdown
Contributor

The kernel changes from the November review, in the order the issue lists them.

Closes #665

What it changes

  1. Verdicts. The verification port's verdict includes misleading, as in section 7.5.
  2. Verdict updates. They carry a link to any published report and a withdrawn flag, so an adapter can tell a withdrawn report from a claim not yet verified.
  3. AI calls. LLMProvider.generate returns the structured output and the tokens used.
  4. Importers. StructuredImporter only reads files: inspect and rows. It no longer creates records (D49). The core does the mapping, preview and commit in V1-07: Areas, offices and spreadsheet import #645.
  5. Taking over core fields. A takesOver manifest entry lists fields a plugin writes while enabled, as dotted paths such as verification.verdict (section 4.5).
    • The fields become read-only in the admin to everyone but a super-admin, and a super-admin's change is logged by field name.
    • Start-up stops on a path that does not exist, on an owner missing from dependsOn, and on two enabled plugins taking over one field.
    • A disabled plugin leaves the fields alone.
  6. Settings. A plugin's settings are read once and reused. A save clears them in that process. Other processes, such as the worker, read again within 30 seconds.
  7. Locales. The kernel reads PT_LOCALES and stops start-up on a code that is not registered (D45). The registered list is in apps/cms/src/locales.ts: English, French, Portuguese, Arabic and Swahili. English is always on.

Decisions made while building

  • Settings across processes. One process cannot see another's save, so "until the settings change" became "at once here, within 30 seconds elsewhere". Section 7.10 now says this.
  • Rows are streamed. rows returns an async iterable with each row's number, so a large file is not held in memory and errors can name the row.
  • Paths. A takesOver path steps through groups and named tabs. Fields inside arrays and blocks cannot be taken over.
  • Payload's localization is not switched on here. It adds the locale list to the database, which needs a migration. That comes with V1-06: Languages, countries and the site shell #644. Until then PT_LOCALES is checked and shown in the start-up line, and nothing else reads it.

Environment and config

  • New, optional: PT_LOCALES. Defaults to en. Documented in .env.example and passed through Compose.

Migrations

None. The schema is unchanged.

How to test

pnpm services
pnpm test

Checked locally: lint, type check, the migration check, 100 unit, 3 integration and 5 browser tests. The browser tests ran against the dev server.

The kernel changes from the November review (#665).

- Verdicts include misleading. A verdict update carries a report link and a withdrawn flag.
- LLMProvider.generate returns the output and the tokens used.
- StructuredImporter only reads files: inspect and rows (D49).
- takesOver lists core fields a plugin writes while enabled. They are read-only in the admin to everyone but a super-admin, and a super-admin's change is logged.
- Plugin settings are read once and reused. A save clears them in that process, and other processes read again within 30 seconds.
- PT_LOCALES chooses from the registered locales, and start-up stops on any other code (D45).
@kelvinkipruto
kelvinkipruto merged commit 6386420 into main Nov 16, 2026
5 checks passed
@kelvinkipruto
kelvinkipruto deleted the feat/v3-kernel-review-changes branch November 16, 2026 12:29
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.

V1-24: Kernel changes from the November review

1 participant