@basou/core 0.26.0 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +220 -15
- package/dist/index.js +58 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/schemas/manifest.schema.json +7 -0
package/dist/index.d.ts
CHANGED
|
@@ -132,6 +132,10 @@ declare const ManifestSchema: z.ZodObject<{
|
|
|
132
132
|
"en+ja": "en+ja";
|
|
133
133
|
}>>;
|
|
134
134
|
}, z.core.$loose>>>;
|
|
135
|
+
instructions: z.ZodOptional<z.ZodEnum<{
|
|
136
|
+
hub: "hub";
|
|
137
|
+
self: "self";
|
|
138
|
+
}>>;
|
|
135
139
|
}, z.core.$loose>>>;
|
|
136
140
|
}, z.core.$loose>;
|
|
137
141
|
/** Inferred runtime type for {@link ManifestSchema}. */
|
|
@@ -3612,6 +3616,15 @@ type RepoVisibility = "public" | "private" | "future-public";
|
|
|
3612
3616
|
type RepoLanguage = "en" | "ja" | "en+ja";
|
|
3613
3617
|
/** A published surface a repo emits: a deployed website or a package registry. */
|
|
3614
3618
|
type PublishKind = "web" | "npm";
|
|
3619
|
+
/**
|
|
3620
|
+
* Where a repo's agent instruction files live (the instruction-source axis),
|
|
3621
|
+
* independent of visibility / language / publishes. `hub` is basou's native,
|
|
3622
|
+
* generated hub-and-spoke topology (canonical in the anchor, gitignored symlinks
|
|
3623
|
+
* in each repo); `self` is the additive opt-in where the canonical AGENTS.md is a
|
|
3624
|
+
* regular committed file in the repo itself and basou stays hands-off about its
|
|
3625
|
+
* content. See {@link instructionMode} for the default (absent => `hub`).
|
|
3626
|
+
*/
|
|
3627
|
+
type RepoInstructions = "hub" | "self";
|
|
3615
3628
|
/**
|
|
3616
3629
|
* One published surface. Its visibility and language are INDEPENDENT of the
|
|
3617
3630
|
* source repo's: a private repo commonly publishes a public website. Both are
|
|
@@ -3632,7 +3645,24 @@ type RepoEntry = {
|
|
|
3632
3645
|
language?: RepoLanguage | undefined;
|
|
3633
3646
|
/** Published surfaces this repo emits (opt-in; absent for a repo that publishes nothing). */
|
|
3634
3647
|
publishes?: PublishTarget[] | undefined;
|
|
3648
|
+
/**
|
|
3649
|
+
* Instruction-source mode. Absent => `hub` (basou's native generated topology),
|
|
3650
|
+
* so an existing roster's behavior is unchanged. `self` opts the repo out of
|
|
3651
|
+
* generation: its AGENTS.md is a hand-authored committed file and basou stays
|
|
3652
|
+
* hands-off. Resolve the effective mode with {@link instructionMode}.
|
|
3653
|
+
*/
|
|
3654
|
+
instructions?: RepoInstructions | undefined;
|
|
3635
3655
|
};
|
|
3656
|
+
/**
|
|
3657
|
+
* The effective instruction-source mode for a repo: the declared `instructions`,
|
|
3658
|
+
* defaulting to `hub` when absent. The default is the single guarantee that an
|
|
3659
|
+
* existing roster (which has no `instructions` field) keeps basou's current
|
|
3660
|
+
* hub-and-spoke behavior byte-for-byte — every generator branches on this, never
|
|
3661
|
+
* on the raw optional field, so "absent => hub" is decided in exactly one place.
|
|
3662
|
+
*/
|
|
3663
|
+
declare function instructionMode(entry: {
|
|
3664
|
+
instructions?: RepoInstructions | undefined;
|
|
3665
|
+
}): RepoInstructions;
|
|
3636
3666
|
type RosterDriftSummary = {
|
|
3637
3667
|
declaredCount: number;
|
|
3638
3668
|
capturedCount: number;
|
|
@@ -3815,6 +3845,13 @@ type RepoGitignoreFacts = {
|
|
|
3815
3845
|
path: string;
|
|
3816
3846
|
/** Declared visibility; undefined when the operator has not set it yet. */
|
|
3817
3847
|
visibility?: RepoVisibility | undefined;
|
|
3848
|
+
/**
|
|
3849
|
+
* True when this repo declares `instructions: self`: its instruction files are
|
|
3850
|
+
* committed and SHARED, so they must NOT be gitignored — the repo is skipped
|
|
3851
|
+
* (reported as `self`, never an addition) regardless of visibility. Absent =>
|
|
3852
|
+
* the default `hub` behavior, unchanged.
|
|
3853
|
+
*/
|
|
3854
|
+
self?: boolean | undefined;
|
|
3818
3855
|
/** False when the repo path could not be resolved / is not a usable git repo. */
|
|
3819
3856
|
reachable: boolean;
|
|
3820
3857
|
/** Existing `.gitignore` lines, trimmed; an empty array when there is no `.gitignore`. */
|
|
@@ -3830,21 +3867,30 @@ type GitignorePlanSummary = {
|
|
|
3830
3867
|
plans: RepoGitignorePlan[];
|
|
3831
3868
|
/** Repo paths skipped because visibility is unset (cannot decide safely). */
|
|
3832
3869
|
unknown: string[];
|
|
3870
|
+
/**
|
|
3871
|
+
* `instructions: self` repo paths, skipped by design: their instruction files
|
|
3872
|
+
* are committed and shared, so they are never gitignored. Reported (not
|
|
3873
|
+
* silently dropped) and do NOT block the `ok` verdict — being skipped is the
|
|
3874
|
+
* intended terminal state, not a gap.
|
|
3875
|
+
*/
|
|
3876
|
+
self: string[];
|
|
3833
3877
|
/** Repo paths that could not be resolved / are not usable git repos. */
|
|
3834
3878
|
unreachable: string[];
|
|
3835
3879
|
/**
|
|
3836
3880
|
* True only when nothing needs adding AND every repo was judgeable and
|
|
3837
3881
|
* reachable — so a clean verdict is never claimed while some repos were
|
|
3838
|
-
* skipped (unset visibility) or could not be inspected (unreachable).
|
|
3882
|
+
* skipped (unset visibility) or could not be inspected (unreachable). A `self`
|
|
3883
|
+
* repo does not block it (it is intentionally not gitignored).
|
|
3839
3884
|
*/
|
|
3840
3885
|
ok: boolean;
|
|
3841
3886
|
};
|
|
3842
3887
|
/**
|
|
3843
3888
|
* Compute the {@link GitignorePlanSummary}: for each public-facing, reachable
|
|
3844
3889
|
* repo, the `required` patterns that are not already present in its `.gitignore`
|
|
3845
|
-
* (compared by trimmed exact line). Private repos require nothing;
|
|
3846
|
-
*
|
|
3847
|
-
*
|
|
3890
|
+
* (compared by trimmed exact line). Private repos require nothing; a `self` repo
|
|
3891
|
+
* is reported as `self` (its committed instruction files are shared, never
|
|
3892
|
+
* gitignored); unset visibility is reported as `unknown` and unreachable repos as
|
|
3893
|
+
* `unreachable`. `ok` is true when no repo needs any addition.
|
|
3848
3894
|
*/
|
|
3849
3895
|
declare function planGitignore(input: {
|
|
3850
3896
|
repos: RepoGitignoreFacts[];
|
|
@@ -3902,6 +3948,13 @@ type RepoPresetFacts = {
|
|
|
3902
3948
|
path: string;
|
|
3903
3949
|
/** True when this repo IS the project anchor (its own AGENTS.md is hand-maintained; skipped). */
|
|
3904
3950
|
isAnchor: boolean;
|
|
3951
|
+
/**
|
|
3952
|
+
* True when this repo declares `instructions: self`: its AGENTS.md is
|
|
3953
|
+
* hand-authored and basou stays hands-off — no preset block is ever written
|
|
3954
|
+
* (reported as `self`, skipped like an anchor). Absent => the default `hub`
|
|
3955
|
+
* behavior, unchanged.
|
|
3956
|
+
*/
|
|
3957
|
+
self?: boolean | undefined;
|
|
3905
3958
|
/** False when the repo path could not be resolved / is not a usable git repo. */
|
|
3906
3959
|
reachable: boolean;
|
|
3907
3960
|
/** Declared fields (the render input). */
|
|
@@ -3971,14 +4024,16 @@ type PresetPlanSummary = {
|
|
|
3971
4024
|
collisions: PresetCollision[];
|
|
3972
4025
|
/** Repos that resolve to the anchor (their own AGENTS.md is hand-maintained; skipped). */
|
|
3973
4026
|
anchors: string[];
|
|
4027
|
+
/** `instructions: self` repos: hands-off, skipped (basou never writes their AGENTS.md). */
|
|
4028
|
+
self: string[];
|
|
3974
4029
|
/** Repo paths that could not be resolved / are not usable git repos. */
|
|
3975
4030
|
unreachable: string[];
|
|
3976
4031
|
/**
|
|
3977
4032
|
* True only when nothing needs writing AND there are no marker conflicts, no
|
|
3978
4033
|
* unreadable canonicals, no collisions, no unreachable repos, and no
|
|
3979
4034
|
* undeclared repos — so a clean "all in sync" verdict is never claimed while
|
|
3980
|
-
* some repo was skipped or unjudgeable. Anchors do not block
|
|
3981
|
-
* intentionally not generated).
|
|
4035
|
+
* some repo was skipped or unjudgeable. Anchors and `self` repos do not block
|
|
4036
|
+
* it (they are intentionally not generated).
|
|
3982
4037
|
*/
|
|
3983
4038
|
ok: boolean;
|
|
3984
4039
|
};
|
|
@@ -4068,6 +4123,115 @@ declare function planRename(input: {
|
|
|
4068
4123
|
oldIsAnchor?: boolean;
|
|
4069
4124
|
}): RenamePlan;
|
|
4070
4125
|
|
|
4126
|
+
/**
|
|
4127
|
+
* Retrofit an existing repo's hand-authored `AGENTS.md` into the project's
|
|
4128
|
+
* "saddle" topology. The greenfield flow (`project new` → `project derive`)
|
|
4129
|
+
* assumes the canonical instruction file is born in the anchor at
|
|
4130
|
+
* `agents/<repo>/AGENTS.md`; but a repo that was developed BEFORE adoption
|
|
4131
|
+
* carries its instructions as a plain regular file at `<repo>/AGENTS.md`. The
|
|
4132
|
+
* other generators never relocate it — `project symlinks` is non-destructive and
|
|
4133
|
+
* skips an occupied path, `project preset` would create a near-empty canonical
|
|
4134
|
+
* beside the orphaned prose. Retrofit is the one missing migration step: it moves
|
|
4135
|
+
* that regular file to the anchor canonical and leaves a symlink in its place, so
|
|
4136
|
+
* the prose is preserved at the single source of truth and `project derive` can
|
|
4137
|
+
* finish the wiring (CLAUDE.md / Copilot spokes, `.gitignore`, the preset block).
|
|
4138
|
+
*
|
|
4139
|
+
* Pure: it CLASSIFIES already-gathered facts (is the file a regular file? does the
|
|
4140
|
+
* destination canonical already exist?) into one action. The realpath / lstat /
|
|
4141
|
+
* move / symlink I/O is the caller's job. Non-destructive by contract: it only
|
|
4142
|
+
* relocates a genuine regular-file AGENTS.md into a FREE canonical slot; an
|
|
4143
|
+
* existing canonical (which would be clobbered), an already-wired symlink, an
|
|
4144
|
+
* absent file, the anchor itself, or an unreachable/undeclared repo all yield a
|
|
4145
|
+
* refuse/skip — never a move.
|
|
4146
|
+
*/
|
|
4147
|
+
/**
|
|
4148
|
+
* On-disk state of the repo's own `AGENTS.md` (the file to relocate), as seen by
|
|
4149
|
+
* `lstat` (never following the link). `regular-file` is the only relocatable
|
|
4150
|
+
* state; `symlink` means it is already wired, `absent` means there is nothing to
|
|
4151
|
+
* move, and `blocked` means the path could not be inspected (a non-ENOENT error)
|
|
4152
|
+
* so it must not be mistaken for relocatable.
|
|
4153
|
+
*/
|
|
4154
|
+
type RetrofitAgentsState = "regular-file" | "symlink" | "absent" | "blocked";
|
|
4155
|
+
/** The single action retrofit will take for the repo. */
|
|
4156
|
+
type RetrofitAction = "relocate" | "skip" | "refuse";
|
|
4157
|
+
/** Why {@link classifyRetrofit} chose its action (machine-stable; the caller renders prose). */
|
|
4158
|
+
type RetrofitReason =
|
|
4159
|
+
/** relocate: a regular-file AGENTS.md with a free destination canonical. */
|
|
4160
|
+
"ok"
|
|
4161
|
+
/** refuse: the repo is not in the declared roster. */
|
|
4162
|
+
| "not-declared"
|
|
4163
|
+
/**
|
|
4164
|
+
* refuse: the repo declares `instructions: self` — its AGENTS.md is a
|
|
4165
|
+
* hand-authored committed file that stays in the repo, so there is no anchor
|
|
4166
|
+
* canonical to relocate it to (retrofit does not apply).
|
|
4167
|
+
*/
|
|
4168
|
+
| "self"
|
|
4169
|
+
/** refuse: the path is the project anchor (it owns the canonical directly — nothing to relocate). */
|
|
4170
|
+
| "anchor"
|
|
4171
|
+
/** refuse: the path does not resolve / is not a git repo. */
|
|
4172
|
+
| "unreachable"
|
|
4173
|
+
/** refuse: the AGENTS.md path could not be inspected (a non-ENOENT lstat error). */
|
|
4174
|
+
| "blocked"
|
|
4175
|
+
/** refuse: the destination canonical already exists (relocating would clobber it). */
|
|
4176
|
+
| "canonical-exists"
|
|
4177
|
+
/** skip: AGENTS.md is already a symlink (likely already wired — idempotent). */
|
|
4178
|
+
| "already-symlink"
|
|
4179
|
+
/** skip: there is no AGENTS.md to relocate. */
|
|
4180
|
+
| "absent";
|
|
4181
|
+
/** The gathered facts for the one repo being retrofitted. Pure inputs — no I/O. */
|
|
4182
|
+
type RetrofitFacts = {
|
|
4183
|
+
/** The repo's roster path (relative to the anchor), echoed in the report. */
|
|
4184
|
+
path: string;
|
|
4185
|
+
/** True when the path is declared in the manifest roster. */
|
|
4186
|
+
declared: boolean;
|
|
4187
|
+
/**
|
|
4188
|
+
* True when the declared entry uses `instructions: self` — its AGENTS.md stays
|
|
4189
|
+
* in the repo, so retrofit (which relocates it to the anchor canonical) does
|
|
4190
|
+
* not apply. Absent/false => the default `hub` behavior, unchanged.
|
|
4191
|
+
*/
|
|
4192
|
+
self?: boolean | undefined;
|
|
4193
|
+
/** True when the path resolves to the anchor itself. */
|
|
4194
|
+
isAnchor: boolean;
|
|
4195
|
+
/** False when the path does not resolve / is not a git repo. */
|
|
4196
|
+
reachable: boolean;
|
|
4197
|
+
/** The repo basename used for the anchor canonical `agents/<canonicalName>/AGENTS.md`. */
|
|
4198
|
+
canonicalName: string;
|
|
4199
|
+
/** On-disk state of the repo's own `AGENTS.md`. */
|
|
4200
|
+
agentsState: RetrofitAgentsState;
|
|
4201
|
+
/** True when the destination canonical already exists (moving would clobber it). */
|
|
4202
|
+
canonicalExists: boolean;
|
|
4203
|
+
/**
|
|
4204
|
+
* The repo's spoke instruction files (`CLAUDE.md`, `.github/copilot-instructions.md`)
|
|
4205
|
+
* that are regular files — they would block clean wiring (`project symlinks`
|
|
4206
|
+
* skips an occupied path), so they are surfaced as a manual checklist. Never
|
|
4207
|
+
* moved by retrofit (they are spokes to AGENTS.md, not separate canonicals).
|
|
4208
|
+
*/
|
|
4209
|
+
regularSpokes: string[];
|
|
4210
|
+
};
|
|
4211
|
+
/** The classified outcome for the repo. */
|
|
4212
|
+
type RetrofitPlan = {
|
|
4213
|
+
path: string;
|
|
4214
|
+
action: RetrofitAction;
|
|
4215
|
+
reason: RetrofitReason;
|
|
4216
|
+
/** The repo basename used for the canonical (echoed for the report). */
|
|
4217
|
+
canonicalName: string;
|
|
4218
|
+
/** The anchor-relative destination `agents/<canonicalName>/AGENTS.md`; set only when `action` is `relocate`. */
|
|
4219
|
+
canonicalPath?: string;
|
|
4220
|
+
/** Spoke instruction files that are regular files (reported, never moved). */
|
|
4221
|
+
regularSpokes: string[];
|
|
4222
|
+
};
|
|
4223
|
+
/**
|
|
4224
|
+
* Classify the retrofit facts into one action. Refusals are checked first, in a
|
|
4225
|
+
* fixed precedence so the outcome is deterministic when several guardrails could
|
|
4226
|
+
* apply: undeclared → anchor → self → unreachable → uninspectable AGENTS.md. Then
|
|
4227
|
+
* the idempotent skips (already a symlink, or absent — nothing to move). Only a
|
|
4228
|
+
* genuine regular-file AGENTS.md reaches the relocate decision, and even then a
|
|
4229
|
+
* pre-existing destination canonical refuses (relocating would clobber it).
|
|
4230
|
+
* `regularSpokes` is echoed in every outcome (it is advisory, relevant whenever a
|
|
4231
|
+
* relocate or skip leaves the operator to tidy the spokes).
|
|
4232
|
+
*/
|
|
4233
|
+
declare function classifyRetrofit(facts: RetrofitFacts): RetrofitPlan;
|
|
4234
|
+
|
|
4071
4235
|
/**
|
|
4072
4236
|
* Plan the agent instruction-file symlinks a declared repo needs (the
|
|
4073
4237
|
* generation step that follows `basou project gitignore` in the "saddle"
|
|
@@ -4127,12 +4291,24 @@ type RepoSymlinkFacts = {
|
|
|
4127
4291
|
* it never links to itself). An anchor entry is skipped entirely.
|
|
4128
4292
|
*/
|
|
4129
4293
|
isAnchor: boolean;
|
|
4294
|
+
/**
|
|
4295
|
+
* True when this repo declares `instructions: self`: its canonical AGENTS.md is
|
|
4296
|
+
* a regular committed file in the repo itself, so only the CLAUDE.md / Copilot
|
|
4297
|
+
* spokes are generated (never the AGENTS.md hub link), `canonicalPresent` means
|
|
4298
|
+
* "the repo's own AGENTS.md is present" (an absent one is `selfAgentsMissing`,
|
|
4299
|
+
* not `missingCanonical`), and the repo is excluded from anchor-canonical
|
|
4300
|
+
* collision detection (it shares no anchor canonical). Absent => the default
|
|
4301
|
+
* `hub` behavior, unchanged.
|
|
4302
|
+
*/
|
|
4303
|
+
self?: boolean | undefined;
|
|
4130
4304
|
/** False when the repo path could not be resolved / is not a usable git repo. */
|
|
4131
4305
|
reachable: boolean;
|
|
4132
4306
|
/**
|
|
4133
|
-
*
|
|
4134
|
-
* (`<anchor>/agents/<repo>/AGENTS.md`) exists
|
|
4135
|
-
* dangle, so no links are planned (reported as
|
|
4307
|
+
* For a `hub` repo: whether the anchor's canonical source
|
|
4308
|
+
* (`<anchor>/agents/<repo>/AGENTS.md`) exists — without it the hub link would
|
|
4309
|
+
* dangle, so no links are planned (reported as `missingCanonical` instead). For
|
|
4310
|
+
* a `self` repo: whether the repo's OWN AGENTS.md exists — without it the
|
|
4311
|
+
* spokes would dangle, so none are planned (reported as `selfAgentsMissing`).
|
|
4136
4312
|
*/
|
|
4137
4313
|
canonicalPresent: boolean;
|
|
4138
4314
|
/**
|
|
@@ -4182,15 +4358,22 @@ type SymlinkPlanSummary = {
|
|
|
4182
4358
|
conflicts: SymlinkConflict[];
|
|
4183
4359
|
/** Repo paths whose anchor canonical (`agents/<repo>/AGENTS.md`) is absent, so nothing can be wired. */
|
|
4184
4360
|
missingCanonical: string[];
|
|
4361
|
+
/**
|
|
4362
|
+
* `self` repo paths whose own AGENTS.md is absent, so the spokes would dangle
|
|
4363
|
+
* and none are planned. Distinct from `missingCanonical` (which is the anchor
|
|
4364
|
+
* canonical a `hub` repo links to): the operator authors a `self` repo's
|
|
4365
|
+
* AGENTS.md by hand, then re-runs.
|
|
4366
|
+
*/
|
|
4367
|
+
selfAgentsMissing: string[];
|
|
4185
4368
|
/** Repo paths that could not be resolved / are not usable git repos. */
|
|
4186
4369
|
unreachable: string[];
|
|
4187
4370
|
/** Groups of distinct repos that resolve to the same canonical (ambiguous; not auto-wired). */
|
|
4188
4371
|
collisions: SymlinkCollision[];
|
|
4189
4372
|
/**
|
|
4190
4373
|
* True only when nothing needs creating AND there are no conflicts, no missing
|
|
4191
|
-
* canonicals, no
|
|
4192
|
-
*
|
|
4193
|
-
* be inspected.
|
|
4374
|
+
* canonicals, no self repos missing their AGENTS.md, no unreachable repos, and
|
|
4375
|
+
* no collisions — so a clean "all wired" verdict is never claimed while some
|
|
4376
|
+
* repo was blocked, ambiguous, or could not be inspected.
|
|
4194
4377
|
*/
|
|
4195
4378
|
ok: boolean;
|
|
4196
4379
|
};
|
|
@@ -4211,6 +4394,12 @@ type SymlinkPlanSummary = {
|
|
|
4211
4394
|
* {@link SymlinkCollision} and neither is auto-wired (silent sharing of one
|
|
4212
4395
|
* canonical is surfaced, not actioned).
|
|
4213
4396
|
*
|
|
4397
|
+
* A `self` repo (its `self` flag set by the caller) carries only its spoke files
|
|
4398
|
+
* (CLAUDE.md / Copilot → its own AGENTS.md), is excluded from collision
|
|
4399
|
+
* detection, and routes an absent own-AGENTS.md to `selfAgentsMissing` rather
|
|
4400
|
+
* than `missingCanonical`. Otherwise it flows through the same create/conflict
|
|
4401
|
+
* logic as a hub repo.
|
|
4402
|
+
*
|
|
4214
4403
|
* `ok` is true only when there is genuinely nothing to do and every repo was
|
|
4215
4404
|
* judgeable, reachable, and unambiguous.
|
|
4216
4405
|
*/
|
|
@@ -4244,6 +4433,13 @@ type RepoWiringFacts = {
|
|
|
4244
4433
|
path: string;
|
|
4245
4434
|
/** Declared visibility; undefined when the operator has not set it yet. */
|
|
4246
4435
|
visibility?: RepoVisibility | undefined;
|
|
4436
|
+
/**
|
|
4437
|
+
* True when this repo declares `instructions: self`: its instruction files are
|
|
4438
|
+
* committed BY DESIGN (shared in its own git history), so a tracked file is
|
|
4439
|
+
* never a privacy risk — the repo is reported as `self` and excluded from the
|
|
4440
|
+
* risk / unknown verdicts. Absent => the default `hub` behavior, unchanged.
|
|
4441
|
+
*/
|
|
4442
|
+
self?: boolean | undefined;
|
|
4247
4443
|
/** False when the repo path could not be resolved / is not a usable git repo. */
|
|
4248
4444
|
reachable: boolean;
|
|
4249
4445
|
/** Per instruction-file facts (omitted/empty when unreachable). */
|
|
@@ -4265,6 +4461,12 @@ type WiringSummary = {
|
|
|
4265
4461
|
risks: WiringRisk[];
|
|
4266
4462
|
/** Repo paths whose visibility is unset, so the privacy verdict cannot be judged. */
|
|
4267
4463
|
unknown: string[];
|
|
4464
|
+
/**
|
|
4465
|
+
* `instructions: self` repo paths: their instruction files are committed by
|
|
4466
|
+
* design, so they carry no privacy risk and do not need a visibility verdict.
|
|
4467
|
+
* Reported (not silently dropped) and do NOT block `ok`.
|
|
4468
|
+
*/
|
|
4469
|
+
self: string[];
|
|
4268
4470
|
/** Repos missing one or more instruction files (a wiring gap a later generate slice fills). */
|
|
4269
4471
|
incomplete: {
|
|
4270
4472
|
repo: string;
|
|
@@ -4280,8 +4482,11 @@ type WiringSummary = {
|
|
|
4280
4482
|
* public-facing repo that TRACKS an instruction file is a {@link WiringRisk}
|
|
4281
4483
|
* (its git history can expose the private canonical it points at); a repo with
|
|
4282
4484
|
* unset visibility cannot be judged (`unknown`); a repo missing instruction
|
|
4283
|
-
* files is `incomplete` (a wiring gap, not a privacy problem). `
|
|
4284
|
-
*
|
|
4485
|
+
* files is `incomplete` (a wiring gap, not a privacy problem). A `self` repo is
|
|
4486
|
+
* reported as `self` and bypasses the risk / unknown verdicts entirely — its
|
|
4487
|
+
* instruction files are committed by design — though a genuinely missing one is
|
|
4488
|
+
* still surfaced as `incomplete`. `ok` is true only when nothing is at risk,
|
|
4489
|
+
* every repo is judgeable, and every repo is reachable.
|
|
4285
4490
|
*/
|
|
4286
4491
|
declare function summarizeWiring(facts: RepoWiringFacts[]): WiringSummary;
|
|
4287
4492
|
|
|
@@ -5622,4 +5827,4 @@ declare function overwriteYamlFile(filePath: string, value: unknown): Promise<vo
|
|
|
5622
5827
|
*/
|
|
5623
5828
|
declare const BASOU_CORE_VERSION = "0.1.0";
|
|
5624
5829
|
|
|
5625
|
-
export { ACTIVE_GAP_CAP_MS, AGENT_INFRA_DIRS, type ActiveTimeBasis, type AdapterOutputEvent, type AdoptCandidate, type AdoptCandidateKind, type AppendBasouGitignoreOptions, type AppendBasouGitignoreResult, type AppendEventToExistingInput, type AppendEventToExistingResult, type Approval, type ApprovalApprovedEvent, type ApprovalExpiredEvent, ApprovalIdSchema, type ApprovalLocation, type ApprovalRejectedEvent, type ApprovalRequestedEvent, ApprovalSchema, type ApprovalStatus, ApprovalStatusSchema, type ArchivePlan, type ArchiveTaskInput, type ArchiveTaskResult, type AttachTaskInput, type AttachUpdateTaskStatusInput, type AttachableStatus, BASOU_CORE_VERSION, type BasouPaths, type BulkChainResult, CLAUDE_IMPORT_SOURCE, CODEX_IMPORT_SOURCE, type CaptureMode, type ChainBreakReason, type ChainTailState, type ChainVerdict, type ChainVerdictStatus, type ChainedEvents, ChildProcessRunner, type CitedReview, type ClaudeTranscriptRecord, type ClaudeTranscriptToPayloadOptions, type CodexRolloutRecord, type CodexRolloutToPayloadOptions, type CommandExecutedEvent, type CommandLookup, type CreateAdHocSessionInput, type CreateAdHocSessionResult, type CreateAdHocTaskInput, type CreateManifestInput, type CreateTaskInput, type CreateTaskResult, DEFAULT_STOP_HOOK_MIN_EDITS, type DayWorkStats, DecisionIdSchema, type DecisionRecordedEvent, type DecisionsRendererInput, type DecisionsRendererResult, type DeleteTaskInput, type DeleteTaskResult, type DiffResult, type EditTaskInput, type EditTaskResult, type Event, EventIdSchema, EventSchema, EventSourceSchema, type ExistingViewLink, FailedToFinalizeError, type FederatedRoot, type FileChange, type FileChangeStatus, type FileChangedEvent, GENERATED_END, GENERATED_START, type GitSnapshot, type GitSnapshotEvent, type GitignorePlanSummary, type HandoffRendererInput, type HandoffRendererResult, ID_PREFIXES, type IdPrefix, type ImportSessionOptions, type ImportSessionResult, type InstructionFileFact, type InstructionSymlinkFact, type InstructionSymlinkState, IsoTimestampSchema, JSON_SCHEMA_VERSION, type JsonSchemaArtifact, type LoadFederatedOptions, type LoadSessionEntriesOptions, type LoadTaskEntriesOptions, type LoadedApproval, type LockHandle, type LockScope, type Manifest, ManifestSchema, type MarkerSection, type Markers, type MeasureAvailability, type NoteAddedEvent, type OrientationRendererInput, type OrientationRendererResult, type OrientationSummary, PROTOCOL_END, PROTOCOL_START, type PrefixedId, type PresetAction, type PresetCollision, type PresetMarkerConflict, type PresetMarkerKind, type PresetPlanSummary, type PresetRepo, type ProcessRunner, type PublishKind, type PublishTarget, type RechainOptions, type RechainResult, type ReconcileAllResult, type ReconcileAllTasksInput, type ReconcileAllTasksOptions, type ReconcileFailure, type ReconcileResult, type ReconcileTaskInput, type RefreshLinkageInput, type RefreshLinkageResult, type ReimportOptions, type ReimportResult, type RenamePlan, type ReplayOptions, type ReplayWarning, type RepoEntry, type RepoGitignoreFacts, type RepoGitignorePlan, type RepoLanguage, type RepoPresetFacts, type RepoPresetPlan, type RepoSymlinkFacts, type RepoSymlinkPlan, type RepoVisibility, type RepoWiringFacts, type ReportApprovalItem, type ReportData, type ReportDecisionItem, type ReportRendererInput, type ReportRendererResult, type ReportSessionItem, type ReportTaskItem, type ReviewGapRepoSummary, type ReviewGapUnit, type ReviewGapVerdict, type ReviewGapsInput, type ReviewGapsSummary, type RiskLevel, RiskLevelSchema, type RosterAdoptionPlan, type RosterDriftSummary, type RunOptions, type RunResult, STUCK_THRESHOLD_MS, type SanitizePathOptions, type SanitizeRelatedFilesResult, SchemaVersionSchema, type Session, type SessionEndedEvent, type SessionEntry, SessionIdSchema, type SessionImportPayload, SessionImportPayloadSchema, type SessionInnerImportInput, SessionInnerImportSchema, type SessionIntegrity, SessionIntegritySchema, type SessionMetrics, SessionMetricsSchema, SessionSchema, type SessionSkipReason, type SessionSourceKind, SessionSourceKindSchema, type SessionStartedEvent, type SessionStatus, type SessionStatusChangedEvent, SessionStatusSchema, type SessionWorkStats, type SourceRootScope, type SourceRootsReconcile, type SourceWorkStats, type StatusCount, StatusSchema, type StatusSnapshot, type StopHookEvaluation, type StopHookEvaluationInput, type StopHookSilentReason, type SuspectReason, type SymlinkCollision, type SymlinkConflict, type SymlinkPlanSummary, type Task, type TaskArchivedEvent, type TaskCreatedEvent, type TaskDeletedEvent, type TaskDocument, TaskIdSchema, type TaskLinkageRefreshedEvent, type TaskReconciledEvent, TaskSchema, type TaskSkipReason, type TaskStatus, type TaskStatusChangedEvent, type TaskStatusCount, TaskStatusSchema, TaskWriteAfterEventError, type TaskWriteAfterEventPhase, type TokenTotals, type UpdateAdHocTaskStatusInput, type UpdateTaskStatusInput, type UpdateTaskStatusResult, type ViewCollision, type ViewConflict, type ViewLinkState, type ViewRepoFact, type ViewStrayUnknown, type WiringRisk, type WiringSummary, type WorkStatsInput, type WorkStatsResult, type WorkStatsTotals, WorkspaceIdSchema, type WorkspaceViewPlan, type WriteEventsBulkOptions, type WriteTaskFileMode, acquireLock, appendBasouGitignore, appendChainedEvent, appendChainedEventLocked, appendEvent, appendEventToExistingSession, archiveTask, assertBasouRootSafe, basouPaths, buildJsonSchemas, buildStatusSnapshot, chainEvents, chainRawJsonLines, classifyFilesBySourceRoot, classifySuspect, claudeCodeAdapterMetadata, claudeTranscriptToImportPayload, codexRolloutToImportPayload, computeWorkStats, createAdHocSessionWithEvent, createManifest, createTaskWithEvent, deleteTask, editTask, ensureBasouDirectory, enumerateApprovals, enumerateArchivedTaskIds, enumerateSessionDirs, enumerateTaskIds, evaluateStopHook, finalizeSessionYaml, findErrorCode, findReviewGaps, formatDurationMs, genesisHash, getDiff, getSnapshot, importSessionFromJson, inspectChainTail, isGitNotFound, isImportDerivedSource, isLazyExpired, isRenderable, isValidPrefixedId, lineHash, linkYamlFile, loadApproval, loadFederatedSessionEntries, loadSessionEntries, loadTaskEntries, normalizeRepoKey, normalizeRepoPath, overwriteYamlFile, parseDuration, parseMarkers, pathBasename, planArchive, planGitignore, planRename, planRosterAdoption, planWorkspaceView, prefixedUlid, readAllEvents, readManifest, readMarkdownFile, readSessionYaml, readStatus, readTaskFile, readTaskFileWithArchiveFallback, readYamlFile, rechainSessionInPlace, reconcileAllTasks, reconcileSourceRoots, reconcileTask, refreshTaskLinkedSessions, reimportPreservingId, removeMarkerSection, renderDecisions, renderHandoff, renderOrientation, renderPresetBlock, renderReport, renderWithMarkers, replayEvents, resolveBasouRepositoryRoot, resolveClaudeCodeCommand, resolveRepositoryRoot, resolveSessionId, resolveTaskId, safeSimpleGit, sanitizePath, sanitizeRelatedFiles, sanitizeWorkingDirectory, serializeEventLine, serializeJsonSchema, sessionWorkStatsFromEvents, summarizeAdapterOutput, summarizeOrientation, summarizePresetPlan, summarizeRosterDrift, summarizeSymlinkPlan, summarizeWiring, tryRemoteUrl, ulid, unknownManifestKeys, updateTaskStatusWithEvent, verifyEventsChain, writeEventsBulk, writeManifest, writeMarkdownFile, writeStatus, writeTaskFile, writeYamlFile };
|
|
5830
|
+
export { ACTIVE_GAP_CAP_MS, AGENT_INFRA_DIRS, type ActiveTimeBasis, type AdapterOutputEvent, type AdoptCandidate, type AdoptCandidateKind, type AppendBasouGitignoreOptions, type AppendBasouGitignoreResult, type AppendEventToExistingInput, type AppendEventToExistingResult, type Approval, type ApprovalApprovedEvent, type ApprovalExpiredEvent, ApprovalIdSchema, type ApprovalLocation, type ApprovalRejectedEvent, type ApprovalRequestedEvent, ApprovalSchema, type ApprovalStatus, ApprovalStatusSchema, type ArchivePlan, type ArchiveTaskInput, type ArchiveTaskResult, type AttachTaskInput, type AttachUpdateTaskStatusInput, type AttachableStatus, BASOU_CORE_VERSION, type BasouPaths, type BulkChainResult, CLAUDE_IMPORT_SOURCE, CODEX_IMPORT_SOURCE, type CaptureMode, type ChainBreakReason, type ChainTailState, type ChainVerdict, type ChainVerdictStatus, type ChainedEvents, ChildProcessRunner, type CitedReview, type ClaudeTranscriptRecord, type ClaudeTranscriptToPayloadOptions, type CodexRolloutRecord, type CodexRolloutToPayloadOptions, type CommandExecutedEvent, type CommandLookup, type CreateAdHocSessionInput, type CreateAdHocSessionResult, type CreateAdHocTaskInput, type CreateManifestInput, type CreateTaskInput, type CreateTaskResult, DEFAULT_STOP_HOOK_MIN_EDITS, type DayWorkStats, DecisionIdSchema, type DecisionRecordedEvent, type DecisionsRendererInput, type DecisionsRendererResult, type DeleteTaskInput, type DeleteTaskResult, type DiffResult, type EditTaskInput, type EditTaskResult, type Event, EventIdSchema, EventSchema, EventSourceSchema, type ExistingViewLink, FailedToFinalizeError, type FederatedRoot, type FileChange, type FileChangeStatus, type FileChangedEvent, GENERATED_END, GENERATED_START, type GitSnapshot, type GitSnapshotEvent, type GitignorePlanSummary, type HandoffRendererInput, type HandoffRendererResult, ID_PREFIXES, type IdPrefix, type ImportSessionOptions, type ImportSessionResult, type InstructionFileFact, type InstructionSymlinkFact, type InstructionSymlinkState, IsoTimestampSchema, JSON_SCHEMA_VERSION, type JsonSchemaArtifact, type LoadFederatedOptions, type LoadSessionEntriesOptions, type LoadTaskEntriesOptions, type LoadedApproval, type LockHandle, type LockScope, type Manifest, ManifestSchema, type MarkerSection, type Markers, type MeasureAvailability, type NoteAddedEvent, type OrientationRendererInput, type OrientationRendererResult, type OrientationSummary, PROTOCOL_END, PROTOCOL_START, type PrefixedId, type PresetAction, type PresetCollision, type PresetMarkerConflict, type PresetMarkerKind, type PresetPlanSummary, type PresetRepo, type ProcessRunner, type PublishKind, type PublishTarget, type RechainOptions, type RechainResult, type ReconcileAllResult, type ReconcileAllTasksInput, type ReconcileAllTasksOptions, type ReconcileFailure, type ReconcileResult, type ReconcileTaskInput, type RefreshLinkageInput, type RefreshLinkageResult, type ReimportOptions, type ReimportResult, type RenamePlan, type ReplayOptions, type ReplayWarning, type RepoEntry, type RepoGitignoreFacts, type RepoGitignorePlan, type RepoInstructions, type RepoLanguage, type RepoPresetFacts, type RepoPresetPlan, type RepoSymlinkFacts, type RepoSymlinkPlan, type RepoVisibility, type RepoWiringFacts, type ReportApprovalItem, type ReportData, type ReportDecisionItem, type ReportRendererInput, type ReportRendererResult, type ReportSessionItem, type ReportTaskItem, type RetrofitAction, type RetrofitAgentsState, type RetrofitFacts, type RetrofitPlan, type RetrofitReason, type ReviewGapRepoSummary, type ReviewGapUnit, type ReviewGapVerdict, type ReviewGapsInput, type ReviewGapsSummary, type RiskLevel, RiskLevelSchema, type RosterAdoptionPlan, type RosterDriftSummary, type RunOptions, type RunResult, STUCK_THRESHOLD_MS, type SanitizePathOptions, type SanitizeRelatedFilesResult, SchemaVersionSchema, type Session, type SessionEndedEvent, type SessionEntry, SessionIdSchema, type SessionImportPayload, SessionImportPayloadSchema, type SessionInnerImportInput, SessionInnerImportSchema, type SessionIntegrity, SessionIntegritySchema, type SessionMetrics, SessionMetricsSchema, SessionSchema, type SessionSkipReason, type SessionSourceKind, SessionSourceKindSchema, type SessionStartedEvent, type SessionStatus, type SessionStatusChangedEvent, SessionStatusSchema, type SessionWorkStats, type SourceRootScope, type SourceRootsReconcile, type SourceWorkStats, type StatusCount, StatusSchema, type StatusSnapshot, type StopHookEvaluation, type StopHookEvaluationInput, type StopHookSilentReason, type SuspectReason, type SymlinkCollision, type SymlinkConflict, type SymlinkPlanSummary, type Task, type TaskArchivedEvent, type TaskCreatedEvent, type TaskDeletedEvent, type TaskDocument, TaskIdSchema, type TaskLinkageRefreshedEvent, type TaskReconciledEvent, TaskSchema, type TaskSkipReason, type TaskStatus, type TaskStatusChangedEvent, type TaskStatusCount, TaskStatusSchema, TaskWriteAfterEventError, type TaskWriteAfterEventPhase, type TokenTotals, type UpdateAdHocTaskStatusInput, type UpdateTaskStatusInput, type UpdateTaskStatusResult, type ViewCollision, type ViewConflict, type ViewLinkState, type ViewRepoFact, type ViewStrayUnknown, type WiringRisk, type WiringSummary, type WorkStatsInput, type WorkStatsResult, type WorkStatsTotals, WorkspaceIdSchema, type WorkspaceViewPlan, type WriteEventsBulkOptions, type WriteTaskFileMode, acquireLock, appendBasouGitignore, appendChainedEvent, appendChainedEventLocked, appendEvent, appendEventToExistingSession, archiveTask, assertBasouRootSafe, basouPaths, buildJsonSchemas, buildStatusSnapshot, chainEvents, chainRawJsonLines, classifyFilesBySourceRoot, classifyRetrofit, classifySuspect, claudeCodeAdapterMetadata, claudeTranscriptToImportPayload, codexRolloutToImportPayload, computeWorkStats, createAdHocSessionWithEvent, createManifest, createTaskWithEvent, deleteTask, editTask, ensureBasouDirectory, enumerateApprovals, enumerateArchivedTaskIds, enumerateSessionDirs, enumerateTaskIds, evaluateStopHook, finalizeSessionYaml, findErrorCode, findReviewGaps, formatDurationMs, genesisHash, getDiff, getSnapshot, importSessionFromJson, inspectChainTail, instructionMode, isGitNotFound, isImportDerivedSource, isLazyExpired, isRenderable, isValidPrefixedId, lineHash, linkYamlFile, loadApproval, loadFederatedSessionEntries, loadSessionEntries, loadTaskEntries, normalizeRepoKey, normalizeRepoPath, overwriteYamlFile, parseDuration, parseMarkers, pathBasename, planArchive, planGitignore, planRename, planRosterAdoption, planWorkspaceView, prefixedUlid, readAllEvents, readManifest, readMarkdownFile, readSessionYaml, readStatus, readTaskFile, readTaskFileWithArchiveFallback, readYamlFile, rechainSessionInPlace, reconcileAllTasks, reconcileSourceRoots, reconcileTask, refreshTaskLinkedSessions, reimportPreservingId, removeMarkerSection, renderDecisions, renderHandoff, renderOrientation, renderPresetBlock, renderReport, renderWithMarkers, replayEvents, resolveBasouRepositoryRoot, resolveClaudeCodeCommand, resolveRepositoryRoot, resolveSessionId, resolveTaskId, safeSimpleGit, sanitizePath, sanitizeRelatedFiles, sanitizeWorkingDirectory, serializeEventLine, serializeJsonSchema, sessionWorkStatsFromEvents, summarizeAdapterOutput, summarizeOrientation, summarizePresetPlan, summarizeRosterDrift, summarizeSymlinkPlan, summarizeWiring, tryRemoteUrl, ulid, unknownManifestKeys, updateTaskStatusWithEvent, verifyEventsChain, writeEventsBulk, writeManifest, writeMarkdownFile, writeStatus, writeTaskFile, writeYamlFile };
|
package/dist/index.js
CHANGED
|
@@ -4582,6 +4582,7 @@ var ImportConfigSchema = z9.looseObject({
|
|
|
4582
4582
|
var RepoVisibilitySchema = z9.enum(["public", "private", "future-public"]);
|
|
4583
4583
|
var RepoLanguageSchema = z9.enum(["en", "ja", "en+ja"]);
|
|
4584
4584
|
var PublishKindSchema = z9.enum(["web", "npm"]);
|
|
4585
|
+
var RepoInstructionsSchema = z9.enum(["hub", "self"]);
|
|
4585
4586
|
var PublishTargetSchema = z9.looseObject({
|
|
4586
4587
|
kind: PublishKindSchema,
|
|
4587
4588
|
visibility: RepoVisibilitySchema.optional(),
|
|
@@ -4591,7 +4592,8 @@ var RepoEntrySchema = z9.looseObject({
|
|
|
4591
4592
|
path: SourceRootSchema,
|
|
4592
4593
|
visibility: RepoVisibilitySchema.optional(),
|
|
4593
4594
|
language: RepoLanguageSchema.optional(),
|
|
4594
|
-
publishes: z9.array(PublishTargetSchema).optional()
|
|
4595
|
+
publishes: z9.array(PublishTargetSchema).optional(),
|
|
4596
|
+
instructions: RepoInstructionsSchema.optional()
|
|
4595
4597
|
});
|
|
4596
4598
|
var WorkspaceMetaSchema = z9.looseObject({
|
|
4597
4599
|
id: WorkspaceIdSchema,
|
|
@@ -5365,12 +5367,17 @@ function isPublicFacing(v) {
|
|
|
5365
5367
|
function planGitignore(input) {
|
|
5366
5368
|
const plans = [];
|
|
5367
5369
|
const unknown = [];
|
|
5370
|
+
const self = [];
|
|
5368
5371
|
const unreachable = [];
|
|
5369
5372
|
for (const repo of input.repos) {
|
|
5370
5373
|
if (!repo.reachable) {
|
|
5371
5374
|
unreachable.push(repo.path);
|
|
5372
5375
|
continue;
|
|
5373
5376
|
}
|
|
5377
|
+
if (repo.self === true) {
|
|
5378
|
+
self.push(repo.path);
|
|
5379
|
+
continue;
|
|
5380
|
+
}
|
|
5374
5381
|
if (repo.visibility === void 0) {
|
|
5375
5382
|
unknown.push(repo.path);
|
|
5376
5383
|
continue;
|
|
@@ -5388,6 +5395,7 @@ function planGitignore(input) {
|
|
|
5388
5395
|
return {
|
|
5389
5396
|
plans,
|
|
5390
5397
|
unknown,
|
|
5398
|
+
self,
|
|
5391
5399
|
unreachable,
|
|
5392
5400
|
ok: plans.length === 0 && unknown.length === 0 && unreachable.length === 0
|
|
5393
5401
|
};
|
|
@@ -5476,7 +5484,8 @@ function summarizePresetPlan(facts) {
|
|
|
5476
5484
|
}
|
|
5477
5485
|
const byCanonical = /* @__PURE__ */ new Map();
|
|
5478
5486
|
for (const f of deduped) {
|
|
5479
|
-
if (f.isAnchor || !f.reachable || f.canonicalName === void 0 || !isRenderable(f))
|
|
5487
|
+
if (f.isAnchor || f.self === true || !f.reachable || f.canonicalName === void 0 || !isRenderable(f))
|
|
5488
|
+
continue;
|
|
5480
5489
|
const repos = byCanonical.get(f.canonicalName) ?? [];
|
|
5481
5490
|
repos.push(f.path);
|
|
5482
5491
|
byCanonical.set(f.canonicalName, repos);
|
|
@@ -5495,12 +5504,17 @@ function summarizePresetPlan(facts) {
|
|
|
5495
5504
|
const markerConflicts = [];
|
|
5496
5505
|
const unreadable = [];
|
|
5497
5506
|
const anchors = [];
|
|
5507
|
+
const self = [];
|
|
5498
5508
|
const unreachable = [];
|
|
5499
5509
|
for (const f of deduped) {
|
|
5500
5510
|
if (f.isAnchor) {
|
|
5501
5511
|
anchors.push(f.path);
|
|
5502
5512
|
continue;
|
|
5503
5513
|
}
|
|
5514
|
+
if (f.self === true) {
|
|
5515
|
+
self.push(f.path);
|
|
5516
|
+
continue;
|
|
5517
|
+
}
|
|
5504
5518
|
if (!f.reachable) {
|
|
5505
5519
|
unreachable.push(f.path);
|
|
5506
5520
|
continue;
|
|
@@ -5546,6 +5560,7 @@ function summarizePresetPlan(facts) {
|
|
|
5546
5560
|
unreadable,
|
|
5547
5561
|
collisions,
|
|
5548
5562
|
anchors,
|
|
5563
|
+
self,
|
|
5549
5564
|
unreachable,
|
|
5550
5565
|
ok: plans.length === 0 && markerConflicts.length === 0 && unreadable.length === 0 && collisions.length === 0 && unreachable.length === 0 && undeclared.length === 0
|
|
5551
5566
|
};
|
|
@@ -5628,7 +5643,35 @@ function planRename(input) {
|
|
|
5628
5643
|
};
|
|
5629
5644
|
}
|
|
5630
5645
|
|
|
5646
|
+
// src/project/retrofit.ts
|
|
5647
|
+
var CANONICAL_FILE = "AGENTS.md";
|
|
5648
|
+
function classifyRetrofit(facts) {
|
|
5649
|
+
const base = {
|
|
5650
|
+
path: facts.path,
|
|
5651
|
+
canonicalName: facts.canonicalName,
|
|
5652
|
+
regularSpokes: facts.regularSpokes
|
|
5653
|
+
};
|
|
5654
|
+
if (!facts.declared) return { ...base, action: "refuse", reason: "not-declared" };
|
|
5655
|
+
if (facts.isAnchor) return { ...base, action: "refuse", reason: "anchor" };
|
|
5656
|
+
if (facts.self === true) return { ...base, action: "refuse", reason: "self" };
|
|
5657
|
+
if (!facts.reachable) return { ...base, action: "refuse", reason: "unreachable" };
|
|
5658
|
+
if (facts.agentsState === "blocked") return { ...base, action: "refuse", reason: "blocked" };
|
|
5659
|
+
if (facts.agentsState === "symlink")
|
|
5660
|
+
return { ...base, action: "skip", reason: "already-symlink" };
|
|
5661
|
+
if (facts.agentsState === "absent") return { ...base, action: "skip", reason: "absent" };
|
|
5662
|
+
if (facts.canonicalExists) return { ...base, action: "refuse", reason: "canonical-exists" };
|
|
5663
|
+
return {
|
|
5664
|
+
...base,
|
|
5665
|
+
action: "relocate",
|
|
5666
|
+
reason: "ok",
|
|
5667
|
+
canonicalPath: `agents/${facts.canonicalName}/${CANONICAL_FILE}`
|
|
5668
|
+
};
|
|
5669
|
+
}
|
|
5670
|
+
|
|
5631
5671
|
// src/project/roster.ts
|
|
5672
|
+
function instructionMode(entry) {
|
|
5673
|
+
return entry.instructions ?? "hub";
|
|
5674
|
+
}
|
|
5632
5675
|
function summarizeRosterDrift(input) {
|
|
5633
5676
|
const captured = new Set((input.sourceRoots ?? []).map(normalizeRelativePath));
|
|
5634
5677
|
const declared = /* @__PURE__ */ new Map();
|
|
@@ -5691,7 +5734,7 @@ function summarizeSymlinkPlan(facts) {
|
|
|
5691
5734
|
}
|
|
5692
5735
|
const byCanonical = /* @__PURE__ */ new Map();
|
|
5693
5736
|
for (const f of deduped) {
|
|
5694
|
-
if (f.isAnchor || !f.reachable || !f.canonicalPresent || f.canonicalName === void 0) {
|
|
5737
|
+
if (f.isAnchor || f.self === true || !f.reachable || !f.canonicalPresent || f.canonicalName === void 0) {
|
|
5695
5738
|
continue;
|
|
5696
5739
|
}
|
|
5697
5740
|
const repos = byCanonical.get(f.canonicalName) ?? [];
|
|
@@ -5709,6 +5752,7 @@ function summarizeSymlinkPlan(facts) {
|
|
|
5709
5752
|
const plans = [];
|
|
5710
5753
|
const conflicts = [];
|
|
5711
5754
|
const missingCanonical = [];
|
|
5755
|
+
const selfAgentsMissing = [];
|
|
5712
5756
|
const unreachable = [];
|
|
5713
5757
|
for (const f of deduped) {
|
|
5714
5758
|
if (f.isAnchor) continue;
|
|
@@ -5717,7 +5761,8 @@ function summarizeSymlinkPlan(facts) {
|
|
|
5717
5761
|
continue;
|
|
5718
5762
|
}
|
|
5719
5763
|
if (!f.canonicalPresent) {
|
|
5720
|
-
|
|
5764
|
+
if (f.self === true) selfAgentsMissing.push(f.path);
|
|
5765
|
+
else missingCanonical.push(f.path);
|
|
5721
5766
|
continue;
|
|
5722
5767
|
}
|
|
5723
5768
|
if (collidingPaths.has(f.path)) continue;
|
|
@@ -5744,9 +5789,10 @@ function summarizeSymlinkPlan(facts) {
|
|
|
5744
5789
|
plans,
|
|
5745
5790
|
conflicts,
|
|
5746
5791
|
missingCanonical,
|
|
5792
|
+
selfAgentsMissing,
|
|
5747
5793
|
unreachable,
|
|
5748
5794
|
collisions,
|
|
5749
|
-
ok: plans.length === 0 && conflicts.length === 0 && missingCanonical.length === 0 && unreachable.length === 0 && collisions.length === 0
|
|
5795
|
+
ok: plans.length === 0 && conflicts.length === 0 && missingCanonical.length === 0 && selfAgentsMissing.length === 0 && unreachable.length === 0 && collisions.length === 0
|
|
5750
5796
|
};
|
|
5751
5797
|
}
|
|
5752
5798
|
|
|
@@ -5757,6 +5803,7 @@ function isPublicFacing2(v) {
|
|
|
5757
5803
|
function summarizeWiring(facts) {
|
|
5758
5804
|
const risks = [];
|
|
5759
5805
|
const unknown = [];
|
|
5806
|
+
const self = [];
|
|
5760
5807
|
const incomplete = [];
|
|
5761
5808
|
const unreachable = [];
|
|
5762
5809
|
for (const f of facts) {
|
|
@@ -5764,7 +5811,9 @@ function summarizeWiring(facts) {
|
|
|
5764
5811
|
unreachable.push(f.path);
|
|
5765
5812
|
continue;
|
|
5766
5813
|
}
|
|
5767
|
-
if (
|
|
5814
|
+
if (f.self === true) {
|
|
5815
|
+
self.push(f.path);
|
|
5816
|
+
} else if (isPublicFacing2(f.visibility)) {
|
|
5768
5817
|
for (const file of f.instructionFiles) {
|
|
5769
5818
|
if (file.tracked) risks.push({ repo: f.path, visibility: f.visibility, file: file.name });
|
|
5770
5819
|
}
|
|
@@ -5778,6 +5827,7 @@ function summarizeWiring(facts) {
|
|
|
5778
5827
|
repos: facts,
|
|
5779
5828
|
risks,
|
|
5780
5829
|
unknown,
|
|
5830
|
+
self,
|
|
5781
5831
|
incomplete,
|
|
5782
5832
|
unreachable,
|
|
5783
5833
|
ok: risks.length === 0 && unknown.length === 0 && unreachable.length === 0
|
|
@@ -7644,6 +7694,7 @@ export {
|
|
|
7644
7694
|
chainEvents,
|
|
7645
7695
|
chainRawJsonLines,
|
|
7646
7696
|
classifyFilesBySourceRoot,
|
|
7697
|
+
classifyRetrofit,
|
|
7647
7698
|
classifySuspect,
|
|
7648
7699
|
claudeCodeAdapterMetadata,
|
|
7649
7700
|
claudeTranscriptToImportPayload,
|
|
@@ -7669,6 +7720,7 @@ export {
|
|
|
7669
7720
|
getSnapshot,
|
|
7670
7721
|
importSessionFromJson,
|
|
7671
7722
|
inspectChainTail,
|
|
7723
|
+
instructionMode,
|
|
7672
7724
|
isGitNotFound,
|
|
7673
7725
|
isImportDerivedSource,
|
|
7674
7726
|
isLazyExpired,
|