7f841fae7f
feat(maintain): safe maintenance automation + shared orphan-exclusion policy ( #3015 ) ( #3023 )
...
Ports #3015 by @jdewoski-cmd onto current master:
- src/core/orphan-policy.ts centralizes the orphan-reporting exclusion
convention so `gbrain orphans`, doctor's orphan_ratio, and both engines'
getHealth orphan_pages can no longer drift.
- getHealth stale_pages now uses the link-extractor stale watermark
(countStalePagesForExtraction) so health agrees with what `gbrain extract
--stale` will actually process.
- New `gbrain maintain` command: dry-run by default, `--safe` applies only
the conservative runbook actions (DB-backed stale extraction + source-scoped
dream cycles for doctor cycle_freshness findings), `--json` for structured
before/action/after reports. Frontmatter mutations, schema-pack upgrades,
and semantic hub links stay review-only by design.
Changed from the original PR: the shared defaults carried slugs specific to
the contributor's own brain ('josa-secrets/', '*-ga4-property-id.md',
'*-josa-test', literal 'welcome'/'untitled' fixtures). Global defaults now
carry only GBrain-wide conventions; brain-specific exclusions move to a new
per-brain config plane the policy reads through loadOrphanPolicyOverrides:
gbrain config set orphans.exclude_prefixes "my-private-folder/,archive/"
gbrain config set orphans.exclude_slugs "some-one-off-page"
Both engines' getHealth and the orphans command thread the overrides;
tests cover the neutral defaults, the override plane, and health parity.
Also registered `maintain` in CLI_ONLY_SELF_HELP so `gbrain maintain --help`
reaches the command's own usage block.
Co-authored-by: Garry Tan <garrytan@gmail.com >
Co-authored-by: jdewoski-cmd <jdewoski@gmail.com >
Co-authored-by: Claude Fable 5 <noreply@anthropic.com >
2026-07-21 19:52:18 -07:00
..
2026-07-02 10:48:54 -07:00
2026-07-21 13:06:32 -07:00
2026-05-22 13:38:07 -07:00
2026-06-03 07:27:34 -07:00
2026-05-24 21:50:08 -07:00
2026-06-10 22:00:36 -07:00
2026-06-01 22:13:19 -07:00
2026-07-16 21:20:12 -07:00
2026-07-17 15:01:27 -07:00
2026-06-24 06:05:16 -07:00
2026-04-29 23:46:36 -07:00
2026-06-24 06:05:16 -07:00
2026-07-02 10:48:54 -07:00
2026-07-20 16:57:53 -07:00
2026-06-03 23:00:11 -07:00
2026-07-21 13:40:41 -07:00
2026-05-22 11:53:11 -07:00
2026-05-22 13:38:07 -07:00
2026-06-01 22:13:19 -07:00
2026-06-07 19:22:33 -07:00
2026-07-13 00:09:04 -07:00
2026-06-03 07:09:20 -07:00
2026-06-24 06:05:16 -07:00
2026-05-10 06:34:40 -07:00
2026-05-27 08:27:05 -07:00
2026-07-17 14:25:48 -07:00
2026-05-24 22:56:21 -07:00
2026-07-20 16:38:03 -07:00
2026-06-24 06:05:16 -07:00
2026-05-11 19:25:48 -07:00
2026-05-26 17:31:48 -07:00
2026-05-26 18:59:17 -07:00
2026-05-17 08:00:29 -07:00
2026-07-02 10:48:54 -07:00
2026-07-20 11:57:31 -07:00
2026-05-20 13:55:12 -07:00
2026-07-21 12:29:35 -07:00
2026-06-16 22:45:22 -07:00
2026-04-22 01:34:22 -07:00
2026-07-16 19:52:52 -07:00
2026-07-21 13:06:32 -07:00
2026-06-07 08:12:50 -07:00
2026-06-03 23:00:11 -07:00
2026-05-02 08:41:11 -07:00
2026-05-22 22:16:25 -07:00
2026-05-20 13:55:12 -07:00
2026-05-23 10:01:08 -07:00
2026-05-23 08:49:28 -07:00
2026-05-22 11:53:11 -07:00
2026-05-26 23:15:44 -07:00
2026-05-09 20:46:34 -07:00
2026-05-19 17:14:53 -07:00
2026-06-12 07:28:13 -07:00
2026-04-14 19:41:34 -10:00
2026-06-10 22:00:36 -07:00
2026-06-03 06:20:03 -07:00
2026-05-23 08:49:28 -07:00
2026-07-20 15:39:04 -07:00
2026-07-02 08:00:58 -07:00
2026-06-03 23:00:11 -07:00
2026-07-20 11:08:41 -07:00
2026-05-25 14:56:38 -07:00
2026-05-25 20:00:03 -07:00
2026-05-11 22:54:35 -07:00
2026-07-20 13:00:16 -07:00
2026-05-23 10:01:08 -07:00
2026-05-10 18:59:11 -07:00
2026-06-03 06:43:11 -07:00
2026-07-17 15:01:27 -07:00
2026-06-01 19:09:15 -07:00
2026-05-08 13:25:48 -07:00
2026-06-09 22:28:44 -07:00
2026-05-23 10:57:32 -07:00
2026-05-24 10:49:56 -07:00
2026-06-08 21:19:25 -07:00
2026-06-14 09:32:58 -07:00
2026-05-23 08:49:28 -07:00
2026-07-21 16:50:43 -07:00
2026-07-21 12:29:35 -07:00
2026-04-14 19:41:34 -10:00
2026-06-21 06:36:43 -07:00
2026-06-17 06:58:07 -07:00
2026-06-09 22:28:44 -07:00
2026-05-03 20:41:39 -07:00
2026-04-29 22:21:07 -07:00
2026-07-02 10:48:54 -07:00
2026-06-03 07:27:34 -07:00
2026-05-25 14:56:38 -07:00
2026-05-20 13:55:12 -07:00
2026-05-07 21:52:58 -07:00
2026-06-17 06:58:07 -07:00
2026-06-16 15:08:47 -07:00
2026-07-10 10:05:23 +09:00
2026-05-24 10:49:56 -07:00
2026-07-20 22:14:46 -07:00
2026-05-23 08:49:28 -07:00
2026-07-21 00:17:26 -07:00
2026-07-20 13:42:41 -07:00
2026-06-16 15:08:47 -07:00
2026-05-27 08:50:53 -07:00
2026-04-11 00:01:09 -10:00
2026-07-20 11:57:31 -07:00
2026-05-11 19:25:48 -07:00
2026-04-25 12:25:34 -07:00
2026-05-14 19:13:14 -07:00
2026-05-01 09:02:43 -07:00
2026-06-03 08:42:25 -07:00
2026-05-26 18:59:17 -07:00
2026-07-20 15:05:32 -07:00
2026-06-12 06:05:34 -07:00
2026-05-30 11:21:56 -07:00
2026-04-29 23:46:36 -07:00
2026-05-23 10:21:59 -07:00
2026-07-13 00:09:16 -07:00
2026-04-22 01:34:22 -07:00
2026-05-20 13:55:12 -07:00
2026-04-29 23:46:36 -07:00
2026-05-21 09:26:37 -07:00
2026-07-17 15:23:47 -07:00
2026-05-30 10:56:46 -07:00
2026-07-20 16:28:53 -07:00
2026-07-17 11:32:48 -07:00
2026-05-30 12:34:43 -07:00
2026-07-17 14:17:37 -07:00
2026-07-21 16:50:43 -07:00
2026-04-05 12:48:10 -07:00
2026-07-10 10:05:23 +09:00
2026-06-03 08:42:25 -07:00
2026-06-12 06:05:34 -07:00
2026-05-21 18:57:05 -07:00
2026-07-21 18:45:23 -07:00
2026-07-17 11:39:15 -07:00
2026-05-09 19:47:56 -07:00
2026-07-20 16:19:40 -07:00
2026-05-26 18:59:17 -07:00
2026-05-27 07:16:30 -07:00
2026-06-01 21:54:13 -07:00
2026-07-16 19:52:52 -07:00
2026-05-25 20:00:03 -07:00
2026-05-10 13:33:05 -07:00
2026-07-17 11:32:06 -07:00
2026-06-24 06:05:16 -07:00
2026-05-30 13:11:25 -07:00
2026-07-17 14:25:48 -07:00
2026-07-21 19:52:18 -07:00
2026-06-17 06:58:07 -07:00
2026-05-06 21:14:34 -07:00
2026-07-21 16:50:43 -07:00
2026-05-23 10:21:59 -07:00
2026-07-02 08:00:58 -07:00
2026-07-21 19:52:18 -07:00
2026-07-06 02:38:37 -07:00
2026-07-20 15:51:16 -07:00
2026-05-26 17:31:48 -07:00
2026-07-21 19:52:18 -07:00
2026-05-09 20:46:34 -07:00
2026-05-25 14:43:12 -07:00
2026-06-03 08:00:57 -07:00
2026-05-23 10:57:32 -07:00
2026-06-01 23:03:09 -07:00
2026-05-11 23:20:17 -07:00
2026-05-22 11:53:11 -07:00
2026-05-23 08:49:28 -07:00
2026-05-07 22:56:22 -07:00
2026-07-02 08:00:58 -07:00
2026-05-23 10:01:08 -07:00
2026-05-10 13:20:07 -07:00
2026-05-25 19:43:20 -07:00
2026-05-25 15:10:23 -07:00
2026-06-08 06:16:34 -07:00
2026-06-07 08:05:34 -07:00
2026-05-25 12:48:55 -07:00
2026-07-20 15:51:16 -07:00
2026-05-22 13:38:07 -07:00
2026-04-27 22:59:08 -07:00
2026-05-22 21:18:09 -07:00
2026-06-03 06:20:03 -07:00
2026-06-03 06:20:03 -07:00
2026-05-20 13:55:12 -07:00
2026-06-08 21:19:25 -07:00
2026-05-20 13:55:12 -07:00
2026-05-20 13:55:12 -07:00
2026-04-23 19:34:27 -07:00
2026-05-25 20:00:03 -07:00
2026-05-14 20:51:11 -07:00
2026-05-23 10:21:59 -07:00
2026-06-03 07:47:21 -07:00
2026-05-22 21:04:30 -07:00
2026-07-02 08:00:58 -07:00
2026-05-30 10:56:46 -07:00
2026-07-20 16:28:53 -07:00
2026-05-19 17:14:53 -07:00
2026-06-16 15:08:47 -07:00
2026-06-24 06:05:16 -07:00
2026-05-19 17:14:53 -07:00
2026-04-29 22:21:07 -07:00
2026-04-09 10:17:13 -07:00
2026-05-08 13:25:48 -07:00
2026-06-03 07:47:21 -07:00
2026-06-16 15:08:47 -07:00
2026-06-07 19:22:33 -07:00
2026-07-17 15:43:09 -07:00
2026-05-30 11:21:56 -07:00
2026-05-20 09:19:18 -07:00
2026-06-10 22:00:36 -07:00
2026-05-10 18:59:11 -07:00
2026-06-12 06:05:34 -07:00
2026-05-25 14:43:12 -07:00
2026-05-23 10:21:59 -07:00
2026-05-22 22:37:15 -07:00
2026-05-17 18:52:38 -07:00
2026-07-02 08:00:58 -07:00
2026-05-07 21:52:58 -07:00
2026-07-20 22:14:46 -07:00
2026-05-08 13:25:48 -07:00
2026-05-08 13:25:48 -07:00
2026-05-06 21:14:34 -07:00
2026-07-20 22:14:46 -07:00
2026-05-08 13:25:48 -07:00
2026-05-26 18:29:03 -07:00
2026-07-17 14:41:25 -07:00
2026-04-09 10:17:13 -07:00
2026-05-06 11:54:06 -07:00