freshcontext-mcp 0.3.18 → 0.3.19

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
@@ -6,7 +6,7 @@ Claude had no idea. It presented everything with the same confidence.
6
6
 
7
7
  That's the problem freshcontext fixes.
8
8
 
9
- This repository is the integrated FreshContext MCP/Core package. Core is the context-integrity layer that scores, ranks, explains, and wraps retrieved context before it reaches an LLM or agent; MCP is the primary reference/interface implementation.
9
+ This repository is the integrated FreshContext Core/MCP package. FreshContext is the context judgment layer between retrieval and reasoning. Core is the reusable engine that scores, ranks, explains, and turns candidate context into decision-ready context; MCP is the first live host/interface over that engine.
10
10
 
11
11
  [![npm version](https://img.shields.io/npm/v/freshcontext-mcp)](https://www.npmjs.com/package/freshcontext-mcp)
12
12
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
@@ -30,7 +30,16 @@ That's not hallucination. That's correct summarization of corrupted retrieval.
30
30
 
31
31
  ## The layer
32
32
 
33
- FreshContext is a **temporal correction layer for retrieval systems**. One math correction applied before context reaches the LLM:
33
+ FreshContext is **context integrity infrastructure for AI agents and retrieval systems**. It sits between retrieval and reasoning:
34
+
35
+ ```text
36
+ candidate context
37
+ -> FreshContext Core
38
+ -> decision-ready context
39
+ -> model / agent / app
40
+ ```
41
+
42
+ FreshContext evaluates freshness, source profile, confidence, utility, provenance material, and failure honesty before context reaches the LLM. The temporal core uses Decay-Adjusted Relevancy:
34
43
 
35
44
  ```
36
45
  R_t = R_0 · e^(−λt)
@@ -41,9 +50,9 @@ R_t = R_0 · e^(−λt)
41
50
  - `t` — hours elapsed since publication
42
51
  - `R_t` — decay-adjusted relevancy at query time
43
52
 
44
- That's the whole fix. No model swap. No re-embedding. No re-indexing. The layer drops onto whatever retrieval pipeline you already have.
53
+ That's the core correction. No model swap. No re-embedding. No re-indexing. The layer drops onto whatever retrieval pipeline you already have.
45
54
 
46
- **The layer is the product.** The 21 tools shipped with this repo are reference adapters demonstrating compatibility useful, but commodity. The DAR engine, the freshness envelope, and the FreshContext Specification are the moat.
55
+ **The layer is the product.** The named adapters shipped with this repo demonstrate compatibility across different source classes. The DAR engine, the freshness envelope, Source Profiles, and the FreshContext Specification are the moat.
47
56
 
48
57
  ---
49
58
 
@@ -70,17 +79,62 @@ The FreshContext Specification v1.2 is published as an open standard under MIT l
70
79
 
71
80
  ## Architecture boundary
72
81
 
73
- FreshContext Core is the reusable center of the current integrated package. It owns freshness scoring, envelope formatting, failure guards, shared types, rank/explain primitives, and the context-conditioned utility primitive.
82
+ FreshContext Core is the reusable center of the current integrated package. It owns signal normalization, freshness scoring, Source Profiles, decision output, envelope formatting, failure guards, shared types, rank/explain primitives, and the context-conditioned utility primitive.
74
83
 
75
- MCP is the primary reference/interface implementation over Core. Claude Desktop is supported, but not required. The 21 MCP tools in this repo are reference adapters and a live interface for using the system.
84
+ MCP is the primary reference/interface implementation over Core. Claude Desktop is supported, but not required. The MCP tool surface exposes named reference adapters and a live interface for using the system.
76
85
 
77
86
  The production Cloudflare Worker now uses Core-backed envelope generation. Worker-specific concerns remain outside Core: MCP transport, runtime guards, KV cache policy, cache metadata injection, JSON parse/replace cache helpers, D1 feeds, cron, rate limiting, and Store/feed scoring/provenance.
78
87
 
88
+ See [Core / MCP Boundary](./docs/CORE_MCP_BOUNDARY.md) for the current package boundary and the staged path toward a future standalone Core package.
89
+
79
90
  ---
80
91
 
81
- ## The intelligence feed
92
+ ## Primary MCP interface
82
93
 
83
- Beyond the per-call envelope, the production FreshContext deployment exposes a continuous, decay-scored, deduplicated feed:
94
+ The clearest MCP path is `evaluate_context`.
95
+
96
+ It accepts candidate context from any retriever, agent, database, local script, note parser, or adapter output:
97
+
98
+ ```json
99
+ {
100
+ "profile": "academic_research",
101
+ "intent": "citation_check",
102
+ "signals": [
103
+ {
104
+ "title": "Example source",
105
+ "content": "Candidate context text...",
106
+ "source": "https://example.com/source",
107
+ "source_type": "arxiv",
108
+ "published_at": "2026-05-24T12:00:00.000Z",
109
+ "retrieved_at": "2026-05-24T13:00:00.000Z",
110
+ "semantic_score": 0.92
111
+ }
112
+ ]
113
+ }
114
+ ```
115
+
116
+ FreshContext returns decision-first output:
117
+
118
+ - Decision
119
+ - Meaning
120
+ - Action
121
+ - Warnings
122
+ - Source
123
+ - Freshness
124
+ - Rank score
125
+ - Utility
126
+ - Confidence
127
+ - Why
128
+
129
+ `evaluate_context` does not fetch URLs, crawl, scrape, browse, read folders, or call adapters. It only evaluates candidate context the caller provides.
130
+
131
+ Current boundary: `evaluate_context` is part of the published npm/local stdio MCP server. The hosted Cloudflare Worker endpoint is a separate deployment surface and may lag npm package interfaces until a dedicated Worker sync pass.
132
+
133
+ ---
134
+
135
+ ## Advanced Worker/feed surface
136
+
137
+ Beyond the per-call Core/MCP paths, the production Worker deployment exposes a continuous, decay-scored, deduplicated feed. This is an advanced deployment surface, not the required way to use FreshContext Core:
84
138
 
85
139
  ```
86
140
  GET /v1/intel/feed/:profile_id?limit=20&min_rt=0
@@ -94,7 +148,7 @@ Production endpoint: `https://freshcontext-mcp.gimmanuel73.workers.dev`
94
148
 
95
149
  ## Reference adapters
96
150
 
97
- The repo ships 21 tools demonstrating how to make any data source FreshContext-compatible. Useful as drop-in tools, but the value is the layer above them.
151
+ The repo ships named reference adapters that demonstrate how different source classes can become FreshContext-compatible. Each adapter keeps its own name because it represents a source boundary; the adapter count is operational proof, not the product headline.
98
152
 
99
153
  ### Intelligence
100
154
  | Adapter | What it returns |
@@ -128,7 +182,7 @@ The repo ships 21 tools demonstrating how to make any data source FreshContext-c
128
182
  | `extract_finance_landscape` | 5 | Finance + HN + Reddit + GitHub + changelog |
129
183
  | `extract_company_landscape` | 5 | The full picture on any company |
130
184
 
131
- ### Unique not available in any other MCP server
185
+ ### Official, regulatory, and procurement sources
132
186
  | Adapter | Source | What it returns |
133
187
  |---|---|---|
134
188
  | `extract_changelog` | GitHub Releases / npm / auto-discover | Update history from any repo, package, or website |
@@ -290,6 +344,14 @@ Minimal shape:
290
344
 
291
345
  This local demo does not fetch URLs, crawl, or read folders. It evaluates candidate context you provide and returns decision-first output: Decision, Meaning, Action, Warnings, and supporting metrics.
292
346
 
347
+ In an MCP client, use `evaluate_context` when you already have candidate context from another retriever, database, agent, or script:
348
+
349
+ ```text
350
+ Use evaluate_context with profile "academic_research", intent "citation_check", and these candidate signals: [...]
351
+ ```
352
+
353
+ Use the named reference adapters when you want FreshContext's current MCP package to fetch public source examples for you.
354
+
293
355
  **Should I build this idea?**
294
356
  ```
295
357
  Use extract_idea_landscape with idea "procurement intelligence saas"
@@ -343,26 +405,29 @@ Production: `https://freshcontext-mcp.gimmanuel73.workers.dev`
343
405
  ## Roadmap
344
406
 
345
407
  - [x] FreshContext Specification v1.2 published (MIT, open standard)
346
- - [x] DAR engine with proprietary λ constants (v0.3.18)
408
+ - [x] DAR engine with proprietary λ constants (v0.3.19)
347
409
  - [x] Ha-Pri v1 provenance signatures on stored signals
348
410
  - [x] Semantic deduplication via fingerprinting
349
411
  - [x] Live before/after demo at `/demo`
350
412
  - [x] METHODOLOGY.md — formal IP and engineering documentation
351
- - [x] 21 reference tools across intelligence, competitive research, market data, and composites
413
+ - [x] Named reference adapters across intelligence, competitive research, market data, and composites
414
+ - [x] Generic MCP `evaluate_context` tool for caller-provided candidate context
352
415
  - [x] Core-backed envelope generation shared by npm/MCP and the Cloudflare Worker
353
416
  - [x] Cloudflare Workers deployment — global edge, KV cache, KV rate limiting
354
- - [x] Listed on official MCP Registry, Apify Store, npm
417
+ - [x] Published on npm and listed for MCP usage; Apify/feed assets are separated from the normal MCP runtime package
355
418
  - [ ] Ha-Pri v2 hardened canonical content hash verification
356
419
  - [x] GitHub Actions release workflow — manual or `v*` tag-triggered npm publish path
357
420
  - [ ] Webhook triggers — push high-entropy signals on threshold
358
421
  - [ ] Dashboard — React frontend for the D1 intelligence pipeline
359
422
  - [ ] GKG upgrade for `extract_gdelt` — tone scores, goldstein scale, event codes
360
423
 
424
+ Future work is organized in [FreshContext Future Lanes](./docs/FUTURE_LANES.md). Roadmap items are not live product claims until implemented and validated.
425
+
361
426
  ---
362
427
 
363
428
  ## Contributing
364
429
 
365
- PRs welcome. New adapters are the highest-value contribution — see `src/adapters/` for the pattern and [`FRESHCONTEXT_SPEC.md`](./FRESHCONTEXT_SPEC.md) for the contract any adapter must fulfil.
430
+ PRs welcome. The highest-value contributions improve the caller-provided context path, decision output, host integrations, and FreshContext-compatible signal quality. New reference adapters are useful when they preserve source boundaries and emit timestamped, failure-honest context — see `src/adapters/` for examples and [`FRESHCONTEXT_SPEC.md`](./FRESHCONTEXT_SPEC.md) for the compatibility contract.
366
431
 
367
432
  If you're building something FreshContext-compatible, open an issue and we'll add you to the ecosystem list.
368
433
 
@@ -377,7 +442,6 @@ If you're building something FreshContext-compatible, open an issue and we'll ad
377
442
  - [Dependency diligence notes](./docs/DEPENDENCY_DILIGENCE.md)
378
443
  - [Release integrity notes](./docs/RELEASE_INTEGRITY.md)
379
444
  - [Release notes](./docs/RELEASE_NOTES.md)
380
- - [Operational demo runbook](./docs/OPERATIONAL_DEMO_RUNBOOK.md)
381
445
 
382
446
  ---
383
447
 
@@ -392,4 +456,4 @@ MIT
392
456
 
393
457
  ---
394
458
 
395
- **Also on:** [Apify Store](https://apify.com/prince_gabriel/freshcontext-mcp) · [MCP Registry](https://registry.modelcontextprotocol.io) · [npm](https://www.npmjs.com/package/freshcontext-mcp)
459
+ **Also on:** [MCP Registry](https://registry.modelcontextprotocol.io) · [npm](https://www.npmjs.com/package/freshcontext-mcp)
package/dist/server.js CHANGED
@@ -19,12 +19,50 @@ import { secFilingsAdapter } from "./adapters/secFilings.js";
19
19
  import { gdeltAdapter } from "./adapters/gdelt.js";
20
20
  import { gebizAdapter } from "./adapters/gebiz.js";
21
21
  import { stampFreshness, formatForLLM } from "./tools/freshnessStamp.js";
22
+ import { EvaluateContextInputError, evaluateContextInput, formatEvaluateContextResult, } from "./tools/evaluateContext.js";
22
23
  import { formatSecurityError } from "./security.js";
23
24
  const server = new McpServer({
24
25
  name: "freshcontext-mcp",
25
- version: "0.3.18",
26
+ version: "0.3.19",
26
27
  });
27
- // ─── Tool: extract_github ────────────────────────────────────────────────────
28
+ const signalInputSchema = z.object({
29
+ id: z.string().optional(),
30
+ source: z.string().min(1).describe("Source URL, URI, document id, or stable source label."),
31
+ source_type: z.string().optional().describe("Source type such as arxiv, jobs, official_docs, custom, or user_provided."),
32
+ title: z.string().optional(),
33
+ content: z.string().optional(),
34
+ published_at: z.string().nullable().optional(),
35
+ content_date: z.string().nullable().optional(),
36
+ retrieved_at: z.string().nullable().optional(),
37
+ semantic_score: z.number().optional().describe("Optional relevance score from 0..1. Core clamps out-of-range values."),
38
+ date_confidence: z.enum(["high", "medium", "low", "unknown"]).optional(),
39
+ freshness_confidence: z.enum(["high", "medium", "low"]).optional(),
40
+ status: z.enum(["success", "partial", "stale", "failed", "unknown"]).optional(),
41
+ metadata: z.record(z.unknown()).optional(),
42
+ }).passthrough();
43
+ // Tool: evaluate_context
44
+ server.registerTool("evaluate_context", {
45
+ description: "Evaluate caller-provided candidate context and return decision-ready output. This is the primary FreshContext judgment path: it does not fetch, crawl, scrape, browse, read folders, or call adapters.",
46
+ inputSchema: z.object({
47
+ profile: z.string().min(1).describe("Source Profile id, e.g. academic_research, jobs_opportunities, market_finance, official_docs, local_custom."),
48
+ intent: z.string().min(1).describe("Intent Profile id, e.g. citation_check, student_research, developer_adoption, job_search, market_watch, business_due_diligence, medical_literature_triage."),
49
+ signals: z.array(signalInputSchema).min(1).describe("Candidate context items provided by the caller. FreshContext evaluates these; it does not retrieve them."),
50
+ now: z.string().optional().describe("Optional ISO timestamp for deterministic evaluation."),
51
+ }),
52
+ annotations: { readOnlyHint: true, openWorldHint: false },
53
+ }, async ({ profile, intent, signals, now }) => {
54
+ try {
55
+ const result = evaluateContextInput({ profile, intent, signals, now });
56
+ return { content: [{ type: "text", text: formatEvaluateContextResult(result) }] };
57
+ }
58
+ catch (err) {
59
+ if (err instanceof EvaluateContextInputError) {
60
+ return { content: [{ type: "text", text: `[FreshContext evaluate_context error]\n${err.message}` }] };
61
+ }
62
+ return { content: [{ type: "text", text: formatSecurityError(err) }] };
63
+ }
64
+ });
65
+ // ─── Reference adapter: extract_github ───────────────────────────────────────
28
66
  server.registerTool("extract_github", {
29
67
  description: "Extract real-time data from a GitHub repository — README, stars, forks, language, topics, last commit. Returns timestamped freshcontext.",
30
68
  inputSchema: z.object({
@@ -0,0 +1,127 @@
1
+ import { evaluateSignals, getSourceProfile, interpretEvaluations, } from "../core/index.js";
2
+ const SUPPORTED_INTENTS = [
3
+ "citation_check",
4
+ "student_research",
5
+ "developer_adoption",
6
+ "job_search",
7
+ "market_watch",
8
+ "business_due_diligence",
9
+ "medical_literature_triage",
10
+ ];
11
+ export class EvaluateContextInputError extends Error {
12
+ constructor(message) {
13
+ super(message);
14
+ this.name = "EvaluateContextInputError";
15
+ }
16
+ }
17
+ function isRecord(value) {
18
+ return typeof value === "object" && value !== null && !Array.isArray(value);
19
+ }
20
+ function isIntentProfileId(value) {
21
+ return SUPPORTED_INTENTS.includes(value);
22
+ }
23
+ function validateSignal(value, index) {
24
+ if (!isRecord(value)) {
25
+ throw new EvaluateContextInputError(`signals[${index}] must be an object.`);
26
+ }
27
+ if (typeof value.source !== "string" || value.source.trim().length === 0) {
28
+ throw new EvaluateContextInputError(`signals[${index}].source must be a non-empty string.`);
29
+ }
30
+ if ((typeof value.title !== "string" || value.title.trim().length === 0)
31
+ && (typeof value.content !== "string" || value.content.trim().length === 0)) {
32
+ throw new EvaluateContextInputError(`signals[${index}] must include title or content.`);
33
+ }
34
+ return {
35
+ ...value,
36
+ source: value.source,
37
+ title: typeof value.title === "string" ? value.title : undefined,
38
+ content: typeof value.content === "string" ? value.content : undefined,
39
+ };
40
+ }
41
+ export function evaluateContextInput(input) {
42
+ const profile = getSourceProfile(input.profile);
43
+ if (!profile) {
44
+ throw new EvaluateContextInputError(`Unknown source profile: ${input.profile}.`);
45
+ }
46
+ if (!isIntentProfileId(input.intent)) {
47
+ throw new EvaluateContextInputError(`Unsupported intent profile: ${input.intent}.`);
48
+ }
49
+ if (!Array.isArray(input.signals)) {
50
+ throw new EvaluateContextInputError("signals must be an array.");
51
+ }
52
+ if (input.signals.length === 0) {
53
+ throw new EvaluateContextInputError("signals must contain at least one candidate context item.");
54
+ }
55
+ const signals = input.signals.map(validateSignal);
56
+ const options = input.now ? { now: input.now } : {};
57
+ const evaluations = evaluateSignals(signals, options);
58
+ const decisions = interpretEvaluations(evaluations, {
59
+ sourceProfile: profile,
60
+ intentProfile: input.intent,
61
+ });
62
+ return {
63
+ profile,
64
+ intent: input.intent,
65
+ items: evaluations.map((evaluation, index) => ({
66
+ evaluation,
67
+ decision: decisions[index],
68
+ })),
69
+ };
70
+ }
71
+ function sourceTitle(evaluation) {
72
+ if (evaluation.signal.title)
73
+ return evaluation.signal.title;
74
+ if (evaluation.signal.content)
75
+ return evaluation.signal.content.slice(0, 80);
76
+ return evaluation.signal.source;
77
+ }
78
+ function formatFreshness(score) {
79
+ return score === null ? "unknown" : `${Math.round(score)}/100`;
80
+ }
81
+ function formatRank(score) {
82
+ return score.toFixed(3);
83
+ }
84
+ function formatUtility(score) {
85
+ return `${Number(score.toFixed(1))}/100`;
86
+ }
87
+ function formatList(values) {
88
+ return values.length > 0 ? values.join("; ") : "None";
89
+ }
90
+ export function formatEvaluateContextResult(result) {
91
+ const lines = [
92
+ "FreshContext evaluate_context",
93
+ "Candidate context -> Core evaluation -> decision-ready context",
94
+ "",
95
+ `Profile: ${result.profile.profile_id}`,
96
+ `Purpose: ${result.profile.purpose}`,
97
+ `Intent: ${result.intent}`,
98
+ "",
99
+ ];
100
+ result.items.forEach((item, index) => {
101
+ const { evaluation, decision } = item;
102
+ lines.push(`${index + 1}. ${sourceTitle(evaluation)}`, ` Decision: ${decision.label}`, ` Meaning: ${decision.meaning}`, ` Action: ${decision.action}`, ` Warnings: ${formatList(decision.warnings)}`, ` Source: ${evaluation.signal.source}`, ` Freshness: ${formatFreshness(evaluation.freshness_score)}`, ` Rank score: ${formatRank(evaluation.ranked.final_score)}`, ` Utility: ${formatUtility(evaluation.utility.score)}`, ` Confidence: ${evaluation.ranked.confidence}`, ` Why: ${evaluation.explanation}`, "");
103
+ });
104
+ const structured = {
105
+ profile: result.profile.profile_id,
106
+ intent: result.intent,
107
+ results: result.items.map((item, index) => ({
108
+ index: index + 1,
109
+ title: sourceTitle(item.evaluation),
110
+ source: item.evaluation.signal.source,
111
+ source_type: item.evaluation.signal.source_type,
112
+ decision: item.decision.decision,
113
+ label: item.decision.label,
114
+ meaning: item.decision.meaning,
115
+ action: item.decision.action,
116
+ warnings: item.decision.warnings,
117
+ reasons: item.decision.reasons,
118
+ freshness_score: item.evaluation.freshness_score,
119
+ rank_score: item.evaluation.ranked.final_score,
120
+ utility_score: item.evaluation.utility.score,
121
+ confidence: item.evaluation.ranked.confidence,
122
+ why: item.evaluation.explanation,
123
+ })),
124
+ };
125
+ lines.push("[FRESHCONTEXT_EVALUATION_JSON]", JSON.stringify(structured, null, 2), "[/FRESHCONTEXT_EVALUATION_JSON]");
126
+ return lines.join("\n");
127
+ }
@@ -12,7 +12,7 @@ The verified local server entrypoint is:
12
12
  & '<node-executable>' '<repo-root>\dist\server.js'
13
13
  ```
14
14
 
15
- The MCP server exposes 21 tools. The local smoke test verifies the package version, server version, expected tool count, and representative tool calls.
15
+ The MCP server exposes 22 tools: the front-door `evaluate_context` tool plus 21 read-only reference adapters. The local smoke test verifies the package version, server version, expected tool count, the generic context-evaluation path, and representative adapter calls.
16
16
 
17
17
  No credential is required for the local stdio smoke path.
18
18
 
@@ -83,9 +83,9 @@ Expected result:
83
83
  ```json
84
84
  {
85
85
  "ok": true,
86
- "package_version": "0.3.18",
87
- "server_version": "0.3.18",
88
- "tool_count": 21
86
+ "package_version": "0.3.19",
87
+ "server_version": "0.3.19",
88
+ "tool_count": 22
89
89
  }
90
90
  ```
91
91
 
@@ -112,5 +112,5 @@ If Codex cannot start the server:
112
112
  - Confirm `dist/server.js` exists. If not, run `npm run build`.
113
113
  - Confirm Node is installed with `node -v`. The package requires Node.js 20 or newer.
114
114
  - If `node` is not found by Codex, use the full executable path from `node -p "process.execPath"`.
115
- - Run `npm run smoke:stdio` from the repository root and confirm `tool_count` is 21.
115
+ - Run `npm run smoke:stdio` from the repository root and confirm `tool_count` is 22.
116
116
  - If the remote setup fails, verify network access, `npx` availability, and the remote endpoint separately. Do not treat remote failure as evidence that local stdio is broken.
package/docs/CORE_API.md CHANGED
@@ -1,9 +1,11 @@
1
1
  # FreshContext Core API
2
2
 
3
- FreshContext Core is the reusable engine layer in the current integrated MCP/Core package. It owns signal normalization, envelope creation, freshness scoring, failure honesty, rank/explain primitives, the context-utility primitive, and pure provenance helpers.
3
+ FreshContext Core is the reusable engine layer in the current integrated Core/MCP package. It owns signal normalization, envelope creation, freshness scoring, failure honesty, Source Profiles, decision output, rank/explain primitives, the context-utility primitive, and pure provenance helpers.
4
4
 
5
5
  MCP, Worker HTTP, future REST, and future CLI/SDK surfaces should use Core as the contract center instead of redefining freshness or envelope behavior per host.
6
6
 
7
+ For the package-level boundary between Core, MCP, adapters, and deployment surfaces, see [Core / MCP Boundary](./CORE_MCP_BOUNDARY.md).
8
+
7
9
  ## Stable Public Core API
8
10
 
9
11
  Import stable Core functions from:
@@ -108,7 +110,7 @@ Public exports:
108
110
  - `SourceFailurePolicy`
109
111
  - `SourceSurface`
110
112
 
111
- They reframe the 21 MCP tools as reference adapters and source-profile examples instead of the product identity. They do not implement `retrieve(...)`, Operator mode, adapter selection, crawling, local file search, or any host/runtime behavior.
113
+ They reframe the 21 named adapter tools as reference adapters and source-profile examples instead of the product identity. The MCP server also exposes `evaluate_context` as the generic caller-provided context evaluation path. Source Profiles do not implement `retrieve(...)`, Operator mode, adapter selection, crawling, local file search, or any host/runtime behavior.
112
114
 
113
115
  ## Decision Helper
114
116
 
@@ -0,0 +1,106 @@
1
+ # FreshContext Core / MCP Boundary
2
+
3
+ FreshContext is the context judgment layer between retrieval and reasoning.
4
+
5
+ The current npm package is intentionally named `freshcontext-mcp` because MCP is the first live interface. That does not make MCP the whole product. MCP is a host layer over the FreshContext Core engine.
6
+
7
+ ## Product Shape
8
+
9
+ ```text
10
+ Candidate context
11
+ -> FreshContext Core
12
+ -> decision-ready context
13
+ -> MCP / Worker / future REST / future SDK / future CLI
14
+ ```
15
+
16
+ FreshContext Core owns the judgment contract:
17
+
18
+ - signal normalization
19
+ - freshness scoring
20
+ - source profiles
21
+ - context utility sidecar scoring
22
+ - rank and explanation primitives
23
+ - decision helper output
24
+ - envelope and provenance helpers
25
+
26
+ MCP owns the live reference interface:
27
+
28
+ - tool registration
29
+ - MCP input schemas
30
+ - stdio transport
31
+ - client-facing tool descriptions
32
+ - formatting Core/adapter output for MCP clients
33
+
34
+ Adapters own source intake:
35
+
36
+ - source-specific fetching
37
+ - source-specific parsing
38
+ - timestamp extraction
39
+ - source-specific normalization
40
+ - failure normalization before Core evaluation
41
+
42
+ Worker/site surfaces own deployment concerns:
43
+
44
+ - Cloudflare runtime behavior
45
+ - KV/D1/cache/feed concerns
46
+ - hosted demo/site presentation
47
+ - runtime guards and deployment configuration
48
+
49
+ ## Current Live Boundary
50
+
51
+ Live today:
52
+
53
+ - npm package: `freshcontext-mcp@0.3.19`
54
+ - MCP stdio server and published binary: `freshcontext-mcp`
55
+ - `evaluate_context` MCP tool for caller-provided candidate context
56
+ - 21 named read-only reference adapters
57
+ - Core signal evaluation
58
+ - Source Profiles
59
+ - Decision Helper
60
+ - adapter registry metadata
61
+ - arXiv signal-to-decision proof
62
+ - bring-your-own-context local demos
63
+ - Trust Scanner release gate
64
+
65
+ Not live today:
66
+
67
+ - standalone Core npm package
68
+ - package rename to `freshcontext`
69
+ - Operator / `retrieve(...)`
70
+ - automatic browser crawling
71
+ - automatic local folder/PDF scanning
72
+ - hosted enterprise dashboard or billing
73
+ - hard Ha-Pri v2 production enforcement
74
+ - full adapter ingestion into pure signal paths
75
+
76
+ ## Future Package Split
77
+
78
+ The safe split path is staged:
79
+
80
+ 1. Keep `freshcontext-mcp` stable for current users.
81
+ 2. Maintain Core as a pure internal export surface.
82
+ 3. Audit Core dependencies, Node/browser compatibility, and API stability.
83
+ 4. Publish a standalone Core package only after compatibility tests exist.
84
+ 5. Make `freshcontext-mcp` depend on the standalone Core package.
85
+ 6. Consider a repo rename to `freshcontext` only after package/client links are stable.
86
+
87
+ The expected future shape is:
88
+
89
+ ```text
90
+ freshcontext
91
+ packages/core reusable judgment engine
92
+ packages/adapters reference source intake assets
93
+ packages/mcp MCP host layer
94
+ packages/cli future local evaluator
95
+ docs
96
+ ```
97
+
98
+ ## Compatibility Rule
99
+
100
+ Do not remove the current compatibility lanes until a dedicated migration pass exists:
101
+
102
+ - `src/types.ts` re-exports legacy adapter types from Core.
103
+ - `src/tools/freshnessStamp.ts` re-exports envelope helpers for older MCP/npm import paths.
104
+ - `dist/server.js` remains the package `main` and MCP binary target.
105
+
106
+ The architecture direction is clear, but the public runtime should stay boring and stable.
@@ -0,0 +1,173 @@
1
+ # FreshContext Future Lanes
2
+
3
+ This document keeps future FreshContext work organized without turning roadmap ideas into public claims.
4
+
5
+ FreshContext is live today as an integrated MCP/Core package. Future work should stay in lanes, start with audits, and avoid feature sprawl.
6
+
7
+ The current package boundary is documented in [Core / MCP Boundary](./CORE_MCP_BOUNDARY.md). Treat MCP as the first live host over FreshContext Core, not as the whole product identity.
8
+
9
+ ## Current Live Boundary
10
+
11
+ Live today:
12
+
13
+ - npm package: `freshcontext-mcp@0.3.19`
14
+ - MCP stdio server
15
+ - `evaluate_context` MCP tool for caller-provided candidate context
16
+ - 21 read-only reference adapters
17
+ - Core signal evaluation
18
+ - Source Profiles
19
+ - Decision Helper
20
+ - adapter registry metadata
21
+ - arXiv signal-to-decision proof
22
+ - bring-your-own-context local demos
23
+ - Trust Scanner release gate
24
+
25
+ Not live today:
26
+
27
+ - Operator / `retrieve(...)`
28
+ - browser crawling
29
+ - automatic local file, folder, or PDF scanning
30
+ - hosted dashboard or billing
31
+ - hard Ha-Pri v2 production enforcement
32
+ - standalone Core SDK package
33
+ - full adapter ingestion
34
+
35
+ ## Lane 1: Client Setup Reliability
36
+
37
+ Goal:
38
+
39
+ ```text
40
+ Make Claude, Codex, and MCP-compatible clients connect reliably to the published package.
41
+ ```
42
+
43
+ Start with setup guide audits, Claude Desktop local/global package paths, Codex local MCP config paths, stale global package fixes, and smoke command expectations.
44
+
45
+ Do not claim ChatGPT/OpenAI connector compatibility until a separate compatibility audit is done.
46
+
47
+ ## Lane 2: Generic Context Evaluation
48
+
49
+ Goal:
50
+
51
+ ```text
52
+ Let any caller provide candidate context and get decision-ready output.
53
+ ```
54
+
55
+ Current live MCP path:
56
+
57
+ ```text
58
+ evaluate_context
59
+ ```
60
+
61
+ Hard boundary:
62
+
63
+ ```text
64
+ No fetching, crawling, browsing, folder reading, or retrieval orchestration.
65
+ Only evaluate caller-provided candidate context.
66
+ ```
67
+
68
+ Next work in this lane should focus on CLI, SDK, and REST ergonomics over the same caller-provided signal shape.
69
+
70
+ ## Lane 3: Multi-Agent Context Handoff Proof
71
+
72
+ Goal:
73
+
74
+ ```text
75
+ Show FreshContext as an independent context judgment layer between agents.
76
+ ```
77
+
78
+ Proof shape:
79
+
80
+ ```text
81
+ agent A produces candidate context
82
+ -> FreshContext evaluates it
83
+ -> agent B receives decision-ready context
84
+ ```
85
+
86
+ Do not build a full multi-agent framework. Prove the handoff boundary.
87
+
88
+ ## Lane 4: Core SDK Extraction Audit
89
+
90
+ Goal:
91
+
92
+ ```text
93
+ Decide whether Core should become a standalone package.
94
+ ```
95
+
96
+ Audit current Core exports, dependency boundaries, package shape, browser/node compatibility, public API stability, and what remains MCP-only.
97
+
98
+ No extraction without a compatibility plan. Keep `freshcontext-mcp` stable until a standalone Core package has compatibility tests and a migration path.
99
+
100
+ ## Lane 5: Local/User Data Intake Audit
101
+
102
+ Goal:
103
+
104
+ ```text
105
+ Explore student, research, and local-PC workflows safely.
106
+ ```
107
+
108
+ Candidate sources include notes, PDFs, local JSON/CSV, citation exports, and database rows.
109
+
110
+ Hard boundary:
111
+
112
+ ```text
113
+ Consent-first design. No automatic folder scanning or background file reading.
114
+ ```
115
+
116
+ ## Lane 6: Decision Layer Upgrade
117
+
118
+ Goal:
119
+
120
+ ```text
121
+ Make decisions more useful without silently changing ranking.
122
+ ```
123
+
124
+ Possible inputs include context utility, control signal, future context signal, confidence tiers, and source-profile-specific thresholds.
125
+
126
+ Do not make `utility.score` affect ranking by default without a dedicated ranking policy pass.
127
+
128
+ ## Lane 7: Ha-Pri v2 Production Path
129
+
130
+ Goal:
131
+
132
+ ```text
133
+ Turn Ha-Pri v2 from pure Core helper/design into production enforcement where appropriate.
134
+ ```
135
+
136
+ Audit canonical content material, storage path, verification timing, failure mode, D1/Worker compatibility, and migration plan.
137
+
138
+ Do not claim hard tamper enforcement until the read/write path exists.
139
+
140
+ ## Lane 8: GDELT GKG / Richer Source Intelligence
141
+
142
+ Goal:
143
+
144
+ ```text
145
+ Upgrade GDELT intelligence with richer global knowledge graph signals.
146
+ ```
147
+
148
+ Possible fields include tone, Goldstein scale, event codes, actor geography, theme density, and source timeline.
149
+
150
+ Do not mix this with generic context evaluation or local intake.
151
+
152
+ ## Lane 9: Operator / Retrieve Orchestration
153
+
154
+ Goal:
155
+
156
+ ```text
157
+ Coordinate retrieval only after the decision layer and adapter boundaries are mature.
158
+ ```
159
+
160
+ Operator may later select adapters, call retrievers, refresh stale sources, and package best context.
161
+
162
+ Not now. Operator is a later workflow layer over Core and adapters.
163
+
164
+ ## Operating Rule
165
+
166
+ Every lane starts with:
167
+
168
+ ```text
169
+ audit -> small patch -> validation -> stop
170
+ ```
171
+
172
+ Do not combine lanes because the architecture is tempting.
173
+
@@ -22,6 +22,7 @@ This document describes release hardening practices for future FreshContext pack
22
22
  - Confirm fresh consumer `npm audit --omit=dev` is clean.
23
23
  - Run a stale-claim scan across public docs and package-facing files.
24
24
  - Run a secret scan before sharing archives, diligence folders, or package artifacts.
25
+ - Keep operational demo runbooks, buyer scripts, outreach plans, diligence checklists, and negotiation materials outside the public npm package.
25
26
 
26
27
  ## Package Exclusion Checks
27
28
 
@@ -34,6 +35,7 @@ Confirm release artifacts do not include:
34
35
  - Local database snapshots or SQL dumps.
35
36
  - Private sale, buyer, target, outreach, or diligence documents.
36
37
  - Private data-room folders.
38
+ - Operational demo runbooks intended for buyer calls or internal screen-share rehearsal.
37
39
  - Local logs.
38
40
  - Old package tarballs.
39
41
 
@@ -1,8 +1,25 @@
1
1
  # FreshContext Release Notes
2
2
 
3
+ ## 0.3.19
4
+
5
+ FreshContext 0.3.19 syncs the public MCP package with the new generic `evaluate_context` interface.
6
+
7
+ ### Context Evaluation Front Door
8
+
9
+ - Adds `evaluate_context` as the primary MCP tool for caller-provided candidate context.
10
+ - Returns decision-first output for agents and users: decision, meaning, action, warnings, source, freshness, rank score, utility, confidence, and explanation.
11
+ - Keeps the boundary explicit: `evaluate_context` does not fetch, crawl, scrape, browse, read folders, or call adapters.
12
+ - Updates stdio smoke and Trust Scanner claim checks to expect 22 MCP tools: `evaluate_context` plus 21 read-only reference adapters.
13
+
14
+ ### Public Framing
15
+
16
+ - Reframes the MCP package around FreshContext as context integrity infrastructure, not a 21-tool toolbox.
17
+ - Keeps the 21 adapter tools as read-only reference adapters and proof surfaces.
18
+ - Updates package-facing docs/spec language to point first at `candidate context -> FreshContext Core -> decision-ready context`.
19
+
3
20
  ## 0.3.18
4
21
 
5
- FreshContext 0.3.18 prepares the next npm package release without changing the deployed Worker or publishing automatically.
22
+ FreshContext 0.3.18 made the MCP/Core package easier to install, validate, and explain without changing the deployed Worker runtime.
6
23
 
7
24
  ### Core and Context Evaluation
8
25
 
@@ -32,7 +49,7 @@ FreshContext 0.3.18 prepares the next npm package release without changing the d
32
49
 
33
50
  ### Boundaries
34
51
 
35
- - No npm publish in this preparation pass.
36
- - No git tag in this preparation pass.
37
- - No deployment in this preparation pass.
38
- - No Worker, REST handler, Core runtime, MCP tool schema, or adapter behavior changes are included in the version bump itself.
52
+ - No Worker deploy is part of the npm package release.
53
+ - No hosted dashboard, billing system, Operator mode, browser crawling, or local file scanning is included.
54
+ - No Worker, REST handler, MCP tool schema, or existing adapter behavior changes are included in the package release itself.
55
+ - Future work is tracked in [`FUTURE_LANES.md`](./FUTURE_LANES.md).
@@ -31,7 +31,7 @@ MCP, REST, SDK, CLI, and future operator workflows are hosts over Core. They sho
31
31
 
32
32
  Adapters provide candidate context. They fetch, search, scrape, read, or receive source data, then turn that data into FreshContext-compatible signals.
33
33
 
34
- The 21 MCP tools in this repository are reference adapters, source-profile examples, and proof surfaces. They are useful, but they are not the product identity.
34
+ The named MCP tools in this repository are reference adapters, source-profile examples, and proof surfaces. They are useful, but they are not the product identity.
35
35
 
36
36
  They demonstrate that FreshContext can evaluate different information classes:
37
37
 
@@ -88,7 +88,7 @@ It does not add `retrieve(...)`, Operator mode, adapter selection, local file se
88
88
 
89
89
  ## Adapter Registry Metadata
90
90
 
91
- As of Pass 8-S, the 21 MCP tools are also represented as adapter metadata. The registry maps each current tool name to a future adapter identity, Source Profile, output mode, runtime kind, and migration risk.
91
+ As of Pass 8-S, the 21 named adapter tools are also represented as adapter metadata. The registry maps each adapter tool name to a future adapter identity, Source Profile, output mode, runtime kind, and migration risk. The generic `evaluate_context` MCP tool is not an adapter; it is a host interface over caller-provided candidate context.
92
92
 
93
93
  This registry is metadata-only. It does not change MCP behavior, adapter implementation behavior, Worker behavior, REST behavior, Core evaluation behavior, or runtime transport. It exists to make future extraction deliberate instead of ad hoc.
94
94
 
@@ -423,5 +423,5 @@ Sharper agent-facing sentence:
423
423
  FreshContext decides what context deserves to reach the model.
424
424
  ```
425
425
 
426
- Use the 21 tools as proof of breadth, not as the headline.
426
+ Use named reference adapters as proof of breadth, not as the headline.
427
427
 
@@ -101,6 +101,7 @@ const commands = {
101
101
  "tests/coreApiContract.test.ts",
102
102
  "tests/corePipeline.test.ts",
103
103
  "tests/decision.test.ts",
104
+ "tests/evaluateContextTool.test.ts",
104
105
  "tests/restHandler.test.ts",
105
106
  "tests/sourceProfiles.test.ts",
106
107
  "tests/adapterRegistry.test.ts",
package/package.json CHANGED
@@ -1,18 +1,19 @@
1
1
  {
2
2
  "name": "freshcontext-mcp",
3
3
  "mcpName": "io.github.PrinceGabriel-lgtm/freshcontext",
4
- "version": "0.3.18",
5
- "description": "Real-time web intelligence for AI agents. 21 tools, no required API keys. Every result timestamped with a freshness score.",
4
+ "version": "0.3.19",
5
+ "description": "Context integrity infrastructure for AI agents and retrieval systems. Score, explain, and wrap candidate context before it reaches the model.",
6
6
  "keywords": [
7
7
  "mcp",
8
8
  "mcp-server",
9
9
  "ai-agents",
10
10
  "llm",
11
11
  "freshness",
12
- "web-scraping",
13
- "github-analytics",
14
- "hackernews",
15
- "yc",
12
+ "context-integrity",
13
+ "retrieval",
14
+ "provenance",
15
+ "source-profiles",
16
+ "rag",
16
17
  "typescript",
17
18
  "context",
18
19
  "model-context-protocol"
@@ -37,10 +38,11 @@
37
38
  "!dist/apify.js",
38
39
  "docs/API_DESIGN.md",
39
40
  "docs/CODEX_MCP_USAGE.md",
41
+ "docs/CORE_MCP_BOUNDARY.md",
40
42
  "docs/CORE_API.md",
41
43
  "docs/DEPENDENCY_DILIGENCE.md",
44
+ "docs/FUTURE_LANES.md",
42
45
  "docs/HA_PRI_V2_DESIGN.md",
43
- "docs/OPERATIONAL_DEMO_RUNBOOK.md",
44
46
  "docs/RELEASE_INTEGRITY.md",
45
47
  "docs/RELEASE_NOTES.md",
46
48
  "docs/SIGNAL_CONTRACT.md",
package/server.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "$schema": "https://static.modelcontextprotocol.io/schemas/2025-07-09/server.schema.json",
3
3
  "name": "io.github.PrinceGabriel-lgtm/freshcontext",
4
- "description": "Freshness-aware AI retrieval with 21 MCP tools for timestamped, decay-ranked live signals.",
4
+ "description": "Context integrity infrastructure for AI agents and retrieval systems. Evaluates caller-provided and adapter-sourced context before it reaches the model.",
5
5
  "repository": {
6
6
  "url": "https://github.com/PrinceGabriel-lgtm/freshcontext-mcp",
7
7
  "source": "github"
8
8
  },
9
- "version": "0.3.18",
9
+ "version": "0.3.19",
10
10
  "website_url": "https://freshcontext-site.pages.dev",
11
11
  "packages": [
12
12
  {
13
13
  "registryType": "npm",
14
14
  "identifier": "freshcontext-mcp",
15
- "version": "0.3.18",
15
+ "version": "0.3.19",
16
16
  "transport": {
17
17
  "type": "stdio"
18
18
  }
@@ -1,458 +0,0 @@
1
- # FreshContext Operational Demo Runbook
2
-
3
- This runbook is for a live call, screen share, buyer demo, agent-builder conversation, or handoff where you need to show what FreshContext can do today.
4
-
5
- It is intentionally practical. It does not describe future Operator mode as if it already exists.
6
-
7
- ## The Short Explanation
8
-
9
- FreshContext is a context gateway between retrieval and reasoning.
10
-
11
- ```text
12
- Raw candidate context goes in.
13
- FreshContext evaluates freshness, usefulness, traceability, and uncertainty.
14
- Decision-ready context comes out.
15
- ```
16
-
17
- Use this sentence when someone asks what it is:
18
-
19
- ```text
20
- FreshContext tells an agent or human whether a source should be used, cited, refreshed, verified, watched, treated as background, or excluded.
21
- ```
22
-
23
- Use this sentence when someone asks why it matters:
24
-
25
- ```text
26
- Search and retrieval find matching information; FreshContext decides what context deserves to reach the model first.
27
- ```
28
-
29
- ## Current Operational Shape
30
-
31
- FreshContext has four working lanes today:
32
-
33
- | Lane | What It Does Today | Demo Status |
34
- |---|---|---|
35
- | Core | Normalizes signals, scores freshness, ranks, explains, prepares envelopes/provenance, and interprets decisions | Working |
36
- | MCP package | Exposes 21 reference tools to MCP clients over stdio | Working |
37
- | BYOC local demos | Lets a user provide JSON source lists and get decision-first output | Working |
38
- | arXiv signal proof | Shows extracted adapter signals flowing into Core decisions | Working |
39
-
40
- Two companion systems support operational trust:
41
-
42
- | Companion | Role |
43
- |---|---|
44
- | Trust Scanner | Checks package, release, public-claim, and integrity risk |
45
- | Ops Pulse | Checks Cloudflare/runtime/D1/cron/observability health for deployed systems |
46
-
47
- ## What FreshContext Is Not Yet
48
-
49
- Do not overclaim these in a live talk:
50
-
51
- - It is not full Operator mode yet.
52
- - It does not crawl the web by itself in the BYOC demo.
53
- - It does not silently read local folders.
54
- - It does not replace legal, medical, tax, employment, academic, or investment review.
55
- - It does not production-enforce Ha-Pri v2 yet.
56
- - It does not make `utility.score` replace default ranking.
57
- - It does not require publishing or deploying to demonstrate the current local flow.
58
-
59
- ## Screen-Share Prep
60
-
61
- Open two terminals:
62
-
63
- 1. FreshContext MCP repo:
64
-
65
- ```powershell
66
- cd "C:\Users\Immanuel Gabriel\Downloads\freshcontext-mcp"
67
- ```
68
-
69
- 2. Ops Pulse repo:
70
-
71
- ```powershell
72
- cd "C:\Users\Immanuel Gabriel\Downloads\freshcontext-ops-pulse"
73
- ```
74
-
75
- Optional files to open beside the terminal:
76
-
77
- - `README.md`
78
- - `docs/OPERATIONAL_DEMO_RUNBOOK.md`
79
- - `examples/sources.academic.example.json`
80
- - `examples/sources.jobs.example.json`
81
- - `docs/SOURCE_PROFILES.md`
82
- - `docs/CORE_API.md`
83
-
84
- ## Preflight Before A Call
85
-
86
- Run this before the call, not during the first minute of the call:
87
-
88
- ```powershell
89
- cd "C:\Users\Immanuel Gabriel\Downloads\freshcontext-mcp"
90
-
91
- git status --short --branch
92
- npm run build
93
- npm test
94
- npm run smoke:stdio
95
- npm run trust:scan:json
96
- ```
97
-
98
- Expected healthy signs:
99
-
100
- ```text
101
- working tree clean
102
- tests pass
103
- smoke: 21 tools, v0.3.18
104
- trust scan: 0 effective fail findings
105
- ```
106
-
107
- For Ops Pulse:
108
-
109
- ```powershell
110
- cd "C:\Users\Immanuel Gabriel\Downloads\freshcontext-ops-pulse"
111
-
112
- git status --short --branch
113
- npm run check
114
- npm run build
115
- ```
116
-
117
- Expected healthy signs:
118
-
119
- ```text
120
- working tree clean
121
- typecheck passes
122
- build passes
123
- ```
124
-
125
- ## Best Live Demo Path
126
-
127
- Use the local demos first. They are deterministic and do not need live network access.
128
-
129
- ### 1. Show Bring Your Own Context
130
-
131
- Academic/citation example:
132
-
133
- ```powershell
134
- cd "C:\Users\Immanuel Gabriel\Downloads\freshcontext-mcp"
135
- npm run demo:evaluate:file -- examples/sources.academic.example.json
136
- ```
137
-
138
- Say:
139
-
140
- ```text
141
- This is the simple user path. The user gives FreshContext candidate sources. FreshContext does not fetch or crawl here. It evaluates what was provided and returns decision-first context.
142
- ```
143
-
144
- Point out:
145
-
146
- - `Decision`
147
- - `Meaning`
148
- - `Action`
149
- - `Warnings`
150
- - `Freshness`
151
- - `Rank score`
152
- - `Utility`
153
- - `Confidence`
154
- - `Why`
155
-
156
- The important visible result is not the number. It is the action label:
157
-
158
- ```text
159
- Cite as primary
160
- Cite as supporting
161
- Needs verification
162
- Exclude
163
- ```
164
-
165
- ### 2. Show A Normal-User Example
166
-
167
- Jobs/opportunities example:
168
-
169
- ```powershell
170
- npm run demo:evaluate:file -- examples/sources.jobs.example.json
171
- ```
172
-
173
- Say:
174
-
175
- ```text
176
- The same Core works for a different source profile and intent. Academic sources age slowly; jobs age quickly. FreshContext changes the decision meaning without needing a new product.
177
- ```
178
-
179
- Point out decisions like:
180
-
181
- ```text
182
- Use first
183
- Needs refresh
184
- Exclude
185
- ```
186
-
187
- ### 3. Show Adapter-To-Core Proof
188
-
189
- arXiv fixture-backed adapter proof:
190
-
191
- ```powershell
192
- npm run demo:arxiv
193
- ```
194
-
195
- Say:
196
-
197
- ```text
198
- This closes the adapter loop. arXiv-style XML becomes FreshContext signals, then Core evaluates those signals, then the decision helper explains what to do with them.
199
- ```
200
-
201
- Use this exact flow:
202
-
203
- ```text
204
- arXiv XML
205
- -> searchArxivSignals(...)
206
- -> evaluateSignals(...)
207
- -> interpretEvaluations(...)
208
- -> decision-ready output
209
- ```
210
-
211
- This is the bridge from reference MCP tools to source-aware adapter assets.
212
-
213
- ### 4. Show MCP Runtime Health
214
-
215
- Only run this if network conditions are fine, because representative MCP smoke can touch live source paths:
216
-
217
- ```powershell
218
- npm run smoke:stdio
219
- ```
220
-
221
- Expected:
222
-
223
- ```json
224
- {
225
- "ok": true,
226
- "package_version": "0.3.18",
227
- "server_version": "0.3.18",
228
- "tool_count": 21
229
- }
230
- ```
231
-
232
- Say:
233
-
234
- ```text
235
- This proves the MCP package still exposes the reference tool surface. But the product is not the number of tools. The tools are proof surfaces and adapter candidates over the Core judgment layer.
236
- ```
237
-
238
- ### 5. Show Trust Scanner
239
-
240
- ```powershell
241
- npm run trust:scan:json
242
- ```
243
-
244
- Say:
245
-
246
- ```text
247
- This protects release and public-claim integrity. The line that matters for the gate is effective fail count: zero.
248
- ```
249
-
250
- You do not need to read every raw finding live. The scanner intentionally reports review items and downgrades known non-blockers.
251
-
252
- ### 6. Show Ops Pulse Health
253
-
254
- In the Ops Pulse repo:
255
-
256
- ```powershell
257
- cd "C:\Users\Immanuel Gabriel\Downloads\freshcontext-ops-pulse"
258
- npm run check
259
- npm run build
260
- ```
261
-
262
- Say:
263
-
264
- ```text
265
- Ops Pulse is separate from FreshContext Core. It is the operational health companion for Cloudflare/runtime/D1/cron/observability workflows.
266
- ```
267
-
268
- ## Bring Your Own Context File Shape
269
-
270
- Minimal JSON shape:
271
-
272
- ```json
273
- {
274
- "profile": "academic_research",
275
- "intent": "citation_check",
276
- "signals": [
277
- {
278
- "title": "Example source",
279
- "content": "Raw retrieved content or notes...",
280
- "source": "https://example.com/source",
281
- "source_type": "arxiv",
282
- "published_at": "2026-05-24T12:00:00.000Z",
283
- "retrieved_at": "2026-05-24T13:00:00.000Z",
284
- "semantic_score": 0.92
285
- }
286
- ]
287
- }
288
- ```
289
-
290
- Run a custom file:
291
-
292
- ```powershell
293
- npm run demo:evaluate:file -- path\to\sources.json
294
- ```
295
-
296
- Important boundary:
297
-
298
- ```text
299
- The file demo evaluates candidate context you provide. It does not fetch URLs, crawl websites, read folders, or run Operator mode.
300
- ```
301
-
302
- ## How To Explain The Framework
303
-
304
- Use this architecture:
305
-
306
- ```text
307
- Adapters / retrievers / databases / agents
308
- -> FreshContext Signal Contract
309
- -> Source Profile
310
- -> Core evaluation
311
- -> Decision Helper
312
- -> MCP / REST / SDK / CLI / agent output
313
- ```
314
-
315
- The deeper system split is:
316
-
317
- ```text
318
- Core = deterministic context intelligence
319
- Source Profiles = how source classes age and fail
320
- Adapters = source intake
321
- Hosts = MCP, REST, SDK, CLI
322
- Operator = future retrieval workflow over Core
323
- Trust Scanner = release/package/public-claim integrity
324
- Ops Pulse = runtime health diagnostics
325
- ```
326
-
327
- ## How Agents Would Use This
328
-
329
- For Codex, Claude, multi-agent workflows, or database-backed assistants, FreshContext should sit between retrieval and final reasoning:
330
-
331
- ```text
332
- Agent retrieves 30 candidate items.
333
- FreshContext normalizes and evaluates them.
334
- FreshContext returns ranked decisions and warnings.
335
- Agent uses the best context first and avoids stale/failed/unknown sources.
336
- ```
337
-
338
- That means FreshContext is not trying to be another chat agent. It is the layer an agent uses before deciding what to trust.
339
-
340
- In a multi-agent system:
341
-
342
- ```text
343
- Research agent finds candidates.
344
- FreshContext scores and labels candidates.
345
- Writing agent receives only decision-ready context.
346
- Review agent sees warnings, provenance, and excluded sources.
347
- ```
348
-
349
- For database workflows:
350
-
351
- ```text
352
- Database query returns rows or documents.
353
- FreshContext evaluates dates, confidence, failure states, and source profile.
354
- Application stores or displays the ranked decision result.
355
- ```
356
-
357
- ## What To Say If Someone Says "Is This Just Docs?"
358
-
359
- Say:
360
-
361
- ```text
362
- No. The docs describe the boundaries, but the local commands run the actual Core pipeline. The BYOC demo reads user-provided source JSON, evaluates it, ranks it, and prints decisions. The arXiv demo proves an adapter signal path reaches Core decisions. The MCP smoke proves the package exposes 21 working tools.
363
- ```
364
-
365
- Then run:
366
-
367
- ```powershell
368
- npm run demo:evaluate:file -- examples/sources.jobs.example.json
369
- ```
370
-
371
- The output is the answer.
372
-
373
- ## Current Demo Script
374
-
375
- Use this order in a live talk:
376
-
377
- 1. One sentence:
378
-
379
- ```text
380
- FreshContext decides what context deserves to reach the model.
381
- ```
382
-
383
- 2. Run academic BYOC:
384
-
385
- ```powershell
386
- npm run demo:evaluate:file -- examples/sources.academic.example.json
387
- ```
388
-
389
- 3. Run jobs BYOC:
390
-
391
- ```powershell
392
- npm run demo:evaluate:file -- examples/sources.jobs.example.json
393
- ```
394
-
395
- 4. Run arXiv adapter proof:
396
-
397
- ```powershell
398
- npm run demo:arxiv
399
- ```
400
-
401
- 5. Run MCP smoke if the network is stable:
402
-
403
- ```powershell
404
- npm run smoke:stdio
405
- ```
406
-
407
- 6. Close with:
408
-
409
- ```text
410
- The product is the judgment layer. The tools are reference adapters. The next growth path is more adapters, CLI/SDK usability, and eventually Operator mode.
411
- ```
412
-
413
- ## Current Release Boundary
414
-
415
- Current prepared package version:
416
-
417
- ```text
418
- freshcontext-mcp@0.3.18
419
- ```
420
-
421
- Current state:
422
-
423
- ```text
424
- release prep merged
425
- package ready for release execution gate
426
- npm publish not done
427
- deploy not done
428
- git tag not created
429
- ```
430
-
431
- Do not publish, deploy, or tag during a demo.
432
-
433
- ## Troubleshooting
434
-
435
- If the old ChatGPT handoff chat will not open:
436
-
437
- ```text
438
- Do not depend on it. Use this runbook plus the local docs and repo state.
439
- ```
440
-
441
- If `npm run smoke:stdio` fails during a live call:
442
-
443
- ```text
444
- Switch to the offline demos: demo:evaluate:file and demo:arxiv.
445
- ```
446
-
447
- If someone asks whether FreshContext gives advice:
448
-
449
- ```text
450
- No. It gives context judgment: citation readiness, freshness, usefulness, traceability, and uncertainty. Humans and domain systems still own final decisions.
451
- ```
452
-
453
- If someone asks what is next:
454
-
455
- ```text
456
- Release execution gate, then CLI/SDK usability, then more adapter extraction, then Operator mode.
457
- ```
458
-