faf-cli 6.10.1 → 6.11.0

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.
@@ -88,8 +88,11 @@ export interface BenchState {
88
88
  cold?: RunRecord;
89
89
  faf?: RunRecord;
90
90
  }
91
- /** ✪ receipt — sha256 over the canonical projection; third-party verifiable. */
92
- export declare function buildReceipt(state: BenchState): {
91
+ /** ✪ receipt — sha256 over the canonical projection; third-party verifiable.
92
+ * Includes `repo` so the receipt attests WHICH project was benched — two repos
93
+ * that score identically on the same qset get distinct receipts (bench-only;
94
+ * independent of the parity/trust score hash). */
95
+ export declare function buildReceipt(state: BenchState, repo?: string): {
93
96
  projection: string;
94
97
  hash: string;
95
98
  };
@@ -100,5 +103,7 @@ export interface BenchOptions {
100
103
  tokens?: string;
101
104
  model?: string;
102
105
  file?: string;
106
+ submit?: boolean;
107
+ endpoint?: string;
103
108
  }
104
109
  export declare function benchCommand(action?: string, answersFile?: string, options?: BenchOptions): void;
@@ -70,3 +70,41 @@ export declare function questionForSlot(path: string): string;
70
70
  * interviewed. `data` is the parsed .faf object.
71
71
  */
72
72
  export declare function interviewForMissing(data: Record<string, unknown>, isEmpty: (value: unknown) => boolean): InterviewQuestion[];
73
+ export interface GoalSeed {
74
+ what?: string;
75
+ where?: string;
76
+ who?: string;
77
+ }
78
+ /**
79
+ * Seed the human-context slots from the Goal sentence — verbatim facts only.
80
+ * Returns a partial { what?, where?, who? }; absent keys = "no fact, ask the
81
+ * human". Never returns why/when/how (not verbatim-extractable from a goal).
82
+ */
83
+ export declare function seedSixWsFromGoal(goal: string): GoalSeed;
84
+ export type BoxStatus = 'filled' | 'seeded' | 'empty';
85
+ export interface TableOf8Row {
86
+ n: number;
87
+ path: string;
88
+ header: string;
89
+ question: string;
90
+ value: string;
91
+ status: BoxStatus;
92
+ seeded: boolean;
93
+ }
94
+ export interface TableOf8 {
95
+ version: string;
96
+ rows: TableOf8Row[];
97
+ filledCount: number;
98
+ seededCount: number;
99
+ emptyCount: number;
100
+ complete: boolean;
101
+ }
102
+ /**
103
+ * Build the Table-of-8 from a .faf object (any/empty) + an optional goal. The
104
+ * goal seeds WHO/WHAT/WHERE via seedSixWsFromGoal (facts only); WHY/WHEN/HOW are
105
+ * never seeded. Rows the .faf already fills are 'filled'; goal-seeded ones are
106
+ * 'seeded' (suggestions); the rest are 'empty' (ask the human). Pure.
107
+ */
108
+ export declare function buildTableOf8(faf: Record<string, unknown>, opts?: {
109
+ goal?: string;
110
+ }): TableOf8;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Shared .faf assembly pipeline. The full slot-filling flow used to build a
3
+ * FRESH .faf for a directory:
4
+ * detect → interrogate → slotignore inactive categories → Turbo-Cat → Relentless
5
+ *
6
+ * Used by BOTH `faf auto` (new-file path) and `faf git` (cloned repo) so they
7
+ * can't drift — `faf git` previously ran detectStack alone (~33% vs ~75%).
8
+ */
9
+ /** Build a fresh .faf for `dir` using the full slot-filling pipeline. */
10
+ export declare function assembleFreshFaf(dir: string): Record<string, unknown>;
11
+ /** Fill empty/placeholder slots in `target` with values from `source`.
12
+ * `target` wins when its slot is non-empty. Empty here is per `isPlaceholder`
13
+ * (covers '', null, undefined, and known placeholder strings) — this is what
14
+ * lets interrogated/detected values overwrite the empty-string defaults that
15
+ * detectStack writes to human_context. */
16
+ export declare function fillEmpties(target: Record<string, unknown>, source: Record<string, unknown>): Record<string, unknown>;
@@ -0,0 +1,3 @@
1
+ import type { FrameworkSignature } from '../core/types.js';
2
+ /** Data-driven framework signatures — one scanner evaluates all */
3
+ export declare const FRAMEWORKS: FrameworkSignature[];
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Relentless — the 6-W human-context extractor. "Never gives up on finding
3
+ * context" (the v5 RelentlessContextExtractor), rewritten v6-native + sync and
4
+ * realigned to FAF's no-guess doctrine: it reads EVERY source (manifest +
5
+ * README, tiered) but FILLS ONLY from sourced evidence. The v5 INFERRED tiers
6
+ * (guess from project name / tech stack) are deliberately dropped —
7
+ * sourced-or-empty; `faf go` is where the human confirms.
8
+ *
9
+ * Pairs with Turbo-Cat: Turbo-Cat fills STACK slots from file formats;
10
+ * Relentless fills the 6 HUMAN-CONTEXT slots (who/what/why/where/when/how) by
11
+ * reading. WHO is the target AUDIENCE (not the package author — a v5 conflation
12
+ * this rewrite corrects).
13
+ */
14
+ export interface SeededContext {
15
+ who?: string;
16
+ what?: string;
17
+ why?: string;
18
+ where?: string;
19
+ when?: string;
20
+ how?: string;
21
+ }
22
+ export declare function relentlessContext(dir: string): SeededContext;
@@ -0,0 +1,70 @@
1
+ import type { DetectedFramework } from '../core/types.js';
2
+ interface PackageJson {
3
+ name?: string;
4
+ version?: string;
5
+ description?: string;
6
+ keywords?: string[];
7
+ dependencies?: Record<string, string>;
8
+ devDependencies?: Record<string, string>;
9
+ scripts?: Record<string, string>;
10
+ type?: string;
11
+ main?: string;
12
+ types?: string;
13
+ exports?: unknown;
14
+ bin?: string | Record<string, string>;
15
+ private?: boolean;
16
+ workspaces?: string[] | {
17
+ packages?: string[];
18
+ };
19
+ files?: string[];
20
+ }
21
+ /** Read and parse package.json from a directory */
22
+ export declare function readPackageJson(dir: string): PackageJson | null;
23
+ /** Detect frameworks in a directory */
24
+ export declare function detectFrameworks(dir: string): DetectedFramework[];
25
+ /** Detect the primary language of a project */
26
+ export declare function detectLanguage(dir: string): string;
27
+ /** Project-type detection result + rationale (the #found list).
28
+ * Each `found` entry is a human-readable signal that contributed to the
29
+ * classification — emitted as a YAML comment by `writeFaf` for transparency
30
+ * ("Glass Hood" doctrine: the user sees WHY the cli classified as it did). */
31
+ export interface ProjectTypeDetection {
32
+ type: string;
33
+ /** Signals that matched, in order observed. */
34
+ found: string[];
35
+ }
36
+ /** Detect the project type with rationale. The `found` list captures every
37
+ * positive signal that contributed to the classification — used downstream
38
+ * by `writeFaf` to render `# found: <list>` next to `type:` in the .faf.
39
+ *
40
+ * Priority order per v6.6.md doctrine (most-specific first). `about` is
41
+ * owner-declared, not auto-detected — never matches in this function.
42
+ * Rule: SDK keyword takes priority (sdk wins over library/cli/wasm). */
43
+ export declare function detectProjectTypeWithRationale(dir: string): ProjectTypeDetection;
44
+ /** Detect the project type for slot mapping. Backward-compatible wrapper —
45
+ * returns just the type string. New code should prefer
46
+ * `detectProjectTypeWithRationale` to access the `#found` rationale. */
47
+ export declare function detectProjectType(dir: string): string;
48
+ /** Detect the runtime */
49
+ export declare function detectRuntime(dir: string): string;
50
+ /** Detect package manager */
51
+ export declare function detectPackageManager(dir: string): string;
52
+ /** Detect CI/CD */
53
+ export declare function detectCicd(dir: string): string | null;
54
+ /** Detect hosting platform */
55
+ export declare function detectHosting(dir: string): string | null;
56
+ /** Detect SvelteKit adapter from svelte.config.js */
57
+ export declare function detectSvelteAdapter(dir: string): string | null;
58
+ /** Detect build tool */
59
+ export declare function detectBuildTool(dir: string): string | null;
60
+ /** Detect a list of important file paths for the KEY_FILES FAFB section.
61
+ * Returns up to ~10 entries, ordered by canonical importance. */
62
+ export declare function detectKeyFiles(dir: string): string[];
63
+ /** Detect build/test/lint commands for the COMMANDS FAFB section.
64
+ * Returns a Record<string, string> mapping command name → shell command. */
65
+ export declare function detectCommands(dir: string, pkg: PackageJson | null): Record<string, string>;
66
+ /** Detect a tech-stack list for the TECH_STACK FAFB section.
67
+ * Combines language + frameworks + runtime into a flat list of strings
68
+ * (matching the canonical xai-faf-rust project.faf shape). */
69
+ export declare function detectTechStack(dir: string, pkg: PackageJson | null, frameworks: DetectedFramework[], language: string): string[];
70
+ export {};
@@ -0,0 +1,3 @@
1
+ import type { FafData } from '../core/types.js';
2
+ /** Auto-detect project stack and generate .faf data */
3
+ export declare function detectStack(dir: string): FafData;
package/dist/index.d.ts CHANGED
@@ -6,10 +6,13 @@ export { enrichScore, scoreFafYaml } from './core/scorer.js';
6
6
  export { validateFaf } from './core/schema.js';
