Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix(quality): include native typed languages in typing audits

Adam Eivy5f5e6b169ce0
diff --git a/client/src/moduleContractConventions.test.js b/client/src/moduleContractConventions.test.js
index 75ade870d4..6859602780 100644
--- a/client/src/moduleContractConventions.test.js
+++ b/client/src/moduleContractConventions.test.js
@@ -6,7 +6,7 @@
* while the shared Toast API had no `info` member: every one threw
* `toast.info is not a function` at runtime, and the component tests stayed
* green because 54 of them mocked Toast WITH an `info` the real module lacked.
- * No scheduled audit owned that class — `typing` only runs on TypeScript repos,
+ * No scheduled audit owned that class — `typing` requires typed-language sources,
* `ui-bugs` needs a live reproduction, and `api-contract` stops at HTTP.
*
* Three rules, each cheap and deterministic:
diff --git a/docs/features/app-quality.md b/docs/features/app-quality.md
index 49d94c1f74..dd5fdc96a3 100644
--- a/docs/features/app-quality.md
+++ b/docs/features/app-quality.md
@@ -194,7 +194,7 @@ the auditing agent read the repository, so its ruling wins until it ages out
(a repository that later gains a UI gets its UI audits back). Otherwise applicability comes from the shapes
present in the tracked files (`git ls-files`): the UI lenses (UX, accessibility,
mobile/responsive, UI bugs, console errors, UI lifecycle, copy) need a user
-interface or a configured UI port, typing needs TypeScript sources, dependency
+interface or a configured UI port, typing needs typed-language sources (including native Swift, TypeScript, Rust, Go, Java, Kotlin, C#, C/C++, Scala, Dart, and F#), dependency
freedom needs a dependency manifest, test quality needs existing tests, and API
contracts need a route/API surface, and infrastructure needs IaC, container,
deployment, process-manager, or CI configuration. Test **coverage** is deliberately never gated
diff --git a/server/lib/auditCatalog.js b/server/lib/auditCatalog.js
index b18b339dfb..50f07fe01f 100644
--- a/server/lib/auditCatalog.js
+++ b/server/lib/auditCatalog.js
@@ -98,7 +98,7 @@ If you find additional problems, mention them in the summary — do not expand s
* one that audit has the most to say about. Its sibling `better-test-quality`
* IS gated, because it assesses tests that exist.
*/
-export const AUDIT_REPO_CAPABILITIES = Object.freeze(['ui', 'typescript', 'tests', 'dependencies', 'api', 'infrastructure']);
+export const AUDIT_REPO_CAPABILITIES = Object.freeze(['ui', 'typescript', 'typed', 'tests', 'dependencies', 'api', 'infrastructure']);
/** Read aliases kept only for in-flight tasks and historical quality records. */
export const LEGACY_AUDIT_TASK_TYPE_ALIASES = Object.freeze({ 'react-lifecycle': 'ui-lifecycle' });
@@ -110,6 +110,7 @@ export const normalizeAuditTaskType = (taskType) => Object.hasOwn(LEGACY_AUDIT_T
export const AUDIT_CAPABILITY_MISSING_REASON = Object.freeze({
ui: 'no user interface found in this repository',
typescript: 'no TypeScript sources found in this repository',
+ typed: 'no supported typed-language sources found in this repository',
tests: 'no test files found in this repository',
dependencies: 'no dependency manifest found in this repository',
api: 'no HTTP route or API surface found in this repository',
@@ -245,14 +246,14 @@ export const AUDIT_DEFINITIONS = Object.freeze({
typing: {
quotaBurnId: null,
label: 'Typing',
- description: 'TypeScript-types audit — configurable: file issues or implement fixes',
+ description: 'Typed-language audit — configurable: file issues or implement fixes',
defaultFileIssues: false,
- requiresCapability: 'typescript',
+ requiresCapability: 'typed',
filing: filing({
slugPrefix: 'typing-',
label: 'typing-audit',
issueLabel: 'code-quality',
- labelDescription: 'Proposed from a TypeScript-types audit',
+ labelDescription: 'Proposed from a typed-language audit',
noun: 'typing finding(s)',
}),
},
diff --git a/server/services/appQualitySchedule.js b/server/services/appQualitySchedule.js
index a0f347e5b0..25c59b34ee 100644
--- a/server/services/appQualitySchedule.js
+++ b/server/services/appQualitySchedule.js
@@ -51,6 +51,9 @@ const VENDOR_SEGMENTS = /(^|\/)(node_modules|vendor|dist|build|out|coverage|\.ve
const CAPABILITY_PATTERNS = {
ui: [/\.(jsx|tsx|vue|svelte|astro)$/i, /\.(html|htm)$/i, /\.(css|scss|sass|less)$/i, /\.storyboard$/i, /\.xib$/i],
typescript: [/\.(ts|tsx|mts|cts)$/i, /(^|\/)tsconfig(\.\w+)?\.json$/i],
+ // Preserve the TypeScript capability for API consumers, while typing audits
+ // also cover native and other statically typed source in mixed repositories.
+ typed: [/\.(ts|tsx|mts|cts|swift|rs|go|java|kt|kts|cs|scala|dart|c|h|cc|cpp|cxx|hpp|fs|fsx)$/i, /(^|\/)tsconfig(\.\w+)?\.json$/i],
tests: [/\.(test|spec)\.[cm]?[jt]sx?$/i, /(^|\/)tests?\//i, /(^|\/)__tests__\//i, /(^|\/)test_[^/]+\.py$/i, /[^/]+_test\.(py|go|rb)$/i, /Tests\.swift$/i],
dependencies: [/(^|\/)package\.json$/i, /(^|\/)requirements[^/]*\.txt$/i, /(^|\/)pyproject\.toml$/i, /(^|\/)Cargo\.toml$/i, /(^|\/)go\.mod$/i, /(^|\/)Gemfile$/i, /(^|\/)composer\.json$/i, /(^|\/)Package\.swift$/i, /(^|\/)pubspec\.yaml$/i],
api: [/(^|\/)(routes?|api|controllers|handlers|endpoints)\//i, /\.proto$/i, /(^|\/)openapi[^/]*\.(ya?ml|json)$/i, /(^|\/)swagger[^/]*\.(ya?ml|json)$/i, /(^|\/)urls\.py$/i],
diff --git a/server/services/appQualitySchedule.test.js b/server/services/appQualitySchedule.test.js
index 8605f19593..878ac887a3 100644
--- a/server/services/appQualitySchedule.test.js
+++ b/server/services/appQualitySchedule.test.js
@@ -58,6 +58,24 @@ describe('audit applicability gate', () => {
expect((await resolveAuditApplicability(app, 'infrastructure')).applicable).toBe(false);
});
+ it('offers and schedules typing for native Swift in a JavaScript app without pretending it has TypeScript', async () => {
+ const app = appWith([...NODE_SERVICE, 'server/native/facetime-ax/main.swift']);
+ const resolved = await resolveQualityChecks(app);
+ expect(resolved.capabilities).toMatchObject({ typed: true, typescript: false });
+ expect(resolved.checks.find(check => check.taskType === 'typing').applicable).toBe(true);
+ expect(await resolveAuditApplicability(app, 'typing')).toEqual({ applicable: true, reason: null });
+ const plan = await buildQualitySchedulePlan(app);
+ expect(plan.plan.slots.some(slot => slot.taskType === 'typing')).toBe(true);
+ });
+
+ it('recognizes typed source across supported stacks but ignores vendored and built artifacts', async () => {
+ for (const path of ['src/index.ts', 'src/lib.rs', 'main.go', 'src/App.java', 'src/App.kt', 'App.cs', 'main.cpp', 'main.c', 'main.scala', 'lib/main.dart', 'Program.fs']) {
+ expect((await resolveAuditApplicability(appWith([path]), 'typing')).applicable, path).toBe(true);
+ }
+ const app = appWith([...NODE_SERVICE, 'vendor/Library.swift', 'build/generated.ts', 'docs/Swift.md']);
+ expect(await resolveAuditApplicability(app, 'typing')).toEqual({ applicable: false, reason: 'no supported typed-language sources found in this repository' });
+ });
+
it('recognizes deployment configuration as infrastructure', async () => {
for (const file of ['infra/main.tf', 'Dockerfile', 'deploy/values.yaml', '.github/workflows/ci.yml', 'ecosystem.config.cjs', 'charts/api/Chart.yaml']) {
const { capabilities } = await detectRepoCapabilities(appWith(['package.json', file]));