ripplo 0.8.0 → 0.8.1
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/chunk-3SCOYB4C.js +16 -0
- package/dist/chunk-42LZFMNX.js +4 -0
- package/dist/chunk-4AGLYPJ5.js +23 -0
- package/dist/chunk-4DXOF4WS.js +55 -0
- package/dist/chunk-7WZ3VIUU.js +4 -0
- package/dist/chunk-7YPITJA2.js +8 -0
- package/dist/chunk-CDPYJKK7.js +9 -0
- package/dist/chunk-CJUKILIO.js +4 -0
- package/dist/chunk-CLFA4JSB.js +4 -0
- package/dist/chunk-EXV2RD7Z.js +6 -0
- package/dist/chunk-FCEWYZLQ.js +4 -0
- package/dist/chunk-FEHVIHVA.js +5 -0
- package/dist/chunk-FZIMQTFG.js +4 -0
- package/dist/chunk-G22LPS47.js +4 -0
- package/dist/chunk-G7ZQUZ2X.js +242 -0
- package/dist/chunk-GD2AESFG.js +5 -0
- package/dist/chunk-HGL5SE75.js +4 -0
- package/dist/chunk-HYHAOKYP.js +7 -0
- package/dist/chunk-IW2P4NKR.js +4 -0
- package/dist/chunk-JJ4QQPAV.js +4 -0
- package/dist/chunk-KSNZWWHX.js +6 -0
- package/dist/chunk-LB2L72ZU.js +48 -0
- package/dist/chunk-LB65USNP.js +73 -0
- package/dist/chunk-MHNGR6M7.js +4 -0
- package/dist/chunk-MOI4L3EX.js +4 -0
- package/dist/chunk-NWWET7CM.js +11 -0
- package/dist/{chunk-SAYJ5AQK.js → chunk-OAXYJKXD.js} +19 -19
- package/dist/chunk-OQ6KNYPG.js +4 -0
- package/dist/chunk-OWN4P2K7.js +4 -0
- package/dist/chunk-PBL3TBB7.js +6 -0
- package/dist/chunk-R4ZTRVDQ.js +4 -0
- package/dist/chunk-S7GMY5LS.js +6 -0
- package/dist/chunk-TEP6ETHQ.js +7 -0
- package/dist/chunk-TPTG6RR4.js +8 -0
- package/dist/chunk-U4LC56T3.js +4 -0
- package/dist/chunk-VETETUHZ.js +8 -0
- package/dist/chunk-VYQ5CDRX.js +9 -0
- package/dist/chunk-WK7VO5JE.js +23 -0
- package/dist/chunk-WNAVYV4P.js +4 -0
- package/dist/{chunk-D6FZ55DP.js → chunk-WOHPPHUD.js} +1 -1
- package/dist/chunk-XGMM2RKR.js +5 -0
- package/dist/chunk-ZH3HY7BS.js +83 -0
- package/dist/cli-error-J7LD2VWZ.js +4 -0
- package/dist/compile-write-OKTXD7JL.js +4 -0
- package/dist/daemon-JJ6MZPIA.js +4 -0
- package/dist/{daemon-MBF7JVEN.js → daemon-O2VR45XP.js} +2 -2
- package/dist/daemon-lock-FLZHWM2F.js +4 -0
- package/dist/dsl-loader-IOQUYVQH.js +4 -0
- package/dist/exit-plan-gate-TTJ7U2AP.js +4 -0
- package/dist/hook.js +5 -0
- package/dist/index.js +202 -405
- package/dist/plan-reminder-Q4A5WM2G.js +4 -0
- package/dist/post-edit-PMSJ6CLE.js +4 -0
- package/dist/post-edit-analyze-2AJVDFTK.js +4 -0
- package/dist/post-edit-flag-stubs-ORFV452V.js +4 -0
- package/dist/pre-bash-run-gate-C73XUNRE.js +4 -0
- package/dist/pre-edit-H6ZOQSXF.js +4 -0
- package/dist/pre-edit-ripplo-skill-gate-63HGCUPG.js +4 -0
- package/dist/pre-edit-scope-gate-WIORRC2B.js +4 -0
- package/dist/pre-edit-watch-gate-3VSMTCE4.js +4 -0
- package/dist/prompt-submit-PSXSUTY3.js +4 -0
- package/dist/scope-reminder-TGDQCKLN.js +4 -0
- package/dist/session-preamble-HNQKBR27.js +4 -0
- package/dist/solve-worker.js +1 -1
- package/dist/status-QBBCVTXV.js +4 -0
- package/dist/stop-enforce-I27VU4IR.js +64 -0
- package/dist/tasks-reminder-A4AIFNQJ.js +4 -0
- package/dist/track-skill-load-3IPC45UX.js +4 -0
- package/dist/track-skill-prompt-YSB6OOQN.js +4 -0
- package/package.json +2 -2
- package/dist/chunk-E4AOUQQ7.js +0 -10
- package/dist/chunk-GOFUUPKD.js +0 -8
- package/dist/chunk-NIKFQP6W.js +0 -301
- package/dist/chunk-THHZNLXN.js +0 -48
- package/dist/chunk-VGYX2VAS.js +0 -85
- package/dist/daemon-VIHSG5KP.js +0 -4
- package/dist/daemon-lock-HIZ6UWXO.js +0 -4
- package/dist/status-G5OG62JI.js +0 -4
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __ripploCreateRequire } from "node:module";
|
|
3
|
+
const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
|
|
4
|
+
import{A as j,B as L,G as v,H as g,U as M}from"./chunk-OAXYJKXD.js";import c from"fs";import l from"path";import{createHash as pe}from"crypto";import{pathToFileURL as me}from"url";import{build as ge}from"esbuild";import{err as x,ok as C,ResultAsync as ye}from"neverthrow";import X from"fs";import y from"path";import u from"typescript";function A(e){let t=y.join(e,"index.ts"),n=G(e);X.mkdirSync(y.dirname(n.tsBuildInfoFile??""),{recursive:!0});let r=u.createIncrementalCompilerHost(n),o=u.createIncrementalProgram({host:r,options:n,rootNames:[t]}),i=[...o.getSyntacticDiagnostics(),...o.getSemanticDiagnostics()];o.emit();let s=i.filter(a=>V(a,e));if(s.length===0)return{diagnostics:[],ok:!0};let T={getCanonicalFileName:a=>a,getCurrentDirectory:()=>y.dirname(e),getNewLine:()=>`
|
|
5
|
+
`};return{diagnostics:u.formatDiagnosticsWithColorAndContext(s,T).split(`
|
|
6
|
+
`).filter(a=>a.length>0),ok:!1}}function V(e,t){let n=e.file?.fileName;return n==null?!0:n.startsWith(t)}var Y=y.join(".local","tsbuildinfo");function G(e){return{allowImportingTsExtensions:!0,allowJs:!1,esModuleInterop:!0,incremental:!0,module:u.ModuleKind.Preserve,moduleResolution:u.ModuleResolutionKind.Bundler,noEmit:!0,resolveJsonModule:!0,skipLibCheck:!0,strict:!1,target:u.ScriptTarget.ES2022,tsBuildInfoFile:y.join(e,Y)}}import h from"fs";import w from"safe-stable-stringify";import{err as q,ok as I,Result as Q}from"neverthrow";async function _(e,t){let n={entities:e.entities,singletonSchemas:e.singletons,valueSpaces:e.valueSpaces},r=S(t)?void 0:te(t),o=ee(e,r),i=await Promise.all(e.workflows.map(s=>Z({context:n,reusable:o,workflow:s})));return Q.combine(i).map(s=>({...e,workflows:[...s]}))}function S(e){let t=process.argv[1];if(t==null||!h.existsSync(e))return!1;try{return h.statSync(t).mtimeMs>h.statSync(e).mtimeMs}catch{return!1}}async function Z({context:e,reusable:t,workflow:n}){let r=t.get(H(n));if(r!=null)return I({...n,tests:r.tests});try{return I(await M({context:e,workflow:n}))}catch(o){let i=o instanceof Error?o.message:String(o);return q({kind:"expand-failed",message:i,workflow:n.name})}}function H(e){let t=w({...e,tests:[]});if(t==null)throw new Error("solver: workflow is not serializable");return t}function ee(e,t){return t==null||w(O(t))!==w(O(e))?new Map:new Map(t.workflows.map(n=>[H(n),n]))}function O(e){return{entities:e.entities,singletons:e.singletons,valueSpaces:e.valueSpaces}}function te(e){if(h.existsSync(e))try{return L(g,h.readFileSync(e,"utf8"))}catch{return}}import{createHash as ne}from"crypto";import N from"fs/promises";import R from"path";import{err as f,ok as F,Result as re}from"neverthrow";var oe=".ripplo/fixtures",ie=10*1024*1024,se=50*1024*1024;async function W(e,t){let n=ae(t);if(n.length===0)return F({});let r=R.join(e,oe),o=await Promise.all(n.map(i=>le({fixturesRoot:r,name:i})));return re.combine(o).andThen(ce)}function ae(e){let n=e.workflows.flatMap(r=>[...r.steps,...r.tests.flatMap(o=>o.steps)]).flatMap(r=>r.action.kind==="upload"?r.action.files:[]);return[...new Set(n)].toSorted((r,o)=>r.localeCompare(o))}async function le({fixturesRoot:e,name:t}){if(t.includes("..")||R.isAbsolute(t))return f({kind:"fixture-invalid-name",name:t});let n=R.join(e,t),r=await N.lstat(n).catch(()=>null);if(r==null)return f({kind:"fixture-missing",name:t,path:n});if(r.isSymbolicLink())return f({kind:"fixture-symlink",name:t});if(!r.isFile())return f({kind:"fixture-not-file",name:t});let o=await N.readFile(n);if(o.byteLength>ie)return f({kind:"fixture-too-large",name:t,size:o.byteLength});let i=ne("sha256").update(o).digest("hex");return F([t,{sha256:i,size:o.byteLength}])}function ce(e){let t=e.reduce((n,[,r])=>n+r.size,0);return t>se?f({kind:"fixtures-total-too-large",total:t}):F(Object.fromEntries(e))}import{createHash as de}from"crypto";import p from"fs";import P from"path";import{z as b}from"zod";function U({cwd:e,fingerprint:t}){let n=fe(e);if(n==null||n.fingerprint!==E(t))return;let r=P.join(e,".ripplo","ripplo.lock");if(!p.existsSync(r))return;let o=p.readFileSync(r,"utf8");if(E(o)===n.lockfileHash)try{return L(g,o)}catch{return}}function z({cwd:e,fingerprint:t,lockfile:n}){let r={fingerprint:E(t),lockfileHash:E(j(g,n))},o=D(e);p.mkdirSync(P.dirname(o),{recursive:!0}),p.writeFileSync(o,JSON.stringify(r))}var ue=b.object({fingerprint:b.string(),lockfileHash:b.string()});function fe(e){let t=D(e);if(!(!p.existsSync(t)||S(t)))try{let n=ue.safeParse(JSON.parse(p.readFileSync(t,"utf8")));return n.success?n.data:void 0}catch{return}}function D(e){return P.join(e,".ripplo",".local","load-cache.json")}function E(e){return de("sha256").update(e).digest("base64")}var he=".ripplo/ripplo.lock",k;async function at(e){let{result:t}=await ke(e);return t}async function ke(e){let t=$(l.join(e,".ripplo"));if(k!=null&&k.fingerprint===t&&k.result.isOk())return{fingerprint:t,result:k.result};let n=await xe(e);return k={fingerprint:t,result:n},{fingerprint:t,result:n}}async function xe(e){let t=l.join(e,".ripplo"),n=l.join(t,"index.ts"),r=$(t),o=U({cwd:e,fingerprint:r});if(o!=null)return C(o);let i=we(n);i.catch(()=>{});let s=A(t);if(!s.ok)return x({diagnostics:s.diagnostics,kind:"typecheck-failed"});let a=await(await Se(n,i)).andThen(d=>be({entryPath:n,exported:d})).match(async d=>(await W(e,d)).map(m=>({...d,fixtures:m})).mapErr(m=>({error:m,kind:"fixture-failed"})).asyncAndThen(m=>new ye(_(m,l.join(e,he))).mapErr(K=>K)),d=>Promise.resolve(x(d)));return a.isOk()&&z({cwd:e,fingerprint:r,lockfile:a.value}),a}var Le=new Set([".local","debug","node_modules","ripplo.lock"]);function $(e){let t=l.join(e,"..","node_modules","@ripplo","testing","package.json");return[...J(e),...Ee(t)].toSorted((n,r)=>n.localeCompare(r)).join("|")}function J(e){return(c.existsSync(e)?c.readdirSync(e,{withFileTypes:!0}):[]).flatMap(n=>{if(Le.has(n.name))return[];let r=l.join(e,n.name);if(n.isDirectory())return J(r);let o=c.statSync(r);return[`${r}:${String(o.mtimeMs)}:${String(o.size)}`]})}function Ee(e){if(!c.existsSync(e))return[];let t=c.statSync(e);return[`${e}:${String(t.mtimeMs)}:${String(t.size)}`]}async function we(e){let n=(await ge({bundle:!0,entryPoints:[e],format:"esm",logLevel:"silent",platform:"node",sourcemap:"inline",target:"node22",write:!1})).outputFiles[0];if(n==null)throw new Error("dsl bundle produced no output");return n.text}async function Se(e,t){try{let n=await t;process.setSourceMapsEnabled(!0);let r=await import(Re(e,n)),o=r!=null&&typeof r=="object"&&"default"in r?Reflect.get(r,"default"):r;return C(o)}catch(n){return x({kind:"load-threw",message:Fe(n)})}}function Re(e,t){let n=l.join(l.dirname(e),".local");c.mkdirSync(n,{recursive:!0});let r=pe("sha256").update(t).digest("hex").slice(0,16),o=l.join(n,`dsl-bundle-${r}.mjs`);return c.writeFileSync(o,t),me(o).href}function Fe(e){return e instanceof Error?e.message:String(e)}function be({entryPath:e,exported:t}){if(t==null||typeof t!="object"||!("lockfile"in t))return x({entryPath:e,kind:"not-ripplo"});let n=v.safeParse(Reflect.get(t,"lockfile"));return n.success?C(n.data):x({issues:n.error.issues.map(r=>`${r.path.join(".")}: ${r.message}`),kind:"invalid-lockfile"})}export{S as a,oe as b,ie as c,se as d,he as e,at as f,ke as g,xe as h};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __ripploCreateRequire } from "node:module";
|
|
3
|
+
const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
|
|
4
|
+
import{b as P}from"./chunk-CJUKILIO.js";import{a as M}from"./chunk-NNH3YVVO.js";import{b as q}from"./chunk-KMZ3L5YA.js";var O=15e3,G=3,U=300,p=class extends Error{detail;serverUrl;constructor({detail:r,serverUrl:t}){super(`Failed to connect to Ripplo server at ${t}. Check the server is running and reachable. Details: ${r}`),this.name="GqlConnectionError",this.detail=r,this.serverUrl=t}},c=class extends Error{errors;constructor(r){super(r.map(t=>t.message).join(", ")),this.name="GqlRequestError",this.errors=r}};function N(e){if(e instanceof c)return e.errors[0]?.extensions?.code}async function b(e){let{print:r}=await import("graphql"),t=r(e.document),n=JSON.stringify({query:t,variables:e.variables}),o=`${e.config.ripploServerUrl}/graphql`,d=await F({init:{body:n,headers:{Authorization:`Bearer ${e.config.token}`,"Content-Type":"application/json",...P()},method:"POST"},serverUrl:e.config.ripploServerUrl,url:o}),a=await V({res:d,url:o});if(!W(a))throw new Error("Invalid GraphQL response");if(B(a))throw new c(a.errors);if(a.data==null)throw new Error("No data returned from server");return a.data}async function F({init:e,serverUrl:r,url:t}){let n=1,o=await E({init:e,url:t});for(;o.retryable&&n<G;)await j(L(n)),n+=1,o=await E({init:e,url:t});if(o.response!=null)return o.response;throw new p({detail:o.detail,serverUrl:r})}async function E({init:e,url:r}){try{let t=await fetch(r,{...e,signal:AbortSignal.timeout(O)});return{detail:"",response:t,retryable:t.status>=500}}catch(t){return{detail:t instanceof Error?t.message:String(t),response:void 0,retryable:!0}}}function L(e){return U*3**(e-1)*(.5+Math.random())}function j(e){return new Promise(r=>{setTimeout(r,e)})}async function V({res:e,url:r}){let t=await e.text();if(t.length===0)throw new Error(`Empty response from Ripplo server at ${r} (status ${String(e.status)}). The server may have restarted or the request was rejected before a body was sent.`);try{return JSON.parse(t)}catch{throw new Error(`Non-JSON response from Ripplo server at ${r} (status ${String(e.status)}): ${t.slice(0,200)}`)}}function W(e){return typeof e=="object"&&e!=null&&("data"in e||"errors"in e)}function B(e){return Array.isArray(e.errors)&&e.errors.length>0}import H from"pino";import J from"pino-pretty";var f=H({level:process.env.LOG_LEVEL??"info"},J({ignore:"pid,hostname"}));import{readdir as Q,rm as K,stat as X}from"fs/promises";import T from"path";var x=T.join(process.cwd(),".ripplo","debug"),A=360*60*1e3;async function z({maxRuns:e}){try{let t=(await Q(x,{withFileTypes:!0})).filter(i=>i.isDirectory()),n=Date.now(),o=await Promise.all(t.map(async i=>{let g=T.join(x,i.name),$=await X(g);return{dirPath:g,mtime:$.mtimeMs}})),d=o.filter(i=>n-i.mtime>A),D=o.filter(i=>n-i.mtime<=A).toSorted((i,g)=>g.mtime-i.mtime).slice(e),w=[...d,...D];if(w.length===0)return;await Promise.allSettled(w.map(i=>K(i.dirPath,{force:!0,recursive:!0}))),f.debug("Pruned %d old debug run(s)",w.length)}catch{f.warn("Debug run pruning failed, ignoring")}}import s from"fs";import Y from"os";import m from"path";var Z=".local",ee=".ripplo";function v(e){return m.join(e,".ripplo",Z)}function re(e){let r=v(e);s.existsSync(r)||s.mkdirSync(r,{recursive:!0});let t=m.join(r,".gitignore");return s.existsSync(t)||s.writeFileSync(t,`*
|
|
5
|
+
`),r}function te(e,r){return m.join(v(e),r)}function R(){return m.join(Y.homedir(),ee)}function h(){let e=R();return s.existsSync(e)?s.chmodSync(e,448):s.mkdirSync(e,{mode:448,recursive:!0}),e}function S(e){return m.join(R(),e)}import{Agent as ne,RetryAgent as oe,setGlobalDispatcher as ie}from"undici";var ae=1500,se=4e3,le=3,de=50,ce=100,k=!1;function me(){if(k)return;k=!0;let e=new ne({connections:ce,keepAliveMaxTimeout:se,keepAliveTimeout:ae}),r=new oe(e,{errorCodes:["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT","UND_ERR_REQ_CONTENT_LENGTH_MISMATCH","UND_ERR_SOCKET"],maxRetries:le,methods:["GET","POST","HEAD","OPTIONS","PUT","DELETE"],minTimeout:de});ie(r)}import{graphql as u}from"gql.tada";var Me=u(`
|
|
6
|
+
query AgentReviewContextWorker($reviewId: String!) {
|
|
7
|
+
agentReview(id: $reviewId) {
|
|
8
|
+
id
|
|
9
|
+
runId
|
|
10
|
+
agentProfile {
|
|
11
|
+
id
|
|
12
|
+
name
|
|
13
|
+
description
|
|
14
|
+
output
|
|
15
|
+
successCriteria
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
`);var Oe=u(`
|
|
20
|
+
mutation StartAgentReviewWorker($reviewId: String!) {
|
|
21
|
+
startAgentReview(reviewId: $reviewId)
|
|
22
|
+
}
|
|
23
|
+
`);var Ge=u(`
|
|
24
|
+
mutation CompleteAgentReviewWorker(
|
|
25
|
+
$reviewId: String!
|
|
26
|
+
$markdown: String!
|
|
27
|
+
$shortSummary: String!
|
|
28
|
+
$verdict: AgentReviewVerdict!
|
|
29
|
+
$comments: [AgentReviewCommentInput!]!
|
|
30
|
+
) {
|
|
31
|
+
completeAgentReview(
|
|
32
|
+
reviewId: $reviewId
|
|
33
|
+
markdown: $markdown
|
|
34
|
+
shortSummary: $shortSummary
|
|
35
|
+
verdict: $verdict
|
|
36
|
+
comments: $comments
|
|
37
|
+
)
|
|
38
|
+
}
|
|
39
|
+
`);var Ue=u(`
|
|
40
|
+
mutation UpdateAgentReviewProgressWorker($reviewId: String!, $text: String!) {
|
|
41
|
+
updateAgentReviewProgress(reviewId: $reviewId, text: $text)
|
|
42
|
+
}
|
|
43
|
+
`);var Ne=u(`
|
|
44
|
+
mutation FailAgentReviewWorker($reviewId: String!, $reason: String!) {
|
|
45
|
+
failAgentReview(reviewId: $reviewId, reason: $reason)
|
|
46
|
+
}
|
|
47
|
+
`);import l from"fs";import C from"path";function ue(e){let r=process.env.RIPPLO_TOKEN;if(r!=null&&r.trim().length>0)return r.trim();let t=y(e);if(!l.existsSync(t))return null;let n=l.readFileSync(t,"utf8").trim();return n.length===0?null:n}function ge({serverUrl:e,token:r}){h();let t=y(e);l.mkdirSync(C.dirname(t),{mode:448,recursive:!0}),l.writeFileSync(t,r+`
|
|
48
|
+
`,{mode:384})}function pe(e){let r=y(e);return l.existsSync(r)?(l.unlinkSync(r),!0):!1}function y(e){return S(C.join("tokens",fe(e)))}function fe(e){return new URL(e).host.replaceAll(/[^a-zA-Z0-9.]/g,"_")}var _=q(M(),1);import I from"crypto";function ye({body:e,secret:r}){let t=new _.Webhook(r),n=`msg_${I.randomUUID()}`,o=new Date,d=t.sign(n,o,e),a=Math.floor(o.getTime()/1e3);return{"webhook-id":n,"webhook-signature":d,"webhook-timestamp":String(a)}}function we(){return`whsec_${I.randomBytes(24).toString("base64")}`}export{p as a,c as b,N as c,b as d,f as e,z as f,re as g,te as h,ue as i,ge as j,pe as k,y as l,me as m,ye as n,we as o};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __ripploCreateRequire } from "node:module";
|
|
3
|
+
const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
|
|
4
|
+
import{c as a,d as s}from"./chunk-OWN4P2K7.js";import{a as o}from"./chunk-7WZ3VIUU.js";var n=`# How Ripplo thinks
|
|
5
|
+
|
|
6
|
+
The mental model behind every Ripplo skill. Read this once and the compile errors, run findings, and explorer behavior all follow from it. Every skill assumes it.
|
|
7
|
+
|
|
8
|
+
**Done means both halves.** An app change without a passing workflow that proves it isn't done, and a workflow written against broken app behavior isn't done either. Every user-facing change ships with the workflow that demonstrates it working end to end.
|
|
9
|
+
|
|
10
|
+
## A workflow is a declaration, not a script
|
|
11
|
+
|
|
12
|
+
A workflow step says two things: what the user does, and what becomes true afterward. "Click Save, and now the success heading is visible, the url is /projects/123, and a project row exists in the database." Ripplo checks all of it \u2014 it doesn't just replay clicks and hope.
|
|
13
|
+
|
|
14
|
+
Because steps declare state instead of scripting waits and retries, Ripplo can do things a script runner can't: predict what every step should produce, compare that prediction against the live app, and reuse what one workflow proved inside every other workflow.
|
|
15
|
+
|
|
16
|
+
One vocabulary rule: you author **workflows**. A **test** is a workflow with its input parameters pinned \u2014 the compiler derives one test per \`when\` branch (or a single "main" test when there are none). Runs execute tests; you edit workflows.
|
|
17
|
+
|
|
18
|
+
A workflow is also a **user journey**: one thing the user set out to accomplish, traced as the real click path from a natural entry point, with as many mutations as the intent takes. Depth pays twice. Every step's declarations become facts, so a journey teaches Ripplo far more of the app than a goto-and-click snippet \u2014 and the explorer can only compose paths from what workflows have declared. Shallow workflows starve the model.
|
|
19
|
+
|
|
20
|
+
## Two kinds of state
|
|
21
|
+
|
|
22
|
+
- **Data** \u2014 rows in your app: users, projects, invoices. Declared as entities, seeded by worlds, asserted with \`Entity.created / updated / deleted\`. Ripplo reads your app's real state through the engine and compares.
|
|
23
|
+
- **Page state** \u2014 what's on screen right now: the url, what's visible or enabled, what a field contains, and global variables (declared with \`singleton(...)\` in the DSL, shown as "Global variables" in the dashboard \u2014 one concept, and it can live in the backend or the browser). Asserted with \`visible(...)\`, \`url.path.is(...)\`, \`text(...)\`, and friends. Locators are semantic \u2014 \`button("Save")\`, \`textbox("Email")\` \u2014 because they assert accessibility too; \`testId\` is a last resort for elements with no ARIA role.
|
|
24
|
+
|
|
25
|
+
New backend state to assert means a new \`entity(...)\` declaration plus a matching engine impl in the app \u2014 the type system flags the missing half. This is the **two-funnel** rule: all definitions flow through one \`createRipplo(...)\` in \`.ripplo/index.ts\`, all implementations through one \`createEngine(...)\` in the app \u2014 never a second call site of either.
|
|
26
|
+
|
|
27
|
+
Every assertion pins one piece of one of these. A mutation step with only page-state assertions ships the "toast said saved, DB didn't" bug as green \u2014 that's why backend assertions on mutations are mandatory.
|
|
28
|
+
|
|
29
|
+
## You can only touch what you've shown exists
|
|
30
|
+
|
|
31
|
+
A step cannot click a button no earlier step declared visible. Compile enforces this before anything runs.
|
|
32
|
+
|
|
33
|
+
This is not pedantry. Declarations are how Ripplo learns what's reachable from where \u2014 which is what lets the explorer compose paths no workflow author wrote and still know what should be on the page when it gets there. An undeclared button is invisible to the model even when it renders fine; the fix is one \`visible(...)\` on the step that first shows it.
|
|
34
|
+
|
|
35
|
+
Corollary: when the same page can show a thing or not (a collapsed group, a toggled panel), the two states need a distinguishing declaration \u2014 assert \`expanded(...)\` on the toggle, not just the disappearance. Otherwise the model sees one page asserting two contradictory things.
|
|
36
|
+
|
|
37
|
+
## Assertions become facts
|
|
38
|
+
|
|
39
|
+
What one workflow proves about a page becomes a fact \u2014 something Ripplo now knows about that page and enforces everywhere. If the settings workflow shows "at /settings, the Save button is visible," every other workflow that reaches /settings inherits that fact \u2014 and so does the explorer, on paths nobody wrote. Negations count too: "the spinner is not visible" is a fact just like "the heading is visible."
|
|
40
|
+
|
|
41
|
+
Two workflows asserting opposite things about the same page under the same conditions is a contradiction, and compile reports it before any run. One of them is wrong \u2014 usually the page has a state dimension neither workflow declared.
|
|
42
|
+
|
|
43
|
+
Facts come in three tiers, one promotion pipeline. A single workflow's assertion is **inferred**. The same consequence asserted by two or more workflows **generalizes** to a **learned** fact \u2014 the model keeps only the conditions they share, so a claim made on two URLs drops the URL and holds app-wide. Above both sits the **declared** fact: an app-wide rule you author directly with \`fact(...)\` in \`.ripplo/facts.ts\` (an invariant like "the crash screen never shows," or a permission boundary), always enforced without any workflow producing it. A more specific fact overrides a more general one. \`/ripplo:create\` covers authoring all three.
|
|
44
|
+
|
|
45
|
+
Two practical notes:
|
|
46
|
+
|
|
47
|
+
- \`text(locator, "x")\` means _contains_ \u2014 several \`text(...)\` assertions on one element can all be true at once.
|
|
48
|
+
- Exact-value checks (\`value(...)\`, \`url.query\`) are exact. A stray difference is a finding, not noise.
|
|
49
|
+
|
|
50
|
+
## What is enforced where
|
|
51
|
+
|
|
52
|
+
| Gate | When | Catches |
|
|
53
|
+
| ----------------- | ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
54
|
+
| \`npx ripplo compile\` | before any run | structure, unreachable interactions, contradicting facts, unreachable \`when\` branches, stale lockfile |
|
|
55
|
+
| \`npx ripplo run\` | live, per step | every declared expectation vs the real app \u2014 page state and backend rows, with a wait window that tolerates propagation lag but fails on wrong values |
|
|
56
|
+
| explorer | in the background | learned facts and backend state on composed paths no workflow author wrote |
|
|
57
|
+
|
|
58
|
+
A failed check is a **finding** \u2014 the unit every red run and every explorer catch produces. If compile is red, the model is inconsistent \u2014 fix the declarations, don't run around it. If a run is red, read the artifacts first (\`npx ripplo explain <runId>\`, then raw \`behavior.jsonl\`), form one hypothesis, make one change, re-run once \u2014 never re-run hoping.
|
|
59
|
+
|
|
60
|
+
The explorer is not optional \u2014 it is the third gate, always running. It walks composed paths no workflow author wrote and catches bugs that only appear when actions combine, so keep it on for the whole session. A green \`npx ripplo run\` turns it on for you; \`npx ripplo explore\` shows or toggles it by hand. Its findings arrive as tasks \u2014 triage them with \`/ripplo:tasks\`, and an open finding blocks the session end just like any other task. The only real off switch is \`npx ripplo hooks pause\`.
|
|
61
|
+
|
|
62
|
+
Two different timing knobs, often confused: \`.wait("slow")\` on an assertion lengthens _how long_ Ripplo polls before calling it failed (slow page, long job). \`consistency: "eventual"\` on a field or variable tolerates _wrong in-between values_ while converging (a flickering redirect, a denormalized counter). Slow is not the same as flickering \u2014 reach for \`.wait\` first.
|
|
63
|
+
|
|
64
|
+
\`.ripplo/ripplo.lock\` is the compiled model \u2014 committed, regenerated by \`ripplo compile\`, never hand-edited.
|
|
65
|
+
|
|
66
|
+
## Scope and stubs
|
|
67
|
+
|
|
68
|
+
**Testing Scope** is the session's contract: the set of workflows this session is responsible for leaving green. Any change that could affect a flow adds its workflow to scope; a flow with no workflow yet gets a **stub** \u2014 \`workflow("Intent")\` with no body \u2014 which is a gated promise: hooks won't let the session end with it unimplemented. Scope items are removed only when genuinely out of scope, never because they're work.
|
|
69
|
+
|
|
70
|
+
## The prime directive
|
|
71
|
+
|
|
72
|
+
Never weaken a workflow to make it pass. No swapping exact text for contains, no deleting assertions, no fabricated locators, no \`testId()\` because the accessible name is missing \u2014 add the accessible name to the app. A weakened declaration doesn't just soften one workflow; it teaches Ripplo a weaker fact everywhere.
|
|
73
|
+
`;function l(e,t){return!o(e)||s(e,t)?null:(a(e,t),n)}export{l as a};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __ripploCreateRequire } from "node:module";
|
|
3
|
+
const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
|
|
4
|
+
function n(r,t){return t==null?`Load \`/ripplo:${r}\` skill for instructions.`:`Load \`/ripplo:${r}\` skill for instructions on ${t}.`}function e(r){return r.length===1?n(r[0]):`Before proceeding, load the ${r.map(i=>`\`/ripplo:${i}\``).join(" and ")} skills \u2014 every one, each carries rules the others don't.`}export{n as a,e as b};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __ripploCreateRequire } from "node:module";
|
|
3
|
+
const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
|
|
4
|
+
function p(e){let t=e.workflows.filter(n=>!n.stub);if(t.length===0)return[];let a=new Set(t.flatMap(n=>s(n))),r=new Set(t.flatMap(n=>o(n)));return[...e.entities.filter(n=>!a.has(n.name)).map(n=>({entity:n.name,kind:"entity-never-given"})),...e.entities.filter(n=>a.has(n.name)&&!r.has(n.name)).map(n=>({entity:n.name,kind:"entity-never-mutated"})),...t.flatMap(n=>n.tests.flatMap(l=>y(l)))]}function s(e){return[...e.world,...e.maybe].map(t=>t.entity)}function o(e){return e.steps.flatMap(t=>t.expect.flatMap(a=>i(a))).map(t=>t.entity)}function y(e){let t=e.steps.flatMap(a=>a.expect.flatMap(r=>i(r)));return d({states:t,test:e})}function d({states:e,test:t}){let a=e.filter(r=>r.assertion.kind==="deleted").flatMap(r=>f({predicate:r,test:t})).map(({entity:r,field:n})=>({entity:r,field:n,kind:"unmatchable-delete-key",testSlug:t.slug,workflow:t.workflow}));return c(a)}function f({predicate:e,test:t}){let a=t.world.filter(r=>r.entity===e.entity);return a.length===0?[]:Object.entries(e.key).filter(([r,n])=>g(n)&&!u({field:r,setups:a})).map(([r])=>({entity:e.entity,field:r}))}function u({field:e,setups:t}){return t.some(a=>Object.keys(a.set).includes(e))}function g(e){return e===null||typeof e!="object"}function c(e){return e.filter((t,a)=>e.findIndex(r=>JSON.stringify(r)===JSON.stringify(t))===a)}function i(e){return e.kind==="state"?[e]:e.kind==="not"?i(e.predicate):e.kind==="and"?e.predicates.flatMap(t=>i(t)):e.kind==="when"?e.branches.flatMap(t=>t.consequence.flatMap(a=>i(a))):[]}export{p as a};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __ripploCreateRequire } from "node:module";
|
|
3
|
+
const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
|
|
4
|
+
import{a as o}from"./chunk-7YPITJA2.js";import{a as t}from"./chunk-MHNGR6M7.js";var r=class extends Error{failure;constructor(i){super(i.kind),this.name="CliError",this.failure=i}};function u(e){return e instanceof r?a(e.failure):e instanceof Error?e.message:String(e)}function a(e){switch(e.kind){case"project-file-missing":return[`Missing ${e.path} \u2014 this directory is not a Ripplo project.`,"Run `npx ripplo init` to create it (or cd into the project root).",t("setup")].join(`
|
|
5
|
+
`);case"project-file-invalid":return[`${e.path} is invalid:`,...e.issues.map(i=>` ${i}`),"Fix the file by hand or re-run `npx ripplo init`."].join(`
|
|
6
|
+
`);case"not-authenticated":return["Not signed in. Run `npx ripplo auth login`.","(Claude Code: run it yourself in the background \u2014 the user just approves in the browser.)"].join(`
|
|
7
|
+
`);case"env-invalid":return s(e);case"playwright-install-failed":return["Playwright browser install failed \u2014 Chromium is still missing.","Run `npx playwright install chromium` and check its output for network, proxy, or disk-space errors."].join(`
|
|
8
|
+
`);case"gitdir-unrecognized":return`Unrecognized .git file at ${e.marker} \u2014 expected a directory or a "gitdir:" pointer (worktree). Is the repo corrupted?`;case"gitdir-empty":return`Empty gitdir pointer at ${e.marker} \u2014 the worktree's .git file points nowhere. Re-create the worktree.`;case"oauth-device-code-failed":return[`Could not start sign-in (device-code request failed): ${e.description}`,"Is the Ripplo server reachable? Check RIPPLO_SERVER_URL and retry."].join(`
|
|
9
|
+
`);case"oauth-authorization-failed":return[`Sign-in failed (${e.code}): ${e.description}`,e.code==="expired_token"?"The approval window expired \u2014 run `npx ripplo auth login` again.":"Run `npx ripplo auth login` to retry."].join(`
|
|
10
|
+
`);case"compilation-failed":return o(e.error)}}function g(e,i){let n=i instanceof Error?i.message:String(i);return`ripplo hook "${e}" crashed and was skipped \u2014 ${n}`}function s(e){let i=e.missingEnvFiles.length===0?[]:["Declared env files not found:",...e.missingEnvFiles.map(n=>` ${n}`),"In a git worktree? Env files aren't copied from the main checkout \u2014 recreate them, or symlink to a shared file outside the working tree."];return["Env config invalid:",...e.issues.map(n=>` ${n}`),"Add the missing values to the env files declared in .ripplo/project.json.",...i].join(`
|
|
11
|
+
`)}export{u as a,a as b,g as c};
|