Skip to content

Commit fed7c58

Browse files
committed
pre realease v13
1 parent 96dfdf9 commit fed7c58

5 files changed

Lines changed: 39 additions & 54 deletions

File tree

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "ripple",
33
"displayName": "Ripple — Local Authorization Gate",
44
"description": "VS Code interface for Ripple's local authorization gate: live context, focus files, blast-radius signals, and safer AI-agent workflow prompts.",
5-
"version": "1.0.12",
5+
"version": "1.0.13",
66
"publisher": "rippleai",
77
"author": {
88
"name": "Raushan Soni"

‎packages/cli/package.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@getripple/cli",
3-
"version": "1.0.12",
3+
"version": "1.0.13",
44
"description": "CLI, Git hook, and CI enforcer for Ripple's local authorization gate for AI coding agents.",
55
"license": "MIT",
66
"type": "commonjs",
@@ -44,7 +44,7 @@
4444
"build": "tsc -p tsconfig.json"
4545
},
4646
"dependencies": {
47-
"@getripple/core": "^1.0.12"
47+
"@getripple/core": "^1.0.13"
4848
},
4949
"devDependencies": {
5050
"@types/node": "^18.0.0",

‎packages/cli/src/index.ts‎

Lines changed: 33 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,6 +1089,13 @@ function intentLoadFailureMessage(intentRef: string, error: unknown): string {
10891089
].join(" ");
10901090
}
10911091

1092+
function errorMessage(error: unknown): string {
1093+
if (error instanceof Error) {
1094+
return error.message;
1095+
}
1096+
return String(error);
1097+
}
1098+
10921099
function defaultCiBaseRef(): string {
10931100
const githubBaseRef = process.env.GITHUB_BASE_REF?.trim();
10941101
if (githubBaseRef) {
@@ -4254,8 +4261,6 @@ async function auditCommand(options: CliOptions): Promise<void> {
42544261
}
42554262
applyStrictExit(options.strict && strictAuditShouldFail(audit));
42564263
}
4257-
// in: ripple-main/packages/cli/src/index.ts
4258-
// REPLACE THE ENTIRE OLD `gateCommand` FUNCTION WITH THIS:
42594264

42604265
async function gateCommand(options: CliOptions): Promise<void> {
42614266
if (selectedChangeModeCount(options) > 1) {
@@ -4309,59 +4314,21 @@ async function gateCommand(options: CliOptions): Promise<void> {
43094314
fs.renameSync(intentPath, consumedIntentCachePath);
43104315
console.log("\n[Ripple] Intent validated and consumed by gate. Ready for commit.");
43114316
} catch (err) {
4312-
const errorDetail = err instanceof Error ? err.message : String(err);
4317+
// Use the 'errorMessage' helper we created earlier
4318+
const errorDetail = errorMessage(err);
43134319
console.warn(`[Ripple] CRITICAL WARNING: Could not consume intent file. To prevent a future 'ghost intent' block, manually delete '${intentPath}' after your commit. Error: ${errorDetail}`);
43144320
}
43154321
}
43164322

4317-
// Sync a redacted, privacy-safe audit receipt to the cloud.
4318-
if (process.env.RIPPLE_API_KEY) {
4319-
const cloudDecision: "continue" | "human-review" | "blocked" =
4320-
gate.canContinue ? "continue" :
4321-
gate.needsHuman ? "human-review" : "blocked";
4322-
4323-
const commitSha = options.sha ?? getCurrentCommitSha(execSync);
4324-
const branch = getCurrentBranch(execSync);
4325-
const actor = getCurrentActor(execSync);
4323+
// NO CLOUD SYNC BLOCK HERE. This is the fix.
4324+
// The local gate's only job is to block or allow the commit locally.
4325+
// The CI job is the sole authority for the cloud audit trail.
43264326

4327-
const redactedPayload = {
4328-
decision: gate.decision,
4329-
status: gate.status,
4330-
risk: {
4331-
level: gate.risk.level,
4332-
score: gate.risk.score,
4333-
summary: gate.risk.summary,
4334-
},
4335-
auditStatus: audit.status,
4336-
approvalStatus: audit.approvalStatus.status,
4337-
intent: audit.intent,
4338-
mode: audit.mode,
4339-
baseRef: audit.baseRef,
4340-
blockingReasons: audit.blockingReasons,
4341-
};
4327+
applyStrictExit(options.strict && !gate.canContinue);
4328+
}
43424329

4343-
const cloudResult = await syncAuditToCloud({
4344-
intentId: audit.intent.id,
4345-
decision: cloudDecision,
4346-
commitSha,
4347-
branch,
4348-
actor,
4349-
source: "cli",
4350-
payload: redactedPayload,
4351-
});
43524330

4353-
if (cloudResult.sent) {
4354-
const icon = cloudDecision === "continue" ? "✓" : "⛔";
4355-
console.log(
4356-
`\n[Ripple Cloud] ${icon} Gate decision recorded: ${cloudDecision} (${commitSha.slice(0, 7)})`
4357-
);
4358-
} else if (cloudResult.error) {
4359-
console.warn(`\n[Ripple Cloud] ⚠ Sync failed (non-blocking): ${cloudResult.error}`);
4360-
}
4361-
}
43624331

4363-
applyStrictExit(options.strict && !gate.canContinue);
4364-
}
43654332
function approveCommand(options: CliOptions): void {
43664333
const workspaceRoot = resolveWorkspaceRoot(".");
43674334
const intentRef = options.intent ?? "latest";
@@ -4473,6 +4440,7 @@ function currentChangeSnapshotForVerification(
44734440
}
44744441
}
44754442

4443+
44764444
function verificationSnapshotScope(intent: ChangeIntent): Set<string> {
44774445
return new Set(
44784446
[
@@ -4631,7 +4599,24 @@ async function ciCommand(options: CliOptions): Promise<void> {
46314599
}
46324600
writeGithubPolicyAuditStepSummary(summary, policySync);
46334601

4634-
// Policy-only audits do not block the build unless strict mode is on.
4602+
// Sync a receipt so the webhook can verify this commit even in policy-only mode.
4603+
if (process.env.RIPPLE_API_KEY) {
4604+
const branch = getCurrentBranch(execSync);
4605+
const actor = getCurrentActor(execSync);
4606+
const cloudResult = await syncAuditToCloud({
4607+
intentId: `ci-policy-${commitSha.slice(0, 16)}`,
4608+
decision: 'continue',
4609+
commitSha,
4610+
branch,
4611+
actor,
4612+
source: 'ci',
4613+
payload: { mode: 'policy-audit', commitSha, branch, actor },
4614+
});
4615+
if (cloudResult.sent) {
4616+
console.log(`[Ripple Cloud] ✓ Policy audit synced (${commitSha.slice(0, 7)})`);
4617+
}
4618+
}
4619+
46354620
applyStrictExit(options.strict && summary.requiresAttention);
46364621
return;
46374622
}

‎packages/core/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@getripple/core",
3-
"version": "1.0.12",
3+
"version": "1.0.13",
44
"description": "Core engine for Ripple's local authorization gate: context planning, drift checks, and trust boundaries.",
55
"license": "MIT",
66
"type": "commonjs",

‎packages/mcp/package.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@getripple/mcp",
3-
"version": "1.0.12",
3+
"version": "1.0.13",
44
"description": "MCP stdio server for Ripple's local authorization gate for AI coding agents.",
55
"license": "MIT",
66
"type": "commonjs",
@@ -45,7 +45,7 @@
4545
"build": "tsc -p tsconfig.json"
4646
},
4747
"dependencies": {
48-
"@getripple/core": "^1.0.12"
48+
"@getripple/core": "^1.0.13"
4949
},
5050
"devDependencies": {
5151
"@types/node": "^18.0.0",

0 commit comments

Comments
 (0)