Skip to content

Commit a8a6502

Browse files
wip v28
1 parent f18c5db commit a8a6502

5 files changed

Lines changed: 118 additions & 61 deletions

File tree

BITCODE_V28_QA.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -821,14 +821,14 @@ Give path:
821821
5. In `Give-side supply`, confirm the auth/session label and inventory cards use `engineeredsoftware/*`. If any `frontier/*`, `gh_inst_bitcode_001`, or other protocol-demo repository appears in the live staging lane, stop and classify as a V28 blocker.
822822
6. In `Give-side supply`, use the search box only to filter connected repositories. Search must not replace live inventory with protocol demo artifacts. Select/confirm one repository card; the selected card should match the `Repository supply` selector.
823823
7. Click `Record give selection`. Confirm the UI reports that selected give-side supply was recorded.
824-
8. Run `v28_qa_terminal_02_activity_after_write` and `v28_qa_terminal_03_give_repository_alignment`. Confirm query 03 reports `frontier_count=0` for current repository inventory and `frontier_reference_detected=false` for recent Terminal give activity.
824+
8. Run `v28_qa_terminal_02_activity_after_write` and `v28_qa_terminal_04_give_repository_alignment`. Confirm query 04 reports `frontier_count=0` for current repository inventory and `frontier_reference_detected=false` for recent Terminal give activity.
825825
9. Confirm no model picker can affect ledgerized Give/Fit/AssetPack synthesis.
826826
10. In `Give + need chain`, inspect the `give` card and capture selected source entries, artifact kinds, repository row, provider account, addressing root, and auth root.
827827
11. Click `Record give posture`.
828828
12. Confirm the UI reports that give-side share posture was recorded.
829829
13. In Network, capture the `/api/executions/history` request and response. Expected status is `201`.
830830
14. Run `v28_qa_terminal_02_activity_after_write` and confirm an `executions_recent` row with `type='agentic-execution:asset-pack'`, `context_summary.source='terminal-give-need-workbench'`, `context_summary.workbench='give'`, and a non-empty `output_summary.give`.
831-
15. Rerun `v28_qa_terminal_03_give_repository_alignment`; recent Give activity must reference the connected repository and must not reference `frontier/*`.
831+
15. Rerun `v28_qa_terminal_04_give_repository_alignment`; recent Give activity must reference the connected repository and must not reference `frontier/*`.
832832
833833
Need path:
834834
@@ -864,7 +864,7 @@ Pass criteria:
864864
- Terminal activity history loads without a visible `/api/executions/history` error.
865865
- Live Terminal Give inventory references connected `engineeredsoftware/*` repositories, not protocol-demo `frontier/*` repositories.
866866
- Give, Need, and Fit record actions write user-scoped rows in that order and reread in query 02.
867-
- Query `v28_qa_terminal_03_give_repository_alignment` shows no `frontier_reference_detected` rows for recorded Terminal Give activity.
867+
- Query `v28_qa_terminal_04_give_repository_alignment` shows no `frontier_reference_detected` rows for recorded Terminal Give activity.
868868
- The Terminal activity UI shows those rows after refresh or activity reload.
869869
- Branch/settlement either progresses with explicit network and SQL evidence or fails closed with a precise blocker.
870870
- No Terminal control routes through Exchange or website Conversations.
@@ -1124,9 +1124,9 @@ Use `supabase/queries/v28_qa_terminal_02_activity_after_write.sql` after every `
11241124
11251125
Terminal Give source alignment:
11261126
1127-
Saved query name: `v28_qa_terminal_03_give_repository_alignment`
1127+
Saved query name: `v28_qa_terminal_04_give_repository_alignment`
11281128
1129-
Use `supabase/queries/v28_qa_terminal_03_give_repository_alignment.sql` after Terminal loads and after each Give recording. The query confirms live repository inventory belongs to the connected GitHub account and flags any protocol-demo `frontier/*` reference in recent Terminal Give activity.
1129+
Use `supabase/queries/v28_qa_terminal_04_give_repository_alignment.sql` after Terminal loads and after each Give recording. The query confirms live repository inventory belongs to the connected GitHub account and flags any protocol-demo `frontier/*` reference in recent Terminal Give activity.
11301130
11311131
BTD and ledger projection readback:
11321132

supabase/DATA_HEALTH.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ reusable checks:
127127
`supabase/queries/v28_qa_terminal_02_activity_after_write.sql` checks
128128
Terminal activity, execution events, pipeline rows, stream logs, and errors
129129
after each Terminal write action.
130-
- `v28_qa_terminal_03_give_repository_alignment`:
131-
`supabase/queries/v28_qa_terminal_03_give_repository_alignment.sql` confirms
130+
- `v28_qa_terminal_04_give_repository_alignment`:
131+
`supabase/queries/v28_qa_terminal_04_give_repository_alignment.sql` confirms
132132
the Terminal Give source is the connected GitHub repository inventory and
133133
flags any live-lane leakage from protocol demonstration `frontier/*` data.
134134
- `v28_qa_terminal_03_btd_ledger_after_terminal`:

supabase/queries/v28_qa_terminal_03_give_repository_alignment.sql renamed to supabase/queries/v28_qa_terminal_04_give_repository_alignment.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
-- Saved query name: v28_qa_terminal_03_give_repository_alignment
1+
-- Saved query name: v28_qa_terminal_04_give_repository_alignment
22
-- Purpose: run after the Terminal page loads, and again after "Record give
33
-- selection" or "Record give posture". It verifies live GitHub repository
44
-- inventory is the Give source and flags any protocol-demo frontier leakage.

uapi/app/terminal/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ Reusable Supabase query files for this pass live in `supabase/queries/`:
8080

8181
- `v28_qa_terminal_01_prerequisites_wallet_github_repo.sql`
8282
- `v28_qa_terminal_02_activity_after_write.sql`
83-
- `v28_qa_terminal_03_give_repository_alignment.sql`
8483
- `v28_qa_terminal_03_btd_ledger_after_terminal.sql`
84+
- `v28_qa_terminal_04_give_repository_alignment.sql`
8585

8686
Those queries are the operator evidence path for proving Terminal UI, API
8787
history, GitHub source inventory, and BTD ledger projections stay synchronized

uapi/app/terminal/TerminalSupplySelectionPanel.tsx

Lines changed: 109 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ export default function TerminalSupplySelectionPanel({
5656
() => selection?.filteredEntries.filter((entry) => entry.selected).slice(0, 6).map((entry) => entry.title) || [],
5757
[selection],
5858
);
59+
const selectedRepositoryId = repositoryContext?.selectedRepository?.id || '';
60+
const providerAccount =
61+
repositoryContext?.connectionStatus?.username ||
62+
repositoryContext?.connectionStatus?.metadata?.account ||
63+
repositoryContext?.selectedRepository?.owner.username ||
64+
'connected account';
5965

6066
const handleRecordSelection = async () => {
6167
if (!selection || !onRecordActivity) return;
@@ -73,13 +79,8 @@ export default function TerminalSupplySelectionPanel({
7379
}
7480
};
7581

76-
const selectRepositoryEntry = (entryId: string) => {
77-
if (!usesRepositoryContext || !repositoryContext) {
78-
void runControl((controls) => controls.toggleInventoryEntry?.(entryId));
79-
return;
80-
}
81-
82-
const repositoryId = entryId.replace(/^repository:/, '');
82+
const selectRepository = (repositoryId: string) => {
83+
if (!usesRepositoryContext || !repositoryContext) return;
8384
const repository = repositoryContext.repositories.find((candidate) => candidate.id === repositoryId);
8485
if (!repository) return;
8586

@@ -89,6 +90,15 @@ export default function TerminalSupplySelectionPanel({
8990
router.replace(buildTerminalHref(nextParams), { scroll: false });
9091
};
9192

93+
const selectRepositoryEntry = (entryId: string) => {
94+
if (!usesRepositoryContext || !repositoryContext) {
95+
void runControl((controls) => controls.toggleInventoryEntry?.(entryId));
96+
return;
97+
}
98+
99+
selectRepository(entryId.replace(/^repository:/, ''));
100+
};
101+
92102
if (!selection) {
93103
return (
94104
<TerminalWorkspaceCard
@@ -107,8 +117,12 @@ export default function TerminalSupplySelectionPanel({
107117
<TerminalWorkspaceCard
108118
id="terminalSupplySelection"
109119
kicker="Give-side supply"
110-
title="Search and select supply for the current give draft"
111-
summary="Bind the active auth session, narrow the available inventory, and keep only the supply you want in the current give draft before moving into deposit and need."
120+
title={usesRepositoryContext ? 'Choose the repository you are giving' : 'Search and select supply for the current give draft'}
121+
summary={
122+
usesRepositoryContext
123+
? 'Select one connected GitHub repository as the source boundary for this Give. The cards below are browseable inventory; the dropdown is the primary selection control.'
124+
: 'Bind the active auth session, narrow the available inventory, and keep only the supply you want in the current give draft before moving into deposit and need.'
125+
}
112126
explainer={TERMINAL_WORKSPACE_EXPLAINERS.supplyInventory}
113127
headerAside={
114128
<BitcodeMetricGrid
@@ -133,48 +147,82 @@ export default function TerminalSupplySelectionPanel({
133147

134148
<div className="mt-6 grid gap-4">
135149
<div className="grid gap-4 lg:grid-cols-3">
136-
<div className="rounded-[1.5rem] border border-white/8 bg-black/20 px-4 py-4">
137-
<span className="flex items-center gap-2 text-[0.66rem] uppercase tracking-[0.24em] text-neutral-400">
138-
<span>Auth session</span>
139-
<BitcodeInlineExplainer explainer={TERMINAL_INLINE_EXPLAINERS.authSession} />
140-
</span>
141-
<select
142-
value={selection.selectedAuthSessionId}
143-
onChange={(event) => {
144-
if (usesRepositoryContext) return;
145-
void runControl((controls) => controls.setAuthSession?.(event.target.value));
146-
}}
147-
disabled={usesRepositoryContext || selection.authSessions.length <= 1}
148-
className="mt-3 w-full rounded-xl border border-white/10 bg-[rgba(10,15,30,0.88)] px-3 py-3 text-sm text-white outline-none transition focus:border-emerald-400/40"
149-
>
150-
{selection.authSessions.map((option) => (
151-
<option key={option.value} value={option.value}>
152-
{option.label}
153-
</option>
154-
))}
155-
</select>
156-
</div>
150+
{usesRepositoryContext && repositoryContext ? (
151+
<div className="rounded-[1.5rem] border border-emerald-400/18 bg-emerald-400/10 px-4 py-4">
152+
<span className="flex items-center gap-2 text-[0.66rem] uppercase tracking-[0.24em] text-emerald-200/85">
153+
<span>Repository to give</span>
154+
<BitcodeInlineExplainer explainer={TERMINAL_INLINE_EXPLAINERS.providerRepository} />
155+
</span>
156+
<select
157+
value={selectedRepositoryId}
158+
onChange={(event) => selectRepository(event.target.value)}
159+
className="mt-3 w-full rounded-xl border border-emerald-300/20 bg-[rgba(10,15,30,0.92)] px-3 py-3 text-sm text-white outline-none transition focus:border-emerald-300/50"
160+
>
161+
{repositoryContext.repositories.map((repository) => (
162+
<option key={repository.id} value={repository.id}>
163+
{repository.fullName}
164+
</option>
165+
))}
166+
</select>
167+
</div>
168+
) : (
169+
<div className="rounded-[1.5rem] border border-white/8 bg-black/20 px-4 py-4">
170+
<span className="flex items-center gap-2 text-[0.66rem] uppercase tracking-[0.24em] text-neutral-400">
171+
<span>Auth session</span>
172+
<BitcodeInlineExplainer explainer={TERMINAL_INLINE_EXPLAINERS.authSession} />
173+
</span>
174+
<select
175+
value={selection.selectedAuthSessionId}
176+
onChange={(event) => {
177+
void runControl((controls) => controls.setAuthSession?.(event.target.value));
178+
}}
179+
disabled={selection.authSessions.length <= 1}
180+
className="mt-3 w-full rounded-xl border border-white/10 bg-[rgba(10,15,30,0.88)] px-3 py-3 text-sm text-white outline-none transition focus:border-emerald-400/40"
181+
>
182+
{selection.authSessions.map((option) => (
183+
<option key={option.value} value={option.value}>
184+
{option.label}
185+
</option>
186+
))}
187+
</select>
188+
</div>
189+
)}
157190

158191
<div className="rounded-[1.5rem] border border-white/8 bg-black/20 px-4 py-4">
159-
<span className="flex items-center gap-2 text-[0.66rem] uppercase tracking-[0.24em] text-neutral-400">
160-
<span>{usesRepositoryContext ? 'Supply kind' : 'Artifact kind'}</span>
161-
<BitcodeInlineExplainer explainer={TERMINAL_INLINE_EXPLAINERS.artifactKind} />
162-
</span>
163-
<select
164-
value={selection.selectedKind}
165-
onChange={(event) => {
166-
if (usesRepositoryContext) return;
167-
void runControl((controls) => controls.setInventoryKind?.(event.target.value));
168-
}}
169-
disabled={usesRepositoryContext}
170-
className="mt-3 w-full rounded-xl border border-white/10 bg-[rgba(10,15,30,0.88)] px-3 py-3 text-sm text-white outline-none transition focus:border-emerald-400/40"
171-
>
172-
{selection.kindOptions.map((option) => (
173-
<option key={option.value} value={option.value}>
174-
{option.label}
175-
</option>
176-
))}
177-
</select>
192+
{usesRepositoryContext ? (
193+
<>
194+
<span className="flex items-center gap-2 text-[0.66rem] uppercase tracking-[0.24em] text-neutral-400">
195+
<span>Giving from</span>
196+
<BitcodeInlineExplainer explainer={TERMINAL_INLINE_EXPLAINERS.authSession} />
197+
</span>
198+
<div className="mt-3 rounded-xl border border-white/10 bg-white/5 px-3 py-3 text-sm text-neutral-100">
199+
<p>{providerAccount}</p>
200+
<p className="mt-1 text-[0.68rem] uppercase tracking-[0.18em] text-neutral-500">
201+
GitHub · repository source
202+
</p>
203+
</div>
204+
</>
205+
) : (
206+
<>
207+
<span className="flex items-center gap-2 text-[0.66rem] uppercase tracking-[0.24em] text-neutral-400">
208+
<span>Artifact kind</span>
209+
<BitcodeInlineExplainer explainer={TERMINAL_INLINE_EXPLAINERS.artifactKind} />
210+
</span>
211+
<select
212+
value={selection.selectedKind}
213+
onChange={(event) => {
214+
void runControl((controls) => controls.setInventoryKind?.(event.target.value));
215+
}}
216+
className="mt-3 w-full rounded-xl border border-white/10 bg-[rgba(10,15,30,0.88)] px-3 py-3 text-sm text-white outline-none transition focus:border-emerald-400/40"
217+
>
218+
{selection.kindOptions.map((option) => (
219+
<option key={option.value} value={option.value}>
220+
{option.label}
221+
</option>
222+
))}
223+
</select>
224+
</>
225+
)}
178226
</div>
179227

180228
<div className="rounded-[1.5rem] border border-white/8 bg-black/20 px-4 py-4">
@@ -202,8 +250,9 @@ export default function TerminalSupplySelectionPanel({
202250
<BitcodeInlineExplainer explainer={TERMINAL_WORKSPACE_EXPLAINERS.giveNeedChain} />
203251
</div>
204252
<p className="mt-3 text-sm leading-6 text-neutral-300">
205-
Selected supply stays attached to the current give flow. Continue into Give when you are ready to describe
206-
issuer, provenance, and intent.
253+
{usesRepositoryContext
254+
? 'The selected repository is the source boundary for this Give. Record the selection, then continue when you are ready to describe issuer, provenance, and intent.'
255+
: 'Selected supply stays attached to the current give flow. Continue into Give when you are ready to describe issuer, provenance, and intent.'}
207256
</p>
208257
{selectedEntryLabels.length ? (
209258
<BitcodeChipCloud
@@ -232,6 +281,14 @@ export default function TerminalSupplySelectionPanel({
232281
</div>
233282
</div>
234283

284+
{usesRepositoryContext ? (
285+
<div className="mt-6 flex items-center justify-between gap-3">
286+
<p className="text-[0.68rem] uppercase tracking-[0.24em] text-neutral-500">Connected repository inventory</p>
287+
<p className="text-sm text-neutral-300">
288+
{selection.filteredCount} of {selection.totalFilteredEntries} repositories
289+
</p>
290+
</div>
291+
) : null}
235292
<div className="mt-6 grid gap-3 md:grid-cols-2 xl:grid-cols-3">
236293
{selection.filteredEntries.map((entry) => (
237294
<button
@@ -258,7 +315,7 @@ export default function TerminalSupplySelectionPanel({
258315
: 'border-white/10 bg-white/5 text-neutral-200'
259316
}`}
260317
>
261-
{entry.selected ? 'selected' : 'available'}
318+
{entry.selected ? (usesRepositoryContext ? 'selected for give' : 'selected') : (usesRepositoryContext ? 'choose repository' : 'available')}
262319
</span>
263320
</div>
264321
{entry.subtitle ? <p className="mt-3 text-sm leading-6 text-neutral-300">{entry.subtitle}</p> : null}

0 commit comments

Comments
 (0)