PramanaSutra AI v0.3.4 GitHub

Technical reference

Source of the running tool: packages/cli/. Node.js ES modules. No npm install is required to run it, because there are no dependencies. Dev-time checks are node --test.

Modules#

FileResponsibility
packages/cli/bin/pramanasutra.mjsArgument parsing, commands, process exit code. Version string is read from root package.json
packages/cli/lib/scanner.mjsDirectory walk, test-file classification, rules, evaluateGate
packages/cli/lib/evidence.mjsLoad and validate evidence. Classify it as absent, failing, inconclusive, unverified or passing
packages/cli/lib/policy.mjsDefault policy and fail-closed loader
packages/cli/lib/report.mjsmarkdown(), html(), writeReports(). escapeHtml is exported and tested
packages/cli/lib/installer.mjsMap of IDE directories and the copy routine
scripts/ci-gate.mjsRuns the unit tests, builds evidence from that output, release-checks this repo
scripts/generate-proof.mjsRegenerates sample reports, proof/ and documents/pramanasutra/audit
scripts/build-docs.mjsBuilds this HTML site from the numbered Markdown files

Exit codes#

CodeWhen
0doctor on Node 20+, help, version, agents, init, verify success, scan or release-check with READY_FOR_HUMAN_APPROVAL
1Bad arguments, unreadable input, invalid evidence, invalid policy, doctor on Node older than 20, unknown command
2scan or release-check decision NO_GO
3scan or release-check decision REVIEW_REQUIRED

scan and release-check both use 2 for NO_GO and 3 for REVIEW_REQUIRED. Exit 0 from either command is READY_FOR_HUMAN_APPROVAL only. A scan without an evidence file cannot be ready.

Report object (schema 1.0.0)#

Written as report.json. The Markdown and HTML are renderings of this object, plus a few fixed explanation sentences.

FieldMeaning
schemaVersion"1.0.0"
productPramanaSutra AI
toolVersionVersion from package.json at scan time
generatedAtISO-8601 UTC
scannedPathBase name of the target directory only
capabilitiesMap of capability to executed, not-run, not-supported or evidence-supplied
inventory.fileCountFiles that were listed, after ignore rules and skip directories
inventory.testFilesRelative paths classified as tests
inventory.manifestspackage.json, pyproject.toml, go.mod, Gradle, Maven, Cargo, Gemfile, Composer, pubspec, .sln, .csproj, requirements.txt
inventory.ciWorkflowsGitHub Actions under .github/workflows, plus GitLab, Jenkins, Azure Pipelines, Bitbucket Pipelines, CircleCI, Buildkite, Drone and Woodpecker file names
inventory.changedFilesPresent as an array only when --changed could run git diff. null when the flag was omitted or git was unavailable
inventory.partialTrue when the walk truncated, skipped a large or binary test file, or could not read a directory
inventory.ignoredPathsCount of file or directory entries skipped because of .pramanasutraignore
findings[]id, ruleId, severity, confidence, title, description, evidence.path, evidence.line, recommendation, status
limitations[]Sentences about skips, truncation, ignore
releaseGatedecision, policy, reasons[], requiresHumanApproval, executedTestEvidence, evidenceState, automatedDeploymentAuthorized
evidencePresent only when --evidence was accepted. Echoes source, command, time, exit code, passed, failed, skipped, environment, commit, and github or null. Omitted on a plain scan

Adding toolVersion and evidence does not change schemaVersion. Consumers that ignore unknown fields keep working. Consumers that reject unknown fields will need a change; none are shipped in this repo.

Evidence file#

FieldRule
schemaVersionMust be "1.0.0"
sourcelocal-executed, ci-ingested, or external-unverified
commandNon-empty string. Shown in the report. Escaped. It is not executed
executedAtISO-8601 timestamp
exitCodeInteger. Non-zero is failing even if failed is 0
passed, failedIntegers ≥ 0
skippedOptional integer ≥ 0
environment, commitOptional strings
githubOptional object. When present, repository, sha, runId and workflow must each be a non-empty string. The report then says ci-environment. Missing github is unbound. Neither state is a signature

Classification order: no file → absent. failed > 0 or exitCode !== 0 → failing. passed === 0 → inconclusive. external-unverified → unverified. Otherwise → passing. Only passing can unlock the ready state, and only together with the policy's static requirements.

Policy keys#

Boolean keys, defaulting to the recommended policy when omitted: releaseRequiresExecutedEvidence, blockOnFocusedTests, blockOnSkippedTests, requireCi, requireLicense, requireTests.

name is a string up to 80 characters.

Fixed keys, accepted only at the safe value: schemaVersion must be "1.0.0" if present, allowAutomatedDeployment must be false, manualApprovalsRequired must be true. Any other key is an error.

Scan limits#

LimitValue
Max depth22
Max files listed20,000
Max test file read2,000,000 bytes
Max evidence file1,000,000 bytes
Max policy file100,000 bytes
Max ignore file100,000 bytes

Skipped directory names: .git, node_modules, .venv, venv, dist, build, target, coverage, .next, .nuxt, .turbo, .cache, reports, pramanasutra-reports, .idea, .gradle, vendor, bin, obj.

Test detection#

A file is a test if the relative path (forward slashes) matches a test directory (test, tests, __tests__, spec, specs, e2e), or a name like *.test.*, *.spec.*, *_test.go, test_*.py, *_spec.rb, or a class-style name such as UserServiceTest.java. Look-alikes such as Submit.java are not tests. The check is a regex, not a language module.

Rules run only on test files whose extension is in the source list: JS/TS and JSX/TSX, Python, Go, Rust, Ruby, PHP, Java, Kotlin, Swift, Dart, C#, Vue, Svelte.

Ignore file#

.pramanasutraignore at the scan root. Blank lines and # comments are ignored. A line ending in / excludes that directory and everything under it. Any other line excludes that relative path and its children. Backslashes are normalized. .. and absolute paths throw.

This repository's file excludes fixtures/ and examples/sample-app/ because those trees contain intentional test.only examples.

Installer map#

--ideDirectory under the target
claude.claude/skills
cursor.cursor/skills
codex.agents/skills
gemini.gemini/skills
copilot.github/skills
generic.agents/skills
allEach distinct path above

codex and generic share a path, so all does not copy that directory twice. Copying onto the canonical source directory itself is a no-op for that one destination.

Commands the shell accepts#

See CLI and reports for examples. Unknown options fail. --help, -h, --version and -v are commands, not errors. Values are required for --path, --out, --ide, --target, --evidence and --policy.

PramanaSutra AI 0.3.4 · Created by Vatsal Shah · Apache-2.0 · Decision support, not a certification · Page source