Language API reference
This file is generated from enforced PHP interface docblocks and the isolated PHP, TypeScript, Python and Rust worker surfaces.
PHP extension interfaces
Knossos\Classification\ClassificationRule
id(): string: Return the stable identifier recorded as classification provenanceclassify(Knossos\Scanner\Protocol\NodeFact $node): array: Classify one graph node without mutating it
Knossos\Cli\CliCommand
supports(string $command): bool: Reports whether this handler owns the requested CLI command nameallowedOptions(string $command): array: Returns the option names this handler accepts for the given command, sorun(string $command, array $positionals, array $options, Knossos\Cli\CliCommandContext $context): int: Executes a supported CLI command using parsed positional arguments and options
Knossos\Git\GitHistoryProvider
history(string $projectRoot, int $sinceDays, int $maxCommits, int $timeoutMs): array: Return bounded, read-only change history for project-relative files
Knossos\Git\GitProcessRunnerInterface
run(array $command, int $timeoutMs, string $operation): string: Run a bounded, timeout-controlled Git command
Knossos\Git\GitWorkingTreeProvider
changes(string $projectRoot, ?string $baseRef, int $maxFiles, int $timeoutMs): array: Return bounded changed paths and explicit renames without modifying Git
Knossos\Install\ReleaseProbe
doctor(string $releaseDir, string $scratchDir): ?string: Runknossos doctorof a release against a scratch data directoryversion(string $releaseDir, string $scratchDir): ?string: The version a release reports, or null when it does not runplugin(string $releaseDir, string $pluginDir, string $launcher, string $dataDir, string $scratchDir): ?string: Have a release materialise its own plugin, running noclaudecommand
Knossos\Install\ReleaseSource
latest(): string: The newest released version, without a leadingvfetch(string $version, string $asset, string $to): void: Copy one asset of a release to a local file
Knossos\Query\SemanticRanker
id(): string: Return the stable provider identifier included in ranking provenancerank(string $featureDescription, array $candidates, int $timeoutMs): array: Score bounded candidate text without changing deterministic base factors
Knossos\Scan\ProjectScanner
scan(string $root, Knossos\Scan\ScanOptions $options = {"name":null,"maxFiles":null,"maxFileBytes":null,"explicitBoundaries":null,"mode":null,"cancellation":null,"snapshotRetention":null,"workerTimeoutMs":null,"workerMemoryMb":null,"runEnrichers":false,"lease":null,"startedBy":"cli"}): Knossos\Result\ResultEnvelope: Build or refresh a project's graph and return the result envelope
Knossos\Scanner\ScannerClient
initialize(): Knossos\Scanner\Protocol\ScannerManifest: Negotiate the worker contract before any project input is sentscan(array $request): iterable: Stream owned facts for a bounded, validated scan requestshutdown(): void: Shut down the worker and release its complete process tree
Knossos\Store\GraphRepository
transaction(callable $operation): mixed: Execute an operation atomically and return its resultbulkTransaction(callable $operation, ?string $projectId = null): mixed: Execute a whole-graph rewrite atomically, checking referential integritysaveProject(string $id, string $name, string $rootRealpath, array $config = []): void: Create or update project identity and non-secret configuration metadatafindProject(string $id): ?array: Find one project by stable IDcreateScan(string $id, string $projectId, string $mode, string $scannerSetHash, ?string $gitHead = null, ?string $dirtyPathsJson = null, ?string $unitInputsJson = null): void: Record the start of a scan before graph reconciliationcompleteScan(string $projectId, string $scanId): void: Atomically make a successfully reconciled scan activerecordFailedScan(string $id, string $projectId, string $mode, string $status): void: Persist a terminal (failed or cancelled) scan attempt so it is observablearchiveActiveSnapshot(string $projectId, string $configHash, int $retention): void: Retain the active snapshot under the configured bounded history policyexistingGraphIds(string $projectId): array: The ids a project's graph currently holds, per table, before a scan writes its ownpruneGraph(string $projectId, array $existing, array $desired): void: Delete the graph rows a scan did not produce, leaving the rest untouchedstampGraphScan(string $projectId, string $scanId): void: Attribute every surviving graph row to the scan that just confirmed itclearProjectDiagnostics(string $projectId): void: Drop a project's diagnostics, which belong to the scan that produced themsaveFile(string $id, string $projectId, string $relativePath, string $contentHash, int $size, int $mtime, string $language, string $scannerVersion, string $scanId, int $lineCount = 0): void: Persist one scanned file and its content/provenance fingerprintssaveNode(string $id, string $projectId, string $language, string $kind, string $canonicalName, string $displayName, ?string $parentId, ?string $fileId, ?int $startLine, ?int $endLine, string $origin, string $confidence, array $attributes, string $ownerKey, string $scanId): void: Persist one evidence-backed graph nodesaveEdge(string $id, string $projectId, string $kind, string $sourceId, string $targetId, ?string $fileId, ?int $startLine, ?int $endLine, string $origin, string $confidence, array $attributes, string $ownerKey, string $scanId): void: Persist one occurrence-level, evidence-backed directed graph edgesaveNodes(array $nodes, string $projectId, string $scanId): void: Persist a batch of evidence-backed graph nodes as one multi-row upsertsaveEdges(array $edges, string $projectId, string $scanId): void: Persist a batch of occurrence-level, evidence-backed directed graph edgessaveFiles(array $files, string $projectId, string $scanId): void: Persist a batch of discovered files as one multi-row upsertsaveClassifications(array $classifications, string $projectId, string $scanId): void: Persist a batch of role classifications as one multi-row insertsaveBoundaryMemberships(array $memberships, string $projectId, string $scanId): void: Persist a batch of boundary memberships as one multi-row insertsaveDiagnostic(string $id, string $projectId, string $scanId, ?string $fileId, string $severity, string $code, string $message, ?int $startLine, ?int $endLine, string $ownerKey): void: Persist one bounded scanner or reconciliation diagnosticsaveClassification(string $id, string $projectId, string $nodeId, string $role, string $origin, string $confidence, string $ruleId, ?string $fileId, ?int $startLine, ?int $endLine, array $attributes, string $scanId): void: Persist one deterministic role classification with rule provenancesaveBoundary(string $id, string $projectId, string $name, array $matcher, string $source, string $scanId): void: Persist an explicit or inferred architecture boundarysaveBoundaryMembership(string $boundaryId, string $projectId, string $nodeId, string $scanId): void: Associate a node with one boundary for the active scanreplaceContributionCache(string $projectId, array $entries, array $readGroups = []): void: Bring a project's incremental contribution cache to the given entries and read groupsfindNodesByName(string $projectId, string $name, int $limit = 20): array: Return bounded exact and display-name component matchesoutgoing(string $projectId, string $nodeId, ?string $kind = null, int $limit = 100): array: Return bounded outgoing adjacency rows for one nodeincoming(string $projectId, string $nodeId, ?string $kind = null, int $limit = 100): array: Return bounded incoming adjacency rows for one node
Isolated worker APIs
| Runtime | Contract | Responsibility |
|---|---|---|
| TypeScript | TypeScriptScanner.scan | Stream deterministic owned contributions for the requested source files |
| TypeScript | discoverConfigFiles | Return sorted project-relative tsconfig and jsconfig paths below a validated root |
| PHP | WorkerServer.run | The protocol loop: read a request, dispatch it, write the reply |
| PHP | PhpScanner.scan | Parse the requested files and return their contributions and diagnostics |
| Rust | server::run | Read requests until stdin ends or shutdown arrives, writing replies to output |
| Rust | server::handle | Dispatch one request, returning its result value or an error message |
| Python | PythonAstFactCollector | Coordinate one AST traversal and delegate fact enrichment |
| Python | scan | Parse a bounded file set and emit one owned contribution per input |
| Python | handle | Validate and dispatch one NDJSON JSON-RPC worker request |