Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions src/fixtures/codex-role-agent-allowlist.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
[
{
"name": "genie-engineer-complex.toml",
"type": "regular",
"mode": "0644",
"digest": "62ecc570f1d77783511a9e7f0aa67b3a65d8bba292963409a02c7712c93ebc3b"
},
{
"name": "genie-engineer-standard.toml",
"type": "regular",
"mode": "0644",
"digest": "dc746813b9b4b6aa984c17fa2fd75d4dbe34eba08494a174c0715da07aa9dd30"
},
{
"name": "genie-engineer-trivial.toml",
"type": "regular",
"mode": "0644",
"digest": "249deced5a02eb2cbe3303db566992d1336c75d853967f851bf1d0e85b6b0f47"
},
{
"name": "genie-final-gate.toml",
"type": "regular",
"mode": "0644",
"digest": "10ef070db8aace75bd80ef9e060a6ec601e3768f177fdd843f4db11035738f7e"
},
{
"name": "genie-fixer.toml",
"type": "regular",
"mode": "0644",
"digest": "b3c1f407d4a3a2cfe204dee7b4a9c038e1a8f4644c446fcfa23f4a681bf0c7b3"
},
{
"name": "genie-reviewer.toml",
"type": "regular",
"mode": "0644",
"digest": "55bb2dea3da381f4d6ea210869f9a26ac1eed825097085a9bfa0f41a005c8d14"
},
{
"name": "genie-reviewer.toml",
"type": "regular",
"mode": "0644",
"digest": "91f40a07905834716311419375581e3245544a77eac3d93d082842652c6452bf"
},
{
"name": "genie-reviewer.toml",
"type": "regular",
"mode": "0644",
"digest": "c7008dcaa1e31b46e2bb05ca13afb2e918ee483422c84386a1c8997485bcfea7"
},
{
"name": "genie-reviewer.toml",
"type": "regular",
"mode": "0644",
"digest": "f0bf69fa70dc9e014305f155a024c4dadb6caf48ce217b8c31119506e244f844"
},
{
"name": "genie-scout.toml",
"type": "regular",
"mode": "0644",
"digest": "03a9fb3ca0e5f36c69c8f934d37adce1bae736e4c3895b144a0001ad31b1ba59"
}
]
37 changes: 28 additions & 9 deletions src/genie-commands/doctor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ import { hasDuplicateSkillsExternalDirsKeys, resolveProductSkillsRoot } from '..
import { resolveOmniRuntimeConfig } from '../lib/omni-config.js';
import {
CANONICAL_GENIE_SKILL_NAMES,
type CodexAgentDisplayState,
inspectCodexAgentOwnership,
inspectCodexFallbackTier,
} from '../lib/runtime-integrations.js';
Expand Down Expand Up @@ -400,20 +401,38 @@ function codexPluginCheck(state: CodexPluginProbe): CheckResult {

function codexAgentCheck(): CheckResult {
const report = inspectCodexAgentOwnership(resolveCodexDir());
const total = report.expectedDeliveredTotal;
const count = (state: CodexAgentDisplayState): number =>
report.entries.filter((entry) => entry.state === state).length;
const counts = {
clean: report.entries.filter((entry) => entry.ownership === 'managed-clean').length,
modified: report.entries.filter((entry) => entry.ownership === 'managed-modified').length,
user: report.entries.filter((entry) => entry.ownership === 'user-owned').length,
absent: report.entries.filter((entry) => entry.ownership === 'absent').length,
managed: count('managed'),
stale: count('stale'),
adoptable: count('adoptable-historical'),
collision: count('collision'),
personal: count('personal'),
absent: count('absent'),
};
const healthy = report.status === 'valid' && counts.clean === 7 && counts.modified === 0 && counts.absent === 0;
// Personal files are the operator's own unrelated agents — present is healthy.
// Every other non-managed state (stale/adoptable/collision/absent) is actionable.
const healthy =
report.status === 'valid' &&
counts.managed === total &&
counts.stale === 0 &&
counts.adoptable === 0 &&
counts.collision === 0 &&
counts.absent === 0;
const suggestion =
counts.adoptable > 0 || counts.stale > 0 || counts.managed < total
? 'Run `genie setup --codex` to adopt and refresh delivered role agents; personal and collision files are never overwritten.'
: 'Review collision role agents (modified/symlinked/lookalike); Genie will not overwrite them, then run `genie setup --codex`.';
Comment on lines +425 to +427

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 Point doctor at a converging command

This warning fires for stale/adoptable role agents, but the suggested genie setup --codex command does not run role-agent convergence: setup.ts explicitly says role-agent delivery is done by update/install and configureCodex only activates the plugin, reconciles project MCP, and persists consent. Users who follow this advice can return to the same warning until they run a path that invokes installCodexAgents, so the doctor should suggest such a command or setup should perform the convergence.

Useful? React with 👍 / 👎.

return {
name: 'Codex Genie role agents',
status: healthy ? 'pass' : 'warn',
detail: `inventory ${report.status}; clean=${counts.clean}/7, modified=${counts.modified}, user-owned=${counts.user}, absent=${counts.absent}${report.error ? ` (${report.error})` : ''}`,
suggestion: healthy
? undefined
: 'Review modified/user-owned collisions, then run `genie setup --codex`; Genie will not overwrite them.',
detail:
`inventory ${report.status}; managed=${counts.managed}/${total}, stale=${counts.stale}, ` +
`adoptable=${counts.adoptable}, collision=${counts.collision}, personal=${counts.personal}, absent=${counts.absent}; ` +
`reviewer digest ${report.reviewerDigest.slice(0, 12)}${report.error ? ` (${report.error})` : ''}`,
suggestion: healthy ? undefined : suggestion,
};
}

Expand Down
3 changes: 3 additions & 0 deletions src/genie-commands/uninstall.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2068,6 +2068,7 @@ describe('durable runtime integration allowlist', () => {
name: 'genie-later.toml',
path: '/tmp/genie-later.toml',
ownership: 'managed-clean',
state: 'managed',
},
],
},
Expand Down Expand Up @@ -2162,6 +2163,8 @@ describe('uninstall ownership and work detection', () => {
inventoryPath: join(root, 'inventory.json'),
status: 'missing' as const,
entries: [],
expectedDeliveredTotal: 7,
reviewerDigest: 'c7008dcaa1e31b46e2bb05ca13afb2e918ee483422c84386a1c8997485bcfea7',
}),
inspectRuntimeClientAvailability: () => ({
codex: false,
Expand Down
Loading
Loading