7
7
  export { findFafFile, readFaf, readFafRaw } from './interop/faf.js';
8
8
  export { generateProjectHtml, writeProjectHtml } from './interop/projecthtml.js';
9
- export type { InterviewQuestion, InterviewOption } from './core/interview.js';
10
- export { INTERVIEW, SIX_WS_INTERVIEW, STACK_INTERVIEW, INTERVIEW_BY_PATH, INTERVIEW_PATHS, INTERVIEW_VERSION, questionForSlot, interviewForMissing, } from './core/interview.js';
9
+ export type { InterviewQuestion, InterviewOption, GoalSeed, TableOf8, TableOf8Row, BoxStatus } from './core/interview.js';
10
+ export { INTERVIEW, SIX_WS_INTERVIEW, STACK_INTERVIEW, INTERVIEW_BY_PATH, INTERVIEW_PATHS, INTERVIEW_VERSION, questionForSlot, interviewForMissing, seedSixWsFromGoal, buildTableOf8, } from './core/interview.js';
11
11
  export { BENCH_VERSION, deriveQuestionSet, publicQuestions, gradeAnswers, buildReceipt, normalizeAnswer, answersMatch, ALIAS_GROUPS, } from './commands/bench.js';
12
12
  export type { BenchQuestion, QuestionSet, GradeResult, BenchState, RunRecord } from './commands/bench.js';
13
13
  export { turboCatScan, turboCatSlots } from './detect/turbo-cat.js';
14
14
  export type { TurboCatResult, DiscoveredFormat } from './detect/turbo-cat.js';
15
+ export { relentlessContext } from './detect/relentless.js';
16
+ export type { SeededContext } from './detect/relentless.js';
17
+ export { assembleFreshFaf } from './detect/assemble.js';
15
18
  export * as kernel from './wasm/kernel.js';