@sanity/ailf-studio 0.1.26 → 0.2.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Sanity.io
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/index.d.ts CHANGED
@@ -7,22 +7,24 @@ import { DocumentRef } from './document-ref.js';
7
7
  * actions/GraduateToNativeAction.tsx
8
8
  *
9
9
  * Sanity Studio document action that "graduates" a mirrored task to
10
- * a native task by removing the `origin` field.
10
+ * a native (Studio-owned) task by changing the `ownership` field from
11
+ * "repo" to "studio".
11
12
  *
12
- * This is a one-way, irreversible operation. Once graduated:
13
+ * This is a one-way operation. Once graduated:
13
14
  * - The task becomes fully editable in Studio
14
- * - Future pipeline mirror syncs will NOT overwrite it (the mirror
15
- * uses createOrReplace with the same _id, but since origin is gone,
16
- * the document-level readOnly check returns false and the task
17
- * behaves like any other native task)
15
+ * - Future pipeline mirror syncs will skip this document (the mirror
16
+ * step checks `ownership` and skips documents with `ownership: "studio"`)
17
+ * - The `origin` field is preserved as provenance — you can always
18
+ * see where the task originally came from
18
19
  * - The task's _id is unchanged — it keeps the mirror prefix
19
20
  * (ailf.task.mirror.*) but that's just an ID string, not a
20
21
  * behavioral marker
21
22
  *
22
- * The action only appears on ailf.task documents that have an `origin`
23
- * field (i.e., mirrored tasks). Native tasks never see it.
23
+ * The action only appears on ailf.task documents that have
24
+ * `ownership: "repo"` (i.e., active mirrors). Native tasks and
25
+ * already-graduated tasks never see it.
24
26
  *
25
- * @see docs/exec-plans/tasks-as-content/phase-5-content-lake-mirroring.md
27
+ * @see docs/exec-plans/task-lifecycle/phase-1-ownership.md
26
28
  */
27
29
 
28
30
  declare const GraduateToNativeAction: DocumentActionComponent;
@@ -75,15 +77,29 @@ declare function ReleasePicker(props: StringInputProps): react_jsx_runtime.JSX.E
75
77
  /**
76
78
  * components/MirrorBanner.tsx
77
79
  *
78
- * Informational banner shown at the top of mirrored task documents.
79
- * Communicates that the task is managed in an external repo and links
80
- * to the source file on GitHub.
80
+ * Informational banner shown at the top of task documents that have
81
+ * origin provenance (both active mirrors and graduated tasks).
81
82
  *
82
- * Paired with `SyncStatusBadge` to show both the source and freshness
83
- * of the mirror.
83
+ * For active mirrors (`ownership: "repo"`): communicates that the task
84
+ * is managed in an external repo and links to the source file on GitHub.
84
85
  *
85
- * @see docs/exec-plans/tasks-as-content/phase-5-content-lake-mirroring.md
86
+ * For graduated tasks (`ownership: "studio"` with origin): shows
87
+ * provenance info about where the task originally came from.
88
+ *
89
+ * Paired with `SyncStatusBadge` to show sync freshness for active mirrors.
90
+ *
91
+ * @see docs/exec-plans/task-lifecycle/phase-1-ownership.md
86
92
  */
93
+ interface GitAuthorInfo {
94
+ gitName?: string;
95
+ gitEmail?: string;
96
+ githubUsername?: string;
97
+ }
98
+ interface GraduatedByInfo {
99
+ sanityId?: string;
100
+ name?: string;
101
+ email?: string;
102
+ }
87
103
  interface MirrorBannerProps {
88
104
  origin: {
89
105
  repo?: string;
@@ -93,9 +109,15 @@ interface MirrorBannerProps {
93
109
  branch?: string;
94
110
  commitSha?: string;
95
111
  lastSyncedAt?: string;
112
+ author?: GitAuthorInfo;
113
+ lastEditor?: GitAuthorInfo;
114
+ graduatedAt?: string;
115
+ graduatedBy?: GraduatedByInfo;
96
116
  };
117
+ /** Task ownership — "repo" for active mirrors, "studio" for graduated */
118
+ ownership?: string;
97
119
  }
98
- declare function MirrorBanner({ origin }: MirrorBannerProps): react_jsx_runtime.JSX.Element;
120
+ declare function MirrorBanner({ origin, ownership }: MirrorBannerProps): react_jsx_runtime.JSX.Element;
99
121
 
100
122
  /**
101
123
  * components/SyncStatusBadge.tsx
@@ -227,6 +249,18 @@ declare const GLOSSARY: {
227
249
  readonly change: "Whether the change is meaningful: improved, regressed, or unchanged (within the noise threshold).";
228
250
  readonly lowScoringJudgments: "The grading model's explanations for tests that scored below 70/100.";
229
251
  readonly judgmentReason: "The grading model's natural language explanation of what went wrong.";
252
+ readonly healthStrong: "Feature areas scoring 80 or above. The docs are working well for these features — AI agents produce correct, complete implementations.";
253
+ readonly healthAttention: "Feature areas scoring 70–79. These are okay but could be improved — there may be gaps in specific dimensions like doc coverage or code correctness.";
254
+ readonly healthWeak: "Feature areas scoring below 70. The docs are not providing enough support for AI agents to implement these features correctly.";
255
+ readonly negativeDocLiftMetric: "Number of areas where the documentation actually hurts AI performance — the model scores higher without docs than with them. This usually means the docs contain outdated patterns or incorrect examples.";
256
+ readonly weakAreas: "Feature areas where the overall score is below 70. These need the most attention — low scores mean AI agents consistently struggle to implement these features.";
257
+ readonly docsHurt: "Areas where the floor score (no docs) is higher than the ceiling score (with docs). The documentation is actively misleading the model. These docs need to be rewritten or removed.";
258
+ readonly retrievalIssues: "Areas where AI agents can find less than 70% of the available doc quality. The docs exist and are good, but agents can't discover them through search. Consider improving page titles, metadata, or search engine indexing.";
259
+ readonly dimWeaknesses: "Individual grading dimensions scoring below 50 within an area. These are the specific skills where AI agents fail most — task completion (can it build the feature?), code correctness (is the code right?), or doc coverage (did it use the docs?).";
260
+ readonly efficiencyAnomalies: "Areas where agent efficiency exceeds 100% — meaning agents perform better with self-found docs than with gold-standard docs injected directly. This can indicate doc quality issues (injected docs confuse the model) or agent memorization.";
261
+ readonly docLiftWins: "Areas where documentation boosts AI performance by 5 or more points. Higher doc lift means the docs are providing crucial information that the model doesn't already know.";
262
+ readonly retrievalExcellence: "Areas where AI agents successfully find and use at least 85% of the available doc quality through web search. Good retrieval means your docs are well-indexed and easy for agents to discover.";
263
+ readonly strengths: "What's working well: high-scoring areas, dimensions where the docs are strong, and areas where AI agents successfully find and use the documentation.";
230
264
  readonly recommendations: "Prioritized remediation plan from gap analysis. Each recommendation identifies a documentation problem, the affected feature area, and the estimated score lift from fixing it.";
231
265
  readonly totalPotentialLift: "Aggregate potential score lift if all identified gaps were fixed. This is a conservative estimate — each gap targets the median of non-bottlenecked dimensions, not 100.";
232
266
  readonly failureMode: "The type of documentation problem: missing-docs (functionality not covered), incorrect-docs (factual errors), outdated-docs (stale API/patterns), or poor-structure (hard to find/understand).";
@@ -468,6 +502,8 @@ declare const taskSchema: {
468
502
  description: string;
469
503
  id: string;
470
504
  origin: string;
505
+ ownership: string;
506
+ status: string;
471
507
  }, Record<string, unknown>> | undefined;
472
508
  };
473
509