Skip to content

feat(app-shell): Keepiq runs without any other app - #1175

Merged
rjzondervan merged 14 commits into
developmentfrom
spec/standalone-app-shell
Oct 6, 2026
Merged

rjzondervan merged 14 commits into
developmentfrom
spec/standalone-app-shell

Conversation

@rjzondervan

@rjzondervan rjzondervan commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

Summary

Keepiq is now independently usable: it installs, upgrades and works fully on a Nextcloud with no other Conduction app (Keepiq ADR-006, agreed with Ruben). The integrations that genuinely need another app stay, and appear only when that app is enabled.

  • Own app shell instead of OpenRegister's AppHost. Application no longer calls AppHost\Bootstrap or the autoloader prelude. appinfo/routes.php is one static table on every instance. SettingsSection implements IIconSection directly.
  • Plain Keepiq controllers with the contracts AppHost served:
    • HealthController: public; 503 with error on a database failure, with only the exception class in failed:.
    • MetricsController: admins and delegated General admins; byte-compatible Prometheus output.
    • PreferencesController: same storage key, so existing walkthrough state survives.
  • Dead register import removed:
    • The loader, keepiq_register.json (it declared 0 schemas), MigrateSchemaApplicationId, and settings#load with its re-import button.
    • InitializeSettings now writes config_version itself.
    • A new RemoveLegacyRegisterRows repair step deletes the empty doriath/keepiq register, schema and data table earlier versions left in OpenRegister, only when they hold no object, through IDBConnection only.
  • Frontend:
    • CnAppRoot is mounted with requiresApps: [], so the UI is no longer replaced by "OpenRegister missing".
    • Flows (menu and pages) is gated on OpenRegister.
    • The AI companion is mounted only when Hermiq is enabled.
    • The unused OpenRegister object store is gone.
  • MCP: the scannable-services alias is registered as an inert string alias. It resolves only while OpenRegister runs, which was verified live: exactly the 3 keepiq.* tools.
  • CI and docs:
    • New standalone.yml runs Keepiq alone (smoke check plus the standalone e2e spec).
    • federation, docs-media and mobile-e2e no longer install OpenRegister; ci-seed.sh and the setup scripts no longer import the register.
    • The README documents the health, metrics and preferences endpoints and which optional app adds what.

OpenSpec change: openspec/changes/standalone-app-shell (new app-shell capability; apphost-adoption removed; mcp-metadata-surface modified).

Self-review

A review pass before asking for human review fixed:

  • Cleanup step: another app's register list is kept exactly as stored, rows are deleted before data tables are dropped, a register that still holds objects is kept, and stale configuration entries are removed even after an earlier partial cleanup.
  • Metrics: stays up when the suite count fails; keepiq_info and keepiq_up are still served.
  • Health: a failure to remove the probe file no longer reports the filesystem as failed.
  • Code: one app-presence helper serves the menu gates and the AI companion, and the unused openregisters flag is removed.

Open for discussion: the admin version card now always reads "up to date", because Keepiq imports no configuration any more. It was kept by decision; hiding it is the alternative.

Checks

  • ✅ lint, phpcs, phpmd clean; phpstan 0 errors
  • ✅ PHPUnit unit suite: 1 error, the separate-process route test that cannot bootstrap on a host without a Nextcloud tree (it runs in CI)
  • ✅ eslint 0 errors; vitest 1940 pass (2 failures are on development too: a missing tsconfig, and the integriq status-label test); npm run check:manifest passes
  • ⚠️ psalm 5.26.1 crashes while reading the lock file's Symfony polyfills ($value must be a scalar), on any branch after composer install; not this change
  • ✅ Hydra gates pass in CI (gate-110 flagged the missing <version> bump for the new repair step; fixed)

Test plan

  • Unit: shell controllers, static route table, standalone bootstrap (no OpenRegister/integriq autoload; mutation-checked), legacy-row cleanup over in-memory OpenRegister tables (mutation-checked), admin-area guard matrix with the metrics rows
  • Newman: preferences round-trip and POST /api/settings/load → 404; the health/metrics scenarios point at the app-shell spec
  • Live, dev instance with OpenRegister disabled: Nextcloud pages 200, health 200 ok, metrics 200 for an admin, preferences round-trip, settings/load 404, WASM CSP still sent; in the browser the lock screen and vault load, no Flows entry, a /flows deep link shows the missing-dependency screen, the version card is up to date without re-import
  • Live, cleanup step: 51→49 registers, 191→190 schemas, empty data table dropped, and the two stale Keepiq configuration entries removed; a second run removes nothing
  • Live, occ upgrade to 0.3.4-unstable.20261005160000 runs the new repair step and ends with maintenance off
  • Live, OpenRegister re-enabled: flows API 200; OpenRegister's MCP endpoint lists exactly keepiq.expiryReport, keepiq.listEntries, keepiq.rotationStatus
  • Not yet run: tests/e2e/workflows/standalone-shell.spec.ts (no Playwright runtime locally). Its first run is the new standalone.yml job; selectors were checked against the library markup. The Flows UI with OpenRegister enabled was checked through the API only.

🤖 Generated with Claude Code

rjzondervan and others added 9 commits October 5, 2026 13:28
OpenSpec change standalone-app-shell: Keepiq's own app shell instead of
OpenRegister's AppHost (plain health, metrics and preferences
controllers, a static route table, a native admin section), removal of
the dead register import, and presence gating for the integrations that
need another app (MCP and Flows on OpenRegister, Integrations on
integriq, the AI companion on Hermiq). A Keepiq ADR-006 records the
exception to hydra ADR-040/022, agreed with Ruben on 2026-10-05.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…Host

Keepiq no longer calls OpenRegister's AppHost Bootstrap or Routes and
references no OpenRegister class at boot (ADR-006):

- Application drops the AppHost wiring and the OpenRegisterAutoloader
  prelude; the registrars keep their bindings.
- appinfo/routes.php is one static table on every instance, with
  Keepiq's own health, metrics and preferences routes. settings#load
  and the store routes are gone.
- HealthController (public, 503 on a database failure, only exception
  class names in `failed:`), MetricsController (admin and delegated
  General admins, output byte-compatible with the AppHost engine) and
  PreferencesController (same contract and storage key as AppHost).
- SettingsSection implements IIconSection directly.
- The empty OpenRegister register import is removed with its loader,
  register JSON and MigrateSchemaApplicationId. InitializeSettings now
  writes config_version itself. RemoveLegacyRegisterRows deletes the
  empty doriath/keepiq register, schema and data table it left behind,
  only when they hold no object, through IDBConnection only.
- The MCP scannable-services alias is registered as an inert string
  alias; it only resolves while OpenRegister runs.

Tests for the AppHost-era routes and prelude are rewritten in the test
task group of this change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- CnAppRoot is mounted with requiresApps [] so the shell never replaces
  Keepiq's UI with an "OpenRegister missing" screen.
- The AI companion is mounted only when Hermiq is enabled for the user,
  so the shell sends no health probe to /apps/hermiq/ without it.
- The Flows menu entry needs OpenRegister (visibleIf.appInstalled), and
  the Flows and FlowDetail pages show the missing-dependency screen on a
  deep link without it (requiresApp).
- The admin version card hides the re-import action; Keepiq imports no
  configuration.
- The unused OpenRegister object store and its configuration are gone,
  and the manifest's AppHost observability block with them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- AppShellControllersTest: health (ok, degraded, 503 without leaking the
  exception message), metrics (series, active-only count, content type),
  preferences (round-trip under the AppHost storage key, per user, empty
  PUT deletes, invalid key 400, 401 without a session) and the section.
- StaticRouteTableTest replaces RoutesWithoutOpenRegisterTest and
  CanonicalRouteMethodContractTest: one table, every route on a public
  Keepiq method, catch-all last, identical with an AppHost class present.
- StandaloneBootstrapTest: register() autoloads no OpenRegister or
  integriq class, every registrar runs, the MCP alias is registered.
  Mutation-checked.
- RemoveLegacyRegisterRowsTest over in-memory OpenRegister tables,
  mutation-checked (ignoring objects, selecting by slug).
- AdminAreaGuardTest: the removed load() row becomes metrics rows.
- Newman: preferences round-trip and a 404 for POST settings/load; the
  health and metrics scenarios point at the app-shell spec.
- e2e standalone-shell.spec.ts: both instance shapes, each half skipped
  with a reason when the instance cannot prove it.
- Deleted: OpenRegisterAutoloaderTest, ManifestObservabilityTest and the
  AppHost psalm/test stubs. A Doctrine ExpressionBuilder constants stub
  lets unit tests double OCP's query builder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…onal

- standalone.yml: one Nextcloud with Keepiq alone (no OpenRegister,
  integriq or Hermiq). Smoke check (the other apps are not enabled, the
  login page and health answer 200, metrics answers an admin) and the
  standalone half of the standalone-shell e2e spec.
- federation, docs-media and mobile-e2e no longer install OpenRegister:
  none of them needs Flows or MCP. The capture and federation setup
  scripts take the OpenRegister directory as an optional argument.
- ci-seed.sh and both setup scripts no longer import the deleted
  register JSON into OpenRegister.
- code-quality keeps installing OpenRegister and integriq, now to cover
  the integrations that need them.
- README: OpenRegister and integriq are optional, with what each adds.
  The dev compose stack enables OpenRegister only when it is mounted.
  openspec/config.yaml and info.xml comments follow ADR-006.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…@; phpstan stubs

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
6.2 with OpenRegister disabled: Nextcloud pages 200, health 200 ok,
metrics 200 for an admin, preferences round-trip, settings/load 404,
WASM CSP still sent; the UI checks were done in the browser. The
cleanup step removed the doriath/keepiq registers, the example schema
and its empty data table (51->49 registers, 191->190 schemas), and a
second run removed nothing.
6.3 with OpenRegister enabled: the flows API answers 200 and the MCP
endpoint lists exactly keepiq.expiryReport, listEntries, rotationStatus.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The README now lists Keepiq's own monitoring and preferences endpoints
with their callers and responses, and the demo-environment page says
OpenRegister is required by the demo suite, not by Keepiq.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/keepiq @ a8bebb2

Check PHP Vue Security License Tests
lint ✅
phpcs ✅
phpmd ✅
psalm ✅
phpstan ✅
phpmetrics ✅
eslint ✅
stylelint ✅
build ✅
check-manifest ✅
test-l10n ✅
format ❌
check-l10n-js ✅
check-schema-l10n ✅
composer ✅ ✅ 114/114
npm ✅ ✅ 660/660
app:check-code ⏭️
info.xml ✅
REUSE ✅
lockfile sync ✅
PHPUnit ❌
Newman ❌
Playwright ⏭️ deferred: E2E runs locally and on the promotion path only. This pull request targets development, so the suite is asked once per promotion into beta and main rather than once per push per open pull request. Run it locally with npx playwright test, or from the Actions tab on a branch with no open pull request into development.
Hydra gates ❌

Quality workflow — 2026-10-05 14:48 UTC

Download the full PDF report from the workflow artifacts.

- appinfo/info.xml <version> moves to 0.3.4-unstable.20261005160000.
  Without it `occ upgrade` answers "No upgrade required" and the new
  RemoveLegacyRegisterRows repair step never runs on existing instances
  (hydra gate-110).
- StaticRouteTableTest no longer assumes OpenRegister is absent: CI
  installs it. The table test now holds on either instance shape.
- Prettier formatting for App.vue, standalone-shell.spec.ts and
  navEntries.spec.js.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/keepiq @ 24b3612

Check PHP Vue Security License Tests
lint ✅
phpcs ✅
phpmd ✅
psalm ✅
phpstan ✅
phpmetrics ✅
eslint ✅
stylelint ✅
build ✅
check-manifest ✅
test-l10n ✅
format ✅
check-l10n-js ✅
check-schema-l10n ✅
composer ✅ ✅ 114/114
npm ✅ ✅ 660/660
app:check-code ⏭️
info.xml ✅
REUSE ✅
lockfile sync ✅
PHPUnit ❌
Newman ❌
Playwright ⏭️ deferred: E2E runs locally and on the promotion path only. This pull request targets development, so the suite is asked once per promotion into beta and main rather than once per push per open pull request. Run it locally with npx playwright test, or from the Actions tab on a branch with no open pull request into development.
Hydra gates ✅

Quality workflow — 2026-10-05 17:38 UTC

Download the full PDF report from the workflow artifacts.

Legacy-row cleanup (RemoveLegacyRegisterRows):
- Another app's register that lists a removed schema loses only that
  entry; every other entry is kept exactly as stored (no intval rewrite).
- Rows are deleted first and empty data tables dropped last, so a
  failure partway never leaves a schema pointing at a dropped table.
- A keepiq/doriath register is kept while objects are stored under it.
- Keepiq's openregister_configurations entries are removed once nothing
  they list still exists, also on an instance an earlier run already
  cleaned up (verified on the dev instance: configurations 9 and 14).

Shell:
- Metrics keeps serving keepiq_info and keepiq_up when the suite count
  fails, as the AppHost engine did; the series is left out and logged.
- Health no longer reports a failed filesystem when only removing the
  probe file fails.
- One isAppEnabled/currentAppsWebRoots helper in navEntries.js decides
  app presence for the menu gates and the AI companion.
- The unused `openregisters` settings flag, its store field and the
  IAppManager it needed are removed.
- docker-compose.yml says what the unconditional ../openregister mount
  really does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/keepiq @ 79806c8

Check PHP Vue Security License Tests
lint ✅
phpcs ✅
phpmd ✅
psalm ✅
phpstan ✅
phpmetrics ✅
eslint ✅
stylelint ✅
build ✅
check-manifest ✅
test-l10n ✅
format ✅
check-l10n-js ✅
check-schema-l10n ✅
composer ✅ ✅ 114/114
npm ✅ ✅ 660/660
app:check-code ⏭️
info.xml ✅
REUSE ✅
lockfile sync ✅
PHPUnit ❌
Newman ❌
Playwright ⏭️ deferred: E2E runs locally and on the promotion path only. This pull request targets development, so the suite is asked once per promotion into beta and main rather than once per push per open pull request. Run it locally with npx playwright test, or from the Actions tab on a branch with no open pull request into development.
Hydra gates ✅

Quality workflow — 2026-10-05 18:01 UTC

Download the full PDF report from the workflow artifacts.

Comment thread lib/Repair/RemoveLegacyRegisterRows.php Resolved
Comment thread lib/Repair/RemoveLegacyRegisterRows.php Resolved
Comment thread lib/Repair/RemoveLegacyRegisterRows.php Resolved
Comment thread lib/Repair/RemoveLegacyRegisterRows.php Resolved
Comment thread lib/Repair/RemoveLegacyRegisterRows.php Resolved
Comment thread lib/Repair/RemoveLegacyRegisterRows.php Resolved
Comment thread lib/Controller/HealthController.php Resolved
Comment thread lib/Controller/MetricsController.php Resolved
@rjzondervan

Copy link
Copy Markdown
Member Author

🟢 Minor: the PR body leaves out part of what the repair step deletes

The summary says RemoveLegacyRegisterRows deletes "register, schema and data table". Since 012d96c it also deletes openregister_configurations rows keyed to keepiq/doriath (removeConfigurations()). Please add that to the summary so reviewers and release notes cover it.

@rjzondervan rjzondervan left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Strict review at 012d96c: would be REQUEST_CHANGES (posted as COMMENT because this is a self-review).

The cleanup repair step can delete OpenRegister data it shouldn't. There are 3 blockers: the emptiness check only sees tables that the register still lists (F1), the register guard counts only openregister_objects (F2), and registers are matched by slug alone (F3). There are also 3 concerns: no transaction (F4), no audit trail (F5), and the tests don't cover these paths (F6). The controllers, routes, frontend and CI changes look clean. CI failures were left to a separate check.

Blockers from the PR review, each verified in OpenRegister's source:
- Data tables are found by their physical name in the database catalogue
  (as OpenRegister's SchemaDeletionService does), not from a register's
  schemas list, which can lose entries. When the catalogue cannot be
  read, nothing is removed.
- Emptiness counts every data table of a schema or register, plus the
  legacy openregister_objects table only while it still exists
  (OpenRegister drops it after its blob migration).
- Registers are selected by `application`, never by slug: OpenRegister's
  key is (organisation, application, slug). A register without an
  application is never deleted.

Concerns and minors:
- All row changes run in one transaction with rollback; empty tables
  are dropped after the commit, each after a final row count.
- Every removal is logged first with table, id, slug, application and
  the counts that justified it.
- The planning moved into a read-only LegacyRegisterPlanner (phpmd
  class complexity); the step applies the plan.
- Tests cover a lost register link, a Keepiq register with populated
  tables, another app's keepiq-slug register, a failure followed by a
  converging run, and a row written before the drop. Mutation-checked.
- Health checks the temp directory without writing a file; preference
  values are capped at 4 KB; the README recommends a dedicated,
  General-area-delegated account for Prometheus.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/keepiq @ 879f244

Check PHP Vue Security License Tests
lint ✅
phpcs ✅
phpmd ✅
psalm ✅
phpstan ✅
phpmetrics ✅
eslint ✅
stylelint ✅
build ✅
check-manifest ✅
test-l10n ✅
format ✅
check-l10n-js ✅
check-schema-l10n ✅
composer ✅ ✅ 114/114
npm ✅ ✅ 660/660
app:check-code ⏭️
info.xml ✅
REUSE ✅
lockfile sync ✅
PHPUnit ❌
Newman ❌
Playwright ⏭️ deferred: E2E runs locally and on the promotion path only. This pull request targets development, so the suite is asked once per promotion into beta and main rather than once per push per open pull request. Run it locally with npx playwright test, or from the Actions tab on a branch with no open pull request into development.
Hydra gates ✅

Quality workflow — 2026-10-05 19:18 UTC

Download the full PDF report from the workflow artifacts.

@rjzondervan rjzondervan left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Strict re-review at e294c0e: would now be APPROVE (posted as COMMENT because this is a self-review).

All 3 blockers, 3 concerns and 5 minors from the previous review are fixed and verified, and the PR body now covers the configuration deletes. The 15 repair tests pass locally, and the F1, F3 and F4 fixes are mutation-checked. Each mutant fails exactly the test that guards it. No new findings. The remaining open item is the failing CI (PHPUnit stable35 pgsql, Newman, build-and-load), which is being handled separately.

- AdminAreaSettingsTest::testInfoXmlRegistersEveryArea read info.xml
  with simplexml_load_file(). Under the Nextcloud bootstrap in CI,
  lib/base.php blocks libxml's external entity loader, which
  simplexml_load_file() also uses to open the file, so it got false and
  failed on iterator_to_array(null). It now parses the file contents,
  as NextcloudFloorMatrixTest and ConnectionsDeclarationTest already do.
- admin-api.postman_collection.json declared only its auditor variables,
  so all 23 requests went to the literal `{{baseUrl}}` (getaddrinfo
  ENOTFOUND). It now declares baseUrl, noAuthBase, adminUser and
  adminPass with the same values as the other two collections.

Both failures predate this branch (#1173 shows the same).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/keepiq @ 477f827

Check PHP Vue Security License Tests
lint ✅
phpcs ✅
phpmd ✅
psalm ✅
phpstan ✅
phpmetrics ✅
eslint ✅
stylelint ✅
build ✅
check-manifest ✅
test-l10n ✅
format ✅
check-l10n-js ✅
check-schema-l10n ✅
composer ✅ ✅ 114/114
npm ✅ ✅ 660/660
app:check-code ⏭️
info.xml ✅
REUSE ✅
lockfile sync ✅
PHPUnit ❌
Newman ✅
Playwright ⏭️ deferred: E2E runs locally and on the promotion path only. This pull request targets development, so the suite is asked once per promotion into beta and main rather than once per push per open pull request. Run it locally with npx playwright test, or from the Actions tab on a branch with no open pull request into development.
Hydra gates ✅

Quality workflow — 2026-10-06 07:17 UTC

Download the full PDF report from the workflow artifacts.

phpunit.xml sets beStrictAboutCoverageMetadata and failOnRisky, so a
test that runs a class its @Covers does not declare is risky, and a
risky test fails the run. Ten tests did (the same ten on development),
which was hidden while AdminAreaSettingsTest errored first:

- ExtensionControllerTest uses AdminSettingsService and
  PasswordPolicyService.
- SettingsControllerConnectionRefreshTest uses AdminAreaSettingsController.
- SiemConnectionReportCallersTest uses Siem\SinkConnectorSettings.

Each @uses names exactly the classes CI reported for that test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/keepiq @ f314c58

Check PHP Vue Security License Tests
lint ✅
phpcs ✅
phpmd ✅
psalm ✅
phpstan ✅
phpmetrics ✅
eslint ✅
stylelint ✅
build ✅
check-manifest ✅
test-l10n ✅
format ✅
check-l10n-js ✅
check-schema-l10n ✅
composer ✅ ✅ 114/114
npm ✅ ✅ 660/660
app:check-code ⏭️
info.xml ✅
REUSE ✅
lockfile sync ✅
PHPUnit ✅
Newman ✅
Playwright ⏭️ deferred: E2E runs locally and on the promotion path only. This pull request targets development, so the suite is asked once per promotion into beta and main rather than once per push per open pull request. Run it locally with npx playwright test, or from the Actions tab on a branch with no open pull request into development.
Hydra gates ✅

Quality workflow — 2026-10-06 07:28 UTC

Download the full PDF report from the workflow artifacts.

@rjzondervan
rjzondervan merged commit 4f942f7 into development Oct 6, 2026
56 of 57 checks passed
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