28 Commits

Author SHA1 Message Date
5931e0b6a9 fix(cli): add --format json to the privacy command
greenlight privacy had no --format flag at all, so greenlight privacy
--format json failed with "unknown flag: --format". Every sibling scan
command (preflight, codescan, playscan, ipa, scan, verify) already
supports --format json; privacy was the odd one out, with no way to
consume its findings as machine-readable output.

Add the flag following the existing convention (see verify.go /
playscan.go): suppress the banner for JSON output and encode the
already-json-tagged *privacy.ScanResult directly to stdout.

Fixes RevylAI/greenlight#31.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-20 15:39:57 +03:00
b579cf56a0 fix(cli): reject the scan command's unusable Apple ID session auth
'auth login' saves a session-based Apple ID credential (cookies, scnt,
session id) to config, and its own success message told users to run
'greenlight scan --app-id ...' next. But scan always builds its API
client from cfg.KeyID/IssuerID/PrivateKeyPath — fields only 'auth setup'
(the API-key method) ever populates. With a session-only config those
are empty, so NewClient failed deep inside generateToken with a
confusing "failed to read private key: open : no such file or
directory" instead of a real explanation.

config.Config.IsValid() already existed to check exactly this but was
never called anywhere in the codebase. scan now calls it and fails
fast with an actionable message when the stored auth can't drive the
v1 API, and the post-login message points users at 'preflight' (which
needs no account) instead of the broken 'scan' path.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-18 00:33:42 +03:00
ethan zhou
ec41b7c5a7
fix(playscan): close the Android scanning gaps from review (#22)
Adds --apk/--aab to preflight, scans AAB feature-module native code, adds the 64-bit ABI parity rule, reports the Gradle-only coverage gap on artifact scans, respects Play's per-form-factor target API schedules (honouring android:required), and makes preflight --verify follow the project platform instead of hardcoding iOS.

Also decodes uses-feature and android:required on the compiled-manifest paths, where they were silently dropped, and stops a failed archive scan from discarding source findings.

The code intended for #21, which merged with only its README commit.
2026-07-28 12:56:55 -07:00
ethan zhou
7223ea2c4a
feat(playscan): scan Android projects against Google Play policies (#17)
* feat(playscan): scan Android projects against Google Play policies

Adds a Google Play tier alongside the existing App Store checks. Android
projects are detected automatically, including the android/ directory of an
Expo or React Native app, so a cross-platform repo is checked against both
stores in one pass. Also available standalone as `greenlight playscan`.

Deadline checks, both landing 2026-08-31:
- Target API level: CRITICAL below API 35, HIGH below 36, with a live
  day countdown
- Play Billing Library 7 and below, which has no direct v7 to v9 path

Policy checks:
- Restricted permissions: SMS and Call Log (including the 2026-07-15 change
  dropping phone-call account verification), All files access,
  QUERY_ALL_PACKAGES, REQUEST_INSTALL_PACKAGES, background location, broad
  photo/video access, accessibility service, overlays, device admin, usage
  stats, contacts
- Foreground service types missing their FOREGROUND_SERVICE_* permission,
  which throws at startForeground() on Android 14+
- android:exported missing on components with an intent filter, debuggable,
  cleartext traffic
- Ads SDK without the AD_ID permission, which silently zeroes the ad ID
- Account creation without both in-app and web deletion paths

Every finding carries a Doc link to the policy page it comes from. Play
policies are named rather than numbered and change often, so the citation is
worth more than a section reference.

The Apple scanners now skip only when a project is unambiguously
Android-only. Previously every pure-Android repo led with a CRITICAL for a
missing PrivacyInfo.xcprivacy, an iOS-only requirement. iOS-only and
cross-platform projects are unaffected.

targetSdk is resolved from the app module, convention plugins, version
catalogs, gradle.properties, and named constants, since most real projects
reach it through a reference rather than a literal. lint.targetSdk and
testOptions.targetSdk are explicitly excluded. When it cannot be resolved the
scan says so rather than reporting a pass.

Scope is documented in the README and command help: this reads the pre-merge
manifest, so permissions contributed by library manifests are not visible
until the build merges them.

Validated against nowinandroid, AnkiDroid, Thunderbird, Pocket Casts,
DuckDuckGo, and Mattermost, with every finding checked against source.

* feat(playscan): scan built APKs and AABs, with 16 KB page size checks

Adds `greenlight playscan --apk` / `--aab`, closing the gap the source scan
documents: a repo's AndroidManifest.xml is the pre-merge manifest, so
permissions contributed by library manifests are invisible until build time.
A built artifact carries the merged manifest, so its permission list is
complete.

Every existing policy rule runs unchanged against the decoded manifest. The
archive scan adds the native code checks, which only exist at this layer:

- 16 KB page size: ELF LOAD segment alignment on arm64-v8a, 16 KB zip
  alignment of uncompressed libraries, and GNU_RELRO presence. Google Play
  requires apps targeting Android 15+ to support 16 KB memory pages; an
  unaligned library fails to load and crashes at startup on those devices.

Both container formats are decoded in pure Go with no new dependencies, so no
Android SDK, aapt2, or bundletool is required:

- APK: Android binary XML, including the string pool in both UTF-8 and UTF-16
  form and the resource ID map. aapt2 emits an empty string-pool entry for
  framework attributes and identifies them only by resource ID, so without the
  map every android:* attribute reads as unnamed.
- AAB: the protobuf-encoded manifest, walked directly off the wire format.

foregroundServiceType is a bitmask once compiled; it is rendered back to the
pipe-separated names the source manifest uses so the foreground service rule
needs no second code path.

Only arm64-v8a is assessed for 16 KB alignment. 16 KB page size devices are
64-bit ARM, so flagging a 32-bit library at 4 KB would be noise.

Verified against real APKs. Termux 0.118.3 decodes to exactly the 15
permissions in its published source manifest, and its 4 KB aligned libraries
are flagged; F-Droid's 16 KB aligned library is not. Alignment findings were
cross-checked by parsing the ELF program headers independently.

* fix(playscan): address code review findings

Two denial-of-service bugs in the binary parsers, both reachable through the
stated threat model of scanning an archive someone handed you, and both
reproduced before and after the fix:

- protoxml: the decoder recursed once per manifest nesting level with no
  bound. A deeply nested AAB drove a Go stack overflow, which is a process
  abort recover() cannot catch. An 8.9 MB file was enough. Now capped at 100
  levels, matching Android's own parser; the repro drops to 0.35s / 22 MB and
  reports an undecodable manifest.
- axml: attrCount is a uint16 read straight from the file and need not match
  the bytes present, but it was used directly to size an allocation. A 97 KB
  APK of 36-byte chunks each claiming 65535 attributes cost 65s CPU and
  1.46 GB RSS. Capped by the chunk's actual capacity; the repro drops to
  0.04s / 110 MB.

Correctness:

- protoxml decoded compiled values against a guessed schema. Primitive's oneof
  is non-contiguous in Resources.proto (float=3, int_decimal=6, int_hex=7,
  boolean=8), and the code treated field 3 as the boolean, so every compiled
  boolean in a bundle was misread and an AAB's debuggable=true was missed
  entirely. Now decodes Item.str and Item.prim against the real field numbers.
- The BIND_* permissions are never requested via <uses-permission>; the
  framework requires them as the bound component's android:permission. Those
  rules could therefore never fire. Component permissions are now inspected,
  and BIND_VPN_SERVICE is covered alongside accessibility and device admin.
- Every foreground service needs the base FOREGROUND_SERVICE permission from
  API 28 regardless of type. Only the type-specific permissions were checked,
  so an app missing the base one was reported clean.
- Gradle file ranking assumed the app module is named "app", the same
  assumption already fixed for manifest selection. Ranking is now tied to the
  module the selected manifest belongs to, so a library module's targetSdk
  cannot be reported as the app's.
- The Billing Library version had to be a literal, but most builds reach it
  through a variable or a version catalog version.ref, so the support-window
  check silently never fired on them. Both forms now resolve. This surfaces a
  real finding on Thunderbird, which ships Billing 7.1.1 via version.ref.
- detectIOS missed Objective-C sources and app.config.json, either of which
  could classify a cross-platform repo as Android-only and skip the Apple
  scanners.

Also drops GradleInfo.CompileSDK and .Dependencies, which were written or
declared but never read, and serializes an empty findings list as [] rather
than null.

---------

Co-authored-by: ethan zhou <231755529+ethanzhoucool@users.noreply.github.com>
2026-07-27 16:47:29 -07:00
ethan zhou
de1caabee7 Merge remote-tracking branch 'revyl/feat/config-file' into integration/merge-all
# Conflicts:
#	README.md
#	go.mod
#	go.sum
2026-06-26 18:34:21 -07:00
ethan zhou
2c25db981a Merge remote-tracking branch 'revyl/feat/sarif-output' into integration/merge-all
# Conflicts:
#	internal/cli/codescan.go
#	internal/cli/preflight.go
2026-06-26 18:33:27 -07:00
ethan zhou
5d65eb9eef Merge remote-tracking branch 'revyl/fix/tier1-qol' into integration/merge-all
# Conflicts:
#	internal/codescan/rules.go
#	internal/codescan/rules_test.go
2026-06-26 18:31:31 -07:00
ethan zhou
6f914f2313 Merge remote-tracking branch 'revyl/feat/coverage-rule-pack' into integration/merge-all
# Conflicts:
#	internal/codescan/rules_test.go
2026-06-26 18:29:25 -07:00
ethan zhou
921c0dfff0 Fail --exit-code on an incomplete scan (code review)
A crashed sub-scanner is surfaced as a WARN ("Scanner did not complete"), but
preflightExit only failed on CRITICAL/HIGH, so `--exit-code` could pass in CI
even though a requested scanner (e.g. a malformed --ipa) never ran. Track it as
Result.Incomplete and fail the gate on it. Default behavior (no --exit-code) is
unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 18:09:32 -07:00
ethan zhou
766cae07a8 Add .greenlight.yml config for the code scan
Lets teams tune the scanner project-wide (complementing the per-line
`// greenlight:ignore` directive): disable a rule, override its severity, or
ignore paths.

```yaml
rules:
  hardcoded-ipv4: { severity: info }
  platform-reference: { enabled: false }
ignore: [vendor, "*.generated.ts", src/legacy]
```

- New internal/codescan/config.go: loads .greenlight.yml/.greenlight.yaml from
  the project root and applies rule enable/disable, PatternRule severity
  overrides, and path-ignore globs (bare dir names, basename globs, path
  prefixes).
- Strict validation: unknown rule ids, invalid severities, severity overrides on
  rule types that can't honor them, and typo'd YAML fields (KnownFields) all
  error clearly instead of being silently ignored.
- Scanner gains NewScannerWithConfig; codescan + preflight auto-discover the
  file, and `codescan --config <path>` points at an explicit one.
- Applies to the code scan (the rule engine); documented as such.
- Tests for load/validate, apply (disable + override), and the ignore matcher.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 16:30:28 -07:00
ethan zhou
afbc262dd8 Add SARIF 2.1.0 output (--format sarif) for codescan + preflight
Lets findings upload to GitHub code scanning so they show inline in the Security
tab and on PRs with file/line annotations.

- New internal/sarif package renders findings as a SARIF 2.1.0 log: severity ->
  level (CRITICAL/HIGH=error, WARN=warning, INFO=note), file/line ->
  physicalLocation, a stable per-rule id slugged from the title (+ guideline
  prefix), and rules/results that serialize as [] (never null) when empty.
- `--format sarif` wired into codescan and preflight; the banner is suppressed
  for machine formats so stdout stays valid JSON/SARIF (this also fixes a
  pre-existing codescan --format json banner leak).
- `--verify --format sarif` errors up front instead of running (and billing) a
  device flow whose runtime result SARIF can't carry; use --format json for
  combined static+runtime output.
- README documents the format + a codeql-action/upload-sarif example.
- Tests validate structure, dedup, levels, locations, and the empty case.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 15:51:58 -07:00
ethan zhou
3bfafe5a47 Add UIWebView-removed CRITICAL + encryption export-compliance check
Tier 2 coverage rule pack from the scanner review:

- uiwebview-removed (CRITICAL, §2.5.1): Apple stopped accepting apps/updates
  using UIWebView, so its presence is a hard rejection. Prefix-matched so
  UIWebViewDelegate is caught, with a word boundary so custom names like
  MyUIWebView are not.
- export-compliance (INFO): flags an Info.plist or Expo app.json that doesn't
  declare encryption export compliance (ITSAppUsesNonExemptEncryption /
  ios.config.usesNonExemptEncryption). Without it, App Store Connect prompts for
  export compliance on every upload.
- README + codescan --help updated to list both. Tests for each.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 14:58:39 -07:00
ethan zhou
d833730c82 Polish: unify --version wording, document ignore-directive matching
Addresses review nits:
- `greenlight --version` now prints "greenlight <v>" to match the `version`
  subcommand (was cobra's default "greenlight version <v>").
- Document directiveSuppresses: bare directive (no trailing tokens) suppresses
  all rules; otherwise tokens are matched against the rule id, so a trailing
  reason without an id does not blanket-suppress.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 13:46:18 -07:00
ethan zhou
de2a85d12c Format entire repo with gofmt
Mechanical: `gofmt -w .` clears the pre-existing formatting backlog (14 files)
so a gofmt check can be enforced in CI. No logic changes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 13:40:13 -07:00
ethan zhou
f1a9dfa966 QOL: build-info version fallback, UTF-8 length checks, inline ignore
Tier 1 (QOL), content batch:

- version: `--version` now works (rootCmd.Version is set), and `go install
  ...@latest` reports the embedded module version instead of "dev" via a
  runtime/debug.ReadBuildInfo() fallback. ldflags-injected release builds still
  take precedence.
- checks: App Store metadata length checks (name, description, keywords,
  promotional text) count characters with utf8.RuneCountInString, not bytes, so
  non-ASCII metadata is not falsely flagged as over Apple's limits.
- codescan: honor an inline `// greenlight:ignore[ rule-id]` directive on the
  matching line or the line directly above it (bare = all rules on the line).
- Tests for each.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 13:12:54 -07:00
ethan zhou
20a7f1da7d Add preflight tests for HIGH counting, dedup, and --exit-code
Closes the unit-test gap flagged in review (preflight had none):
- computeSummary counts HIGH separately; Passed stays "no criticals".
- dedup keeps the highest severity when scanners share a title.
- preflightExit trips only with --exit-code, on critical/high or a failed flow.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 11:58:58 -07:00
ethan zhou
ab0e5c3181 Add HIGH severity tier, honest 3-state verdict, and --exit-code
Tier 0 (verdict integrity), severity + CI-gating batch:

- codescan: new SeverityHigh tier between WARN and CRITICAL. The four
  flow-dependent guidelines static analysis can only weakly assert -- missing
  ATT (5.1.2), Sign in with Apple (4.8), Restore Purchases (3.1.1), account
  deletion (5.1.1) -- move from WARN to HIGH. They are likely rejections, not
  best-practice nits; labeling them WARN let rejectable apps read as GREENLIT.
- Severity now marshals to its NAME ("HIGH") instead of an integer ordinal, so
  inserting a tier never shifts the JSON wire value for consumers.
- preflight + codescan: three-state headline -- NOT READY (critical) /
  NEEDS REVIEW (high, no critical) / GREENLIT (neither). Summary gains a `high`
  count. `passed` deliberately stays "no criticals" for backward compatibility
  (README CI reads .summary.critical), so no existing behavior silently flips.
- preflight + verify: opt-in --exit-code flag for CI gating. preflight exits
  non-zero on any CRITICAL/HIGH (or, with --verify, a failed flow); verify exits
  non-zero on any failed/errored flow (it previously always exited 0, defeating
  its purpose as a gate). Implemented via an ErrThreshold sentinel that main()
  maps to a quiet exit 1; cobra error/usage printing moved to main().
- Tests: hard-rejection rules pinned at HIGH, summary High counting, name-based
  JSON marshaling.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 11:51:42 -07:00
ethan zhou
14fd1734e3 Add runtime-tier --artifact upload and --open live session
Two additions to `greenlight verify` (and `preflight --verify`).

--artifact uploads a prebuilt simulator .app (iOS) or .apk (Android) to
Revyl before running, so a build that isn't on Revyl yet can be validated
in one step. It resolves the build name to an app id; if the name is new it
registers the app explicitly with `revyl app create`, then uploads with
`revyl build upload --file <art> --app <id> --set-current`. A device .ipa is
rejected (Revyl runs on cloud simulators), and a platform/extension mismatch
(e.g. --platform ios with an .apk) is caught before upload. It is mutually
exclusive with --build. The upload outcome shows in terminal and JSON.

--open auto-opens the live Revyl session in the browser while the test runs
and prints "Watch live: <url>" to stderr, so --format json stays clean on
stdout. The link is app.revyl.ai/sessions/<session_id>?wfr=<execution_id>.

revyl client: add CreateApp. UploadBuild now uploads to an app id; the prior
--name path dropped into an interactive app picker that hangs with no TTY.

Tests: ValidateArtifact accepts .app/.apk, rejects .ipa, platform mismatch,
and missing/unsupported paths.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-02 17:16:52 -07:00
ethan zhou
440c0e1e10 Address Copilot 4th pass: clean JSON output + smaller robustness fixes
- cli: suppress the human banner under --format json (verify and preflight) so
  stdout is valid JSON and pipes into jq.
- runner: surface the report fetch error in the "could not determine" detail
  instead of always blaming a non-finalized report; clean up the temp dir if the
  YAML write fails (no leaked dirs across runs).
- revyl: truncate cleanReason by runes, not bytes, so a long reason can't be cut
  mid UTF-8 character.
- codescan: dedupOnceRules sorts findings by file/line/title before collapsing,
  so the surviving finding per project-level rule is deterministic (findings are
  appended from goroutines).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-01 20:24:59 -07:00
ethan zhou
2cac3722ae Address Copilot 3rd pass: finalized-report verdict + input validation
- runner: require the Revyl report to finalize before declaring VERIFIED or
  FAILED. Previously a passing exit code with an unsettled report could yield a
  false VERIFIED; now an undecided report is always "could not determine."
- verify: validate --flows against the known flow ids (a typo failed silently as
  an empty "nothing to verify" run) and validate/normalize --platform to ios or
  android before generating YAML.

Tests added: validateFlows.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-01 20:17:09 -07:00
ethan zhou
d71b693b46 Address PR review (Copilot + code review): correctness + robustness
Codescan:
- Sync claims.go reDeleteAccount with the expanded account-no-delete anti-pattern
  so HasDeleteAccountCode / StaticPassed no longer drift (Vault "Close account").
- Tighten the §5.1.1 anti-pattern: drop the over-broad `account.*clos` (matched
  incidental `accountClosed`) and narrow `delete.*my.*(data|account)` to account
  only, so GDPR data-deletion and stray lines can't suppress a real violation.
- firstMatchOnly findings are now collapsed to one per project at the scanner
  level (dedupOnceRules), not just one per file.

verify / revyl:
- Don't classify an undecided report as FAILED: if the report never finalizes,
  report StatusError ("could not determine the outcome") instead of crying wolf.
- Propagate AppID resolution errors so a CLI/parse failure isn't surfaced as a
  misleading "no Revyl app found".
- yamlStr escapes \n/\r/\t and `platform` is now quoted, so a --var/--platform
  value with control chars can't corrupt the generated YAML.
- Authenticated() trusts the auth-status exit code instead of requiring a
  specific success word (resilient to reworded/JSON output).
- extractJSON does balanced brace matching (string-aware), robust to braces in
  surrounding log lines; previously first-{ to last-} could grab the wrong span.
- --var uses StringArray + a first-'=' split (parseVars) instead of pflag
  StringToString, so values with commas or '==' (JWT/base64) survive intact.

cli:
- verify --format json now includes the `onboarding` field, so machine consumers
  see why flows are pending.

Tests added: parseVars, extractJSON balanced, account anti-pattern tightening.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-01 20:00:22 -07:00
ethan zhou
55b185c809 Point static users to --verify; say "cloud device", not "real device"
- preflight (static): add a light one-line tip pointing to `preflight --verify`
  — a pointer to the runtime command, not a signup wall
- terminology: Revyl runs on cloud devices (cloud-hosted sims), not physical
  hardware. Replace every "real device(s)" with "cloud device(s)" across the
  CLI output, help text, README, and SKILL — including the upstream tagline

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-01 17:51:33 -07:00
ethan zhou
e668ec3a6b Keep the static scanner separate: drop the auto upsell from preflight
The free static scanner should deliver full value on its own without pushing
Revyl. Remove the automatic runtime nudge from plain `preflight` so its default
output is unchanged from upstream — offline, complete, no pitch.

The Revyl runtime tier stays strictly opt-in: it only appears when the user
explicitly runs `greenlight verify` or passes `preflight --verify`. Also
decouples the two tiers in the README lead so static reads as its own product.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-01 17:43:33 -07:00
ethan zhou
12dbf463d5 verify: Revyl sign-up funnel when the user has no account
The runtime tier is greenlight's activation moment for Revyl — so when a user
reaches it without a Revyl account, don't dump a raw auth error. Detect the
state and show a sign-up call-to-action that lists exactly which flow-dependent
guidelines they'd unlock (account deletion, restore purchases, Sign in with
Apple) and how to start free.

- revyl.Client.Authenticated(): detect a usable session via `revyl auth status`
- revyl: SignupURL / InstallCmd / LoginCmd constants (app.revyl.ai/signup, the
  install.sh one-liner, `revyl auth login`)
- verify: detect readiness once (cli-missing vs not-authenticated) -> Onboarding;
  claimed flows become "pending" instead of erroring per-flow
- cli: printSignupCTA() renders the funnel (3-step for new users, 1-step if the
  CLI is already installed) in place of the GREENLIT/NOT-READY footer

Flows through both `greenlight verify` and the chained `preflight --verify`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-01 17:38:44 -07:00
ethan zhou
f0eb893802 preflight --verify: chain static checks into Revyl runtime validation
Make the static->runtime handoff a single command (the Revyl upsell in one
take): `greenlight preflight --verify --build-name X` runs every static scanner,
then hands the flow-dependent guidelines to Revyl to run on a real device, and
prints both sections under one report (terminal and combined JSON).

Also adds a soft nudge to plain `preflight`: when the app claims a flow-dependent
feature (account creation, IAP, social login), point the user at `greenlight
verify` — static can confirm the code exists, not that the flow works.

The offline/zero-account default is untouched: the device tier only engages
under the explicit --verify flag.

- preflight: --verify + --build-name/--var/--device-model/--os-version, chained
  output, printRuntimeNudge(), writeCombinedJSON()
- refactor: preflightJSONObject()/verifyJSONObject() so static+runtime compose

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-01 17:32:24 -07:00
ethan zhou
fbe2b73be6 verify: parse real Revyl report schema for failure evidence
Validated against a live device run (sign-in-apple on a Spootify build): the
create -> run -> verdict pipeline works, with the run's exit code as a robust
verdict backstop. This pins the verdict + evidence to Revyl's actual
`revyl test report --json` schema instead of guessed field names.

- revyl.Report()/parseReport(): read session_status (authoritative verdict) and
  the first failing step's step_description + status_reason as evidence
- runner: prefer the report verdict over the exit-code backstop; surface the
  failing step and a cleaned reason on the finding
- cli: render the failure reason line
- client_test.go: parse a real captured report (pass + fail) and the run-verdict
  fallback logic — the repo's first tests

Now a failed flow reads e.g.:
  failed at: Go to the login screen
  reason: Failed to open URL spotify://login ...

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-01 17:12:34 -07:00
ethan zhou
809813a3d4 Add greenlight verify: runtime flow validation via Revyl CLI
Static analysis can confirm a flow-dependent guideline EXISTS in source, never
that it WORKS. The three flow-dependent rules (account-no-delete §5.1.1,
iap-no-restore §3.1.1, social-login-no-apple §4.8) suppress their warning the
moment an anti-pattern string (e.g. `deleteAccount`) appears anywhere in source.
A "Delete Account" button wired to nothing therefore passes codescan and gets
GREENLIT — but dead-ends at runtime, and Apple rejects it under §5.1.1(v).

`greenlight verify` closes that gap. It runs a static pre-scan to learn which
flows the app *claims*, generates a Revyl test (YAML) for each claimed flow, and
hands it to the `revyl` CLI to run on a real device. A flow that passed static
but fails on-device becomes a BLOCK static could never produce, with a shareable
Revyl report link as evidence.

This is a deliberately separate, opt-in tier: unlike the offline/zero-account
static scanners, verify needs the revyl CLI, a Revyl account, and a registered
build. Run preflight first for GREENLIT, then verify before submitting.

- internal/codescan/claims.go — DetectClaims(): feature presence without
  anti-pattern suppression, reusing the scanner's file walk
- internal/revyl/client.go — thin wrapper over the revyl CLI (EnsureTest,
  RunTest, ReportShareURL) with tolerant --json + exit-code verdict parsing
- internal/verify/{flows,render,runner}.go — flow registry, Revyl test YAML
  generation, and the orchestrator that maps runtime results to findings
- internal/cli/verify.go — `greenlight verify` command (terminal + JSON,
  --dry-run, --flows, --var, device targeting)
- README.md / SKILL.md — document the runtime tier and the static→runtime loop

Implements the runtime validation publicly teased for greenlight.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-01 16:59:05 -07:00
Landseer100
fc68ef1ce3 Initial release: standalone greenlight CLI
Pre-submission compliance scanner for the Apple App Store.

Fixes:
- Implement antiPatternsGlobal two-pass scanning (rules like missing-att,
  social-login-no-apple now correctly check anti-patterns across all project
  files instead of only the current file)
- Remove dead printFooter() in scan.go (handled by report.go)
- Remove no-op checkAppIconExists() (icon checks handled by app.json parser)
- Fix all go vet warnings (redundant newlines in Println calls)

Adds MIT license, CI workflow, and updated .gitignore.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 14:54:57 -08:00