@methiu/raigal 0.2.4 → 0.2.6

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/README.md CHANGED
@@ -33,7 +33,7 @@ See [Installation](#installation) for all options.
33
33
 
34
34
  Raigal supports TypeScript, JavaScript, Expo / React Native, Python, Go, Rust, Ruby, PHP, C#, and C/C++.
35
35
 
36
- Coverage includes formatting, linting, complexity, AI-slop detection, and security checks. Some checks use optional system tools; see [Installation](https://raigal.gitbook.io/raigal-docs/getting-started/installation).
36
+ Coverage includes formatting, linting, complexity, AI-slop detection, and security checks. Some checks use optional system tools; see [Installation](https://docs.raigal.dev/getting-started/installation).
37
37
 
38
38
  ```bash
39
39
  raigal agent # repair with your coding agent (Codex/Claude/OpenCode)
@@ -95,7 +95,7 @@ pipx install raigal
95
95
 
96
96
  `pipx` keeps `raigal` in its own isolated environment. Needs Node.js on `PATH`.
97
97
 
98
- Full reference for every channel, optional bundled tooling, and external tools: [Installation Docs](https://raigal.gitbook.io/raigal-docs/getting-started/installation).
98
+ Full reference for every channel, optional bundled tooling, and external tools: [Installation Docs](https://docs.raigal.dev/getting-started/installation).
99
99
 
100
100
  ---
101
101
 
@@ -309,7 +309,7 @@ raigal ci --sarif # SARIF output for code scanning
309
309
 
310
310
  ```bash
311
311
  raigal # interactive menu
312
- raigal init # create .raigal/config.yml
312
+ raigal init # interactive setup: engines, threshold, and CI pipeline (GitHub, GitLab, Bitbucket)
313
313
  raigal init --strict # enterprise-grade gate: all engines, typecheck, failBelow 85
314
314
  raigal doctor # check which engines can run here
315
315
  raigal rules # list rules with severity, fixability, and score impact
@@ -324,12 +324,14 @@ raigal commands # full command list
324
324
 
325
325
  **Score history**: a normal (full-project, interactive) `scan` appends a compact record to `.raigal/history.jsonl` (timestamp, score, error/warning counts, file count, CLI version). `raigal trend` and `raigal trends` read it and print a relative-time table plus an ASCII sparkline of recent scores. History is a local side effect only: it is never written for `--json`/`--sarif` output, in CI, or when `RAIGAL_NO_HISTORY=1` is set, so machine output stays clean.
326
326
 
327
- Docs: [Commands Reference](https://raigal.gitbook.io/raigal-docs/cli-reference/commands)
327
+ Docs: [Commands Reference](https://docs.raigal.dev/cli-reference/commands)
328
328
 
329
329
  ---
330
330
 
331
331
  ## CI integration
332
332
 
333
+ Running `raigal init` automatically inspects your repository, detects your CI provider (GitHub Actions, GitLab CI, or Bitbucket Pipelines), and scaffolds your CI workflow with zero guesswork.
334
+
333
335
  ### Pre-commit
334
336
 
335
337
  Run directly on staged files:
@@ -353,7 +355,7 @@ repos:
353
355
 
354
356
  ### GitHub Actions
355
357
 
356
- Add `.github/workflows/raigal.yml` to your repository. Provide your organization token via the `RAIGAL_TOKEN` secret. Setting `id-token: write` enables GitHub OIDC verification so the server can verify the repository owner:
358
+ Scaffolded via `raigal init` as `.github/workflows/raigal.yml`. Setting `id-token: write` enables zero-token GitHub OIDC entitlement verification against your organization allowlist. Alternatively, pass an organization machine token via the `RAIGAL_TOKEN` secret:
357
359
 
358
360
  ```yaml
359
361
  name: raigal
@@ -378,6 +380,7 @@ jobs:
378
380
  run: npx --yes @methiu/raigal@latest ci
379
381
  env:
380
382
  RAIGAL_TOKEN: ${{ secrets.RAIGAL_TOKEN }}
383
+ # RAIGAL_ORG_ID: ${{ vars.RAIGAL_ORG_ID }} # Required only if repository owner belongs to multiple Raigal orgs
381
384
  ```
382
385
 
383
386
  **GitHub code scanning (SARIF)**: emit a SARIF 2.1.0 report and upload it so findings appear in the Security tab:
@@ -389,26 +392,61 @@ jobs:
389
392
  sarif_file: raigal.sarif
390
393
  ```
391
394
 
395
+ ### GitLab CI
396
+
397
+ Scaffolded via `raigal init` as `.gitlab-ci.yml`. Gating merge requests on changed code and default branch pushes on full repository analysis:
398
+
399
+ ```yaml
400
+ # .gitlab-ci.yml
401
+ raigal_quality_gate:
402
+ image: node:24
403
+ stage: test
404
+ script:
405
+ - if [ -n "$CI_MERGE_REQUEST_IID" ]; then npx --yes @methiu/raigal@latest ci --changes --base "$CI_MERGE_REQUEST_DIFF_BASE_SHA"; else npx --yes @methiu/raigal@latest ci .; fi
406
+ variables:
407
+ RAIGAL_TOKEN: $RAIGAL_TOKEN
408
+ # RAIGAL_ORG_ID: $RAIGAL_ORG_ID # Required only if repository owner belongs to multiple Raigal orgs
409
+ rules:
410
+ - if: $CI_PIPELINE_SOURCE == "merge_request_event"
411
+ - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
412
+ ```
413
+
414
+ Set `RAIGAL_TOKEN` under **Settings > CI/CD > Variables**.
415
+
392
416
  ### Bitbucket Pipelines
393
417
 
394
- Bitbucket clones shallow by default, so fetch the PR target branch and gate on only the changed files with `ci --changes --base`:
418
+ Scaffolded via `raigal init` as `bitbucket-pipelines.yml`. Full clone is configured so branch diffs against the pull request destination branch resolve cleanly:
395
419
 
396
420
  ```yaml
397
421
  # bitbucket-pipelines.yml
398
422
  pipelines:
423
+ default:
424
+ - step:
425
+ name: raigal quality gate
426
+ image: node:24
427
+ script:
428
+ - npx --yes @methiu/raigal@latest ci .
429
+ secrets:
430
+ - RAIGAL_TOKEN
431
+ # - RAIGAL_ORG_ID
399
432
  pull-requests:
400
433
  "**":
401
434
  - step:
402
- name: raigal gate
435
+ name: raigal quality gate
403
436
  image: node:24
404
437
  clone:
405
- depth: full # branch diffs need history
438
+ depth: full # branch diffs need full history
406
439
  script:
407
440
  - git fetch origin "$BITBUCKET_PR_DESTINATION_BRANCH"
408
441
  - npx --yes @methiu/raigal@latest ci --changes --base FETCH_HEAD
442
+ secrets:
443
+ - RAIGAL_TOKEN
444
+ # - RAIGAL_ORG_ID
409
445
  ```
410
446
 
411
- `ci` applies the score gate and exit code, so no JSON parsing or hand-rolled threshold is needed. More providers: [CI/CD Documentation](https://raigal.gitbook.io/raigal-docs/automation-and-ci-cd/ci-cd).
447
+ Set `RAIGAL_TOKEN` under **Repository settings > Repository variables**.
448
+
449
+ `ci` applies the score gate and exit code, so no JSON parsing or hand-rolled threshold is needed. More providers: [CI/CD Documentation](https://docs.raigal.dev/automation-and-ci-cd/ci-cd).
412
450
 
413
451
  ### Quality gate
414
452
 
@@ -419,7 +457,12 @@ ci:
419
457
  failBelow: 70
420
458
  ```
421
459
 
422
- `raigal ci` exits 1 when score < threshold. Docs: [CI/CD Documentation](https://raigal.gitbook.io/raigal-docs/automation-and-ci-cd/ci-cd)
460
+ `raigal ci` evaluates PRs with a calibrated 3-state verdict:
461
+ - **`PASSED`**: Score $\ge$ threshold (default 70) and 0 blocker errors or warnings.
462
+ - **`PASSED (WITH WARNINGS)`**: Score $\ge$ threshold and 0 blocker errors, but actionable warnings present. Merges proceed without blocking.
463
+ - **`FAILED / BLOCKED`**: Score $<$ threshold, non-zero exit code, or blocker errors present. Merges are blocked.
464
+
465
+ When using GitHub Actions OIDC in multi-tenant organizations, set `RAIGAL_ORG_ID: org_...` in your workflow environment if your repository owner is mapped across multiple organizations.
423
466
 
424
467
  ---
425
468
 
@@ -458,21 +501,21 @@ Six deterministic engines run in parallel:
458
501
  | **Security** | Vulnerabilities and risky code | eval, innerHTML, SQL/shell injection, dependency audits for JavaScript, Python, Rust, Go, and .NET |
459
502
  | **Architecture** | Structural rules (opt-in) | Custom import bans, layering rules, required patterns |
460
503
 
461
- See the full [Rules Reference](https://raigal.gitbook.io/raigal-docs/core-concepts/rules).
504
+ See the full [Rules Reference](https://docs.raigal.dev/core-concepts/rules).
462
505
 
463
506
  ---
464
507
 
465
508
  ## Research
466
509
 
467
- Raigal rules are shaped by public scans and benchmark-derived failure modes, not only local fixtures. The [documentation](https://raigal.gitbook.io/raigal-docs) defines how to run repeatable open-source scans: pin the cohort, store raw JSON, classify findings, fix noisy rules with regression tests, and publish the limits.
510
+ Raigal rules are shaped by public scans and benchmark-derived failure modes, not only local fixtures. The [documentation](https://docs.raigal.dev) defines how to run repeatable open-source scans: pin the cohort, store raw JSON, classify findings, fix noisy rules with regression tests, and publish the limits.
468
511
 
469
512
  ---
470
513
 
471
514
  ## Docs
472
515
 
473
- Read the complete documentation at [raigal.gitbook.io/raigal-docs](https://raigal.gitbook.io/raigal-docs):
516
+ Read the complete documentation at [docs.raigal.dev](https://docs.raigal.dev):
474
517
 
475
- [Installation](https://raigal.gitbook.io/raigal-docs/getting-started/installation) · [Commands](https://raigal.gitbook.io/raigal-docs/cli-reference/commands) · [Rules](https://raigal.gitbook.io/raigal-docs/core-concepts/rules) · [Configuration](https://raigal.gitbook.io/raigal-docs/cli-reference/configuration) · [Scoring](https://raigal.gitbook.io/raigal-docs/core-concepts/scoring) · [CI/CD](https://raigal.gitbook.io/raigal-docs/automation-and-ci-cd/ci-cd) · [Pull Requests](https://raigal.gitbook.io/raigal-docs/automation-and-ci-cd/pull-requests) · [Agent Repairs](https://raigal.gitbook.io/raigal-docs/automation-and-ci-cd/agent-repairs)
518
+ [Installation](https://docs.raigal.dev/getting-started/installation) · [Commands](https://docs.raigal.dev/cli-reference/commands) · [Rules](https://docs.raigal.dev/core-concepts/rules) · [Configuration](https://docs.raigal.dev/cli-reference/configuration) · [Scoring](https://docs.raigal.dev/core-concepts/scoring) · [CI/CD](https://docs.raigal.dev/automation-and-ci-cd/ci-cd) · [Pull Requests](https://docs.raigal.dev/automation-and-ci-cd/pull-requests) · [Agent Repairs](https://docs.raigal.dev/automation-and-ci-cd/agent-repairs)
476
519
 
477
520
  ## Community
478
521