Skip to content

Commit 0fb6c08

Browse files
wip v28
1 parent 6bdf132 commit 0fb6c08

8 files changed

Lines changed: 130 additions & 7 deletions

BITCODE_LIGHTPAPER.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Bitcode: Lightpaper
2+
3+
Bitcodes, or "*source shares*", are divisible units of measurable intelligence maintained on-chain.
4+
5+
The **Bitcode Protocol** describes the systems that A. deterministically measure any material for its Bitcodes, B. prove, journal, and ledgerize all activity and finalities, and C. practically integrate into external industrial workflows for knowledge asset inflows and distributions and system interfacing.
6+
7+
## Divisibility, Measuring, Minting, Assets
8+
9+
### Semantic Indivisibility
10+
11+
### Synthetic Measurements
12+
13+
### Minting BTD-AssetPacks
14+
15+
## Determinism, Proofs, Audits, Security
16+
17+
### Models, Training, Inference
18+
19+
### Proofs
20+
21+
### Auditibility
22+
23+
### Reliability, Security
24+
25+
## Interfaces, Integrations
26+
27+
### Bitcoin, Taproot
28+
29+
### Cryptographic Wallets
30+
31+
### Version Control Systems
32+
33+
### Website Application
34+
35+
### MCP API
36+
37+
### Chat Applications
38+

BITCODE_SPEC_V28.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ Acceptance criteria:
214214
- Exchange MVP activity/search/detail route renders without homepage redirects or disabled navigation.
215215
- signed-in navigation shows BTC and BTD balances as peer wallet facts, without `$BTD` currency-token styling, with a distinct visual separator, and with hover context reserved for recent BTD AssetPacks rather than explanatory product copy.
216216
- connected-wallet navigation is driven by wallet identity, not only by email/Supabase user state; a locally staged Bitcoin provider connection must replace anonymous `Connect Wallet` chrome with BTC/BTD posture while backend persistence is still pending.
217+
- Connects visibility is driven by wallet identity or an existing user session; once Profile has staged a Bitcoin wallet, Connects must render GitHub connection controls even when optional email/Supabase session persistence is still pending.
217218
- top-right BTD hover action shows the connected wallet nickname when available and otherwise shows the middle-truncated Bitcoin address; clicking it opens the `$BTD` wallet auxillary pane rather than treating the balance widget as an Exchange shortcut.
218219
- Profile owns Bitcoin wallet identity, robust wallet-provider readout, and optional email notification posture; Connects owns GitHub connection and future VCS/provider attachments.
219220
- V28 verbose QA telemetry may log wallet detection, wallet signing, local/server persistence, user-data merge, nav identity state, and BTD wallet pane entry behind `NEXT_PUBLIC_BITCODE_QA_VERBOSE=true`, `NEXT_PUBLIC_BITCODE_VERBOSE=true`, `?bitcode_verbose=true`, or `localStorage.bitcode.qa.verbose=true`.

BITCODE_SPEC_V28_NOTES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ Profile must not render GitHub connection controls; it may point the operator to
205205
Connects owns GitHub because repository scope is shared by Terminal, Exchange rereads, conversations, and future interfaces.
206206
The top chrome must use wallet identity as a sufficient signed posture for BTC/BTD balance display even before Supabase/email identity is present.
207207
The BTD tracker hover/action area now identifies the connected wallet and opens the `$BTD` auxillary pane.
208+
Connects must use that same wallet identity as a sufficient prerequisite to render GitHub connection controls; optional email/Supabase session state may improve persistence and notifications, but must not hide the second onboarding step after Bitcoin wallet identity is staged.
208209
Verbose QA telemetry is allowed behind explicit flags so local testnet passes can observe provider detection, Leather/Xverse signing, local wallet persistence, user-data merge, navigation identity, and BTD auxillary entry without making normal production consoles noisy.
209210

210211
These changes remain V28 scope because they are MVP-readiness and trust issues.

BITCODE_SPEC_V28_PARITY_MATRIX.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ Audit query classes:
144144
| Canon posture | V27 active / V28 draft in source posture carriers | closed |
145145
| Routes | unversioned UAPI route scan passes | closed |
146146
| Commercial app QA | primary route, auth, Auxillaries, Exchange, BTD range, conversations, docs article map, responsive health, URL-addressable filters, consent persistence, and stitched navigation/interaction E2E coverage | closed for expanded automated commercial MVP E2E baseline |
147-
| Auxillaries shell | contained tabs-left active experience without orbital layout collision, no visible auxillary Save buttons, stable first-open pane scroll, top-right overlay controls, no notification-footer Auxillaries launcher, wallet-first Profile order, GitHub-second source-provider order, optional-email-third posture, consistent mock/non-mock pane order, and BTD pane activity/table readability | pending manual reconfirmation after May 9 source fixes |
147+
| Auxillaries shell | contained tabs-left active experience without orbital layout collision, no visible auxillary Save buttons, stable first-open pane scroll, top-right overlay controls, no notification-footer Auxillaries launcher, wallet-first Profile order, GitHub-second source-provider order, Connects rendering from wallet identity before optional email/Supabase persistence, optional-email-third posture, consistent mock/non-mock pane order, and BTD pane activity/table readability | pending manual reconfirmation after May 9 source fixes |
148148
| Exchange MVP | activity/search/detail/range-acquisition route readiness | closed for master-detail MVP |
149149
| Terminal master-detail correction | Terminal must present itself as a Give/Need operator surface with recent/scoped activity results while Exchange owns the searchable master-detail activity table and selected detail | closed pending next manual QA confirmation |
150150
| Terminal clickable affordance | Known no-op or ambiguous click targets must be fixed, and clickable controls must be visually distinguishable from static badges/chips | partial; digest detail buttons and static overview badges corrected, broader manual pass remains |

BITCODE_V28_QA.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ Automated verification after this implementation pass:
330330
- `pnpm -C uapi run build`: pass after the May 9 QA fixes; the prior clean-clone Vercel module-resolution failure remains fixed locally.
331331
- Playwright non-mock browser smoke after the May 9 patch: `Connect Wallet` opens the contained Auxillaries shell, selector order is `Connects`, `Interfaces`, `Profile`, `$BTD`, old-ring count is `0`, Google prerequisite copy is absent, MetaMask and GitHub are present, no visible Save/Continue buttons remain, Profile first-open scroll advances, and no console/page errors occur.
332332
- May 9 live Leather QA: wallet connection persisted, but follow-up findings required V28 fixes for wallet-authenticated nav chrome, Profile/Connects ownership, robust connected-wallet readout, Sign Out button styling, BTD tracker wallet identity action, and verbose console telemetry. Source now treats local Bitcoin wallet identity as sufficient chrome identity while backend persistence catches up; Profile owns wallet/profile/email only; Connects owns GitHub; the BTD tracker opens the `$BTD` auxillary pane; and verbose QA logs are gated behind `NEXT_PUBLIC_BITCODE_QA_VERBOSE=true`, `NEXT_PUBLIC_BITCODE_VERBOSE=true`, `?bitcode_verbose=true`, or `localStorage.bitcode.qa.verbose=true`.
333+
- May 9 follow-up QA found Connects still showing the old signed-in blocker after the Bitcoin wallet was correctly connected. V28 fixes Connects to render GitHub controls from wallet identity or email session, so Profile wallet completion can progress directly into repository connection without waiting on optional email/Supabase persistence.
333334
- `pnpm -C uapi exec tsc --noEmit --pretty false`: pass after the formal protocol package split.
334335
- `pnpm -C uapi run test:e2e:commercial-mvp`: 50 passed after Conversations streaming, Conversations exit, and Terminal transaction-search stabilization.
335336
- `npm --prefix protocol-demonstration run test:integration`: 58 passed after standalone demonstration/package-boundary cleanup.

uapi/app/auxillaries/components/AuxillariesConnectsPane.tsx

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { VCSIntegrationPanel } from '@/components/base/bitcode/vcs/VCSIntegratio
88
import { getRepositoryInventorySourceLabel } from '@/app/terminal/terminal-repository-context';
99
import { deriveBitcodeTransactionReadiness } from '@/app/terminal/bitcode-transaction-readiness';
1010
import { useUserData } from '@/hooks/useUserData';
11+
import { bitcodeQaTelemetry } from '../../../lib/bitcode-qa-telemetry';
1112

1213
import AuxillariesConnectsPaneHeader from '@/app/auxillaries/components/headers/AuxillariesConnectsPaneHeader';
1314

@@ -41,12 +42,38 @@ export default function AuxillariesConnectsPane({
4142
refresh,
4243
} = useUserData();
4344

45+
const hasConnectsIdentity = Boolean(user || hasWalletConnection);
46+
47+
useEffect(() => {
48+
onCompletionStatusChange?.(Boolean(hasConnectsIdentity && hasValidGitHubConnection));
49+
}, [hasConnectsIdentity, hasValidGitHubConnection, onCompletionStatusChange]);
50+
4451
useEffect(() => {
45-
onCompletionStatusChange?.(Boolean(user && hasValidGitHubConnection));
46-
}, [hasValidGitHubConnection, onCompletionStatusChange, user]);
52+
bitcodeQaTelemetry('info', 'auxillaries.connects', 'readiness', {
53+
hasEmailSession: Boolean(user),
54+
hasWalletConnection,
55+
hasConnectsIdentity,
56+
hasGitHubConnection,
57+
hasValidGitHubConnection,
58+
walletBindingStatus,
59+
walletProvider: walletConnectionStatus?.provider ?? null,
60+
repositoryProvider: repositoryConnectionStatus?.provider ?? null,
61+
repositoryValid: repositoryConnectionStatus?.valid ?? null,
62+
});
63+
}, [
64+
hasConnectsIdentity,
65+
hasGitHubConnection,
66+
hasValidGitHubConnection,
67+
hasWalletConnection,
68+
repositoryConnectionStatus?.provider,
69+
repositoryConnectionStatus?.valid,
70+
user,
71+
walletBindingStatus,
72+
walletConnectionStatus?.provider,
73+
]);
4774

4875
const transactionReadiness = deriveBitcodeTransactionReadiness({
49-
signedIn: Boolean(user),
76+
signedIn: hasConnectsIdentity,
5077
hasRepositoryProvider: hasGitHubConnection,
5178
hasValidRepositoryProvider: hasValidGitHubConnection,
5279
hasWalletBinding: hasWalletConnection,
@@ -59,12 +86,14 @@ export default function AuxillariesConnectsPane({
5986
<div className="orbital-step-content connects-step">
6087
<AuxillariesConnectsPaneHeader isOnboardingComplete={isOnboardingComplete} />
6188

62-
{!user ? (
89+
{!hasConnectsIdentity ? (
6390
<div className="space-y-4 rounded-[24px] border border-white/10 bg-black/20 p-5 text-white/80">
6491
<div className="space-y-2">
65-
<h3 className="text-lg font-semibold text-white">Sign in to open Connects</h3>
92+
<h3 className="text-lg font-semibold text-white">Connect Bitcoin wallet first</h3>
6693
<p className="text-sm leading-7 text-white/68">
67-
Sign in first, then attach GitHub so need measurement, asset-pack synthesis, and settlement follow-through can operate against a live repository source.
94+
Connect a Bitcoin-capable wallet in Profile, then attach GitHub here so need
95+
measurement, asset-pack synthesis, and settlement follow-through can operate
96+
against a live repository source.
6897
</p>
6998
</div>
7099

uapi/jest.config.cjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ module.exports = {
107107
'<rootDir>/tests/featureFlagsMockMode.test.ts',
108108
'<rootDir>/tests/bitcoinWalletClient.test.ts',
109109
'<rootDir>/tests/auxillariesWorkspacePanels.test.tsx',
110+
'<rootDir>/tests/auxillariesConnectsPane.test.tsx',
110111
'<rootDir>/tests/btdTrackerLoading.test.tsx',
111112
'<rootDir>/tests/notificationsWidget.test.tsx',
112113
'<rootDir>/tests/orbitalsBTDPane.test.tsx',

uapi/tests/auxillariesConnectsPane.test.tsx

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,58 @@ describe('AuxillariesConnectsPane', () => {
168168
expect(screen.getByText(/write admission will fail closed until the live provider connection is restored/i)).toBeInTheDocument();
169169
});
170170

171+
it('renders GitHub connection controls from wallet identity before optional email session exists', () => {
172+
mockUseAuth.mockReturnValue({
173+
user: null,
174+
loading: false,
175+
} as any);
176+
177+
mockUseUserData.mockReturnValue({
178+
data: {
179+
profile: {
180+
wallet_address: 'tb1qleatheroperator',
181+
wallet_provider: 'leather',
182+
},
183+
},
184+
hasGitHubConnection: false,
185+
hasValidGitHubConnection: false,
186+
hasWalletConnection: true,
187+
hasStoredVerifiedWalletConnection: false,
188+
hasVerifiedWalletConnection: false,
189+
walletBindingStatus: 'pending',
190+
walletConnectionStatus: {
191+
connected: true,
192+
provider: 'leather',
193+
valid: true,
194+
address: 'tb1qleatheroperator',
195+
verificationState: 'pending',
196+
},
197+
repositoryConnectionStatus: null,
198+
repositories: [],
199+
repositoryInventorySource: null,
200+
organizations: [],
201+
btdBalance: 0,
202+
isLoading: false,
203+
error: null,
204+
refresh: jest.fn(),
205+
isOnboardingComplete: false,
206+
onboardedSteps: ['profile'],
207+
} as any);
208+
209+
render(
210+
<AuxillariesConnectsPane
211+
onSave={jest.fn()}
212+
loading={false}
213+
isOnboardingComplete={false}
214+
/>,
215+
);
216+
217+
expect(screen.getByText('Connect GitHub for source-bearing input')).toBeInTheDocument();
218+
expect(screen.getByTestId('mock-vcs-integration-panel')).toBeInTheDocument();
219+
expect(screen.queryByText(/Sign in to open Connects/i)).not.toBeInTheDocument();
220+
expect(screen.queryByText(/Connect Bitcoin wallet first/i)).not.toBeInTheDocument();
221+
});
222+
171223
it('treats a saved verified wallet signer without a live wallet-provider session as reconnect-required settlement posture', () => {
172224
mockUseUserData.mockReturnValue({
173225
data: {

0 commit comments

Comments
 (0)