@mcptoolshop/research-os 0.2.0 → 0.3.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.
- package/CHANGELOG.md +78 -0
- package/README.md +7 -5
- package/dist/cli.js +60 -10
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +12 -3
- package/dist/index.js +50 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1201,6 +1201,7 @@ declare const ClaimSchema: z.ZodObject<{
|
|
|
1201
1201
|
}>;
|
|
1202
1202
|
type Claim = z.infer<typeof ClaimSchema>;
|
|
1203
1203
|
|
|
1204
|
+
type DetectorMode = 'auto' | 'heuristic' | 'ollama-intern';
|
|
1204
1205
|
type ContradictionType = 'direct_conflict' | 'scope_conflict' | 'temporal_conflict' | 'definition_conflict' | 'evidence_conflict' | 'overgeneralization_risk';
|
|
1205
1206
|
type Severity = 'low' | 'medium' | 'high' | 'blocking';
|
|
1206
1207
|
type ContradictionDetectorName = 'heuristic' | 'ollama-intern';
|
|
@@ -1237,6 +1238,13 @@ interface MapOptions {
|
|
|
1237
1238
|
sectionId: string;
|
|
1238
1239
|
packPath?: string;
|
|
1239
1240
|
detectors?: ContradictionDetector[];
|
|
1241
|
+
detectorMode?: DetectorMode;
|
|
1242
|
+
ollamaConfig?: {
|
|
1243
|
+
host?: string;
|
|
1244
|
+
model?: string;
|
|
1245
|
+
timeoutMs?: number;
|
|
1246
|
+
fetchImpl?: typeof fetch;
|
|
1247
|
+
};
|
|
1240
1248
|
triagedOnly?: boolean;
|
|
1241
1249
|
}
|
|
1242
1250
|
interface MapSummary {
|
|
@@ -1249,6 +1257,7 @@ interface MapSummary {
|
|
|
1249
1257
|
contradictionsDeduped: number;
|
|
1250
1258
|
contradictionIds: string[];
|
|
1251
1259
|
detectorError: string | null;
|
|
1260
|
+
detectorAnnouncement: string;
|
|
1252
1261
|
}
|
|
1253
1262
|
|
|
1254
1263
|
declare function map(options: MapOptions): Promise<MapSummary>;
|
|
@@ -1311,7 +1320,7 @@ interface OllamaContradictionConfig {
|
|
|
1311
1320
|
declare class OllamaInternContradictionDetector implements ContradictionDetector {
|
|
1312
1321
|
readonly name: "ollama-intern";
|
|
1313
1322
|
private readonly host;
|
|
1314
|
-
|
|
1323
|
+
readonly model: string;
|
|
1315
1324
|
private readonly timeoutMs;
|
|
1316
1325
|
private readonly fetchImpl;
|
|
1317
1326
|
constructor(config?: OllamaContradictionConfig);
|
|
@@ -5911,6 +5920,6 @@ declare class SynthesisNotReadyError extends ResearchOSError {
|
|
|
5911
5920
|
constructor(mode: string);
|
|
5912
5921
|
}
|
|
5913
5922
|
|
|
5914
|
-
declare const RESEARCH_OS_VERSION = "0.
|
|
5923
|
+
declare const RESEARCH_OS_VERSION = "0.3.0";
|
|
5915
5924
|
|
|
5916
|
-
export { type AllowedSynthesisInput, AllowedSynthesisInputSchema, type ApproveOptions, type ApproveResult, type ArchivedArtifact, ArchivedArtifactSchema, type ArtifactHash, ArtifactHashSchema, type AuditDensityOptions, type AuditDensityResult, type HandoffMode as AuditHandoffMode, HandoffModeSchema as AuditHandoffModeSchema, type AuditOptions, type AuditSummary, type CitationCoverage, type Claim, type ClaimCluster, ClaimClusterSchema, type ClaimCounts, type ClaimDensityAudit, ClaimDensityAuditSchema, type ClaimExtractionInput, type ClaimExtractionResult, type ClaimExtractor, type ClaimExtractorAdapter, ClaimExtractorSchema, type ClaimReview, ClaimReviewSchema, ClaimSchema, type ClaimSummary, type ClaimTriage, ClaimTriageSchema, type Confidence, ConfidenceSchema, type Contradiction, ContradictionConfidenceSchema, type ContradictionCounts, type ContradictionDetector, type ContradictionDetectorName, ContradictionDetectorSchema, type ContradictionResolution, ContradictionResolutionSchema, ContradictionSchema, type ContradictionStatus, ContradictionStatusSchema, type ContradictionSummary, type ContradictionType, ContradictionTypeSchema, type CoworkHandoffPayload$1 as CoworkHandoffPayload, CoworkHandoffPayloadSchema, type CrossSectionContradictionRef, CrossSectionContradictionRefSchema, type CrossSectionMap, CrossSectionMapSchema, DEFAULT_PROFILE, type DensityFlag, DensityFlagSchema, type DetectionResult, type DiscoverOptions, type DiscoverProposal, type DiscoverProvider, type DiscoverProviderInput, type DiscoverProviderResult, type DiscoverResult, type DiscoveryCandidate, DiscoveryCandidateSchema, type DiscoveryCandidateStatus, DiscoveryCandidateStatusSchema, type DiscoverySummary, DiscoverySummarySchema, type DraftClaim, type DraftContradiction, type DraftFinding, EXCERPT_ID_PATTERN, type Excerpt, type ExcerptDraft, type ExcerptOrigin, ExcerptOriginSchema, ExcerptSchema, type ExportOptions, type ExportSummary, type ExportUrlsOptions, type ExportUrlsResult, type ExtractClaimsOptions, type ExtractClaimsSummary, type ExtractionInput, type ExtractionResult, type Extractor, type ExtractorName, ExtractorNameSchema, FORBIDDEN_ACTIONS_ALWAYS, type FetchReceipt, FetchReceiptSchema, type FindingCategory, FindingCategorySchema, type FindingSeverity, FindingSeveritySchema, type ForbiddenInput, ForbiddenInputSchema, type FreezeOptions, type FreezeReceiptPayload, FreezeReceiptPayloadSchema, type FreezeRefusalPayload, FreezeRefusalPayloadSchema, type FreezeSummary, type FreshnessSummary, type GateCheckResult, GateCheckResultSchema, type GateCheckStatus, GateCheckStatusSchema, type GateConfig, GateConfigSchema, type GateFamily, GateFamilySchema, type GateInput, type GateVerdictEntry, GateVerdictEntrySchema, type GatherOptions, type GatherSummary, type HandoffMode$1 as HandoffMode, HandoffModeSchema$1 as HandoffModeSchema, HandoffNotFoundError, type HandoffOptions, type HandoffSummary, HeuristicClaimExtractor, HeuristicContradictionDetector, HeuristicExtractor, HeuristicReviewer, type IndexBuildOptions, type IndexBuildSummary, IndexNotBuiltError, type IndexQueryOptions, type IndexQuerySummary, type IndexStatus, IndexStatusSchema, type InitOptions, type InitResult, IntakeValidationError, type IntegrityCheck, IntegrityCheckSchema, InvalidSectionIdError, type InvalidateExtractionOptions, type InvalidateExtractionResult, type InvalidateReviewOptions, type InvalidateReviewResult, type InvalidationReceipt, InvalidationReceiptSchema, LlmHeuristicDiscoverProvider, type LoadOrBuildArgs, type LoadOrBuildResult, type MapOptions, type MapSummary, type NearDuplicateCluster, NearDuplicateClusterSchema, NoSourcesGatheredError, NoUrlsProvidedError, OllamaInternClaimExtractor, OllamaInternContradictionDetector, OllamaInternExtractor, OllamaInternReviewer, type OrphanClaimRow, OrphanClaimRowSchema, type OverlapAssessment, OverlapAssessmentSchema, type PackAuditPayload, PackAuditPayloadSchema, PackExistsError, PackNotFoundError, type PackVerdict, PackVerdictSchema, type PairedDraft, type PerSourceDensity, PerSourceDensitySchema, type PrimarySourceWaiver, PrimarySourceWaiverSchema, type PromoteOptions, type PromoteResult, type QueryHit, RESEARCH_OS_VERSION, type ReadinessSummary, type RecordType, type RejectOptions, type RejectResult, type Relevance, RelevanceSchema, ResearchOSError, type ResearchYaml, ResearchYamlSchema, type ResolutionStatus, ResolutionStatusSchema, type ReviewActive, ReviewActiveSchema, ReviewConfidenceSchema, type ReviewDecision, type ReviewDecisionCount, ReviewDecisionCountSchema, ReviewDecisionSchema, type ReviewFinding, ReviewFindingSchema, type ReviewInvalidationReceipt, ReviewInvalidationReceiptSchema, type ReviewSnapshot, ReviewSnapshotSchema, type ReviewState, ReviewStateSchema, type ReviewSummary, type Reviewer, type ReviewerInput, type ReviewerName, ReviewerNameSchema, type ReviewerResult, type RunGateOptions, type RunReviewOptions, type RunReviewSummary, SCHEMA_VERSION, type ScopeIntegritySummary, type ScopeOverlap, ScopeOverlapSchema, type ScopeWideningRiskRow, ScopeWideningRiskRowSchema, type Section, type SectionAcceptedSummary, SectionAcceptedSummarySchema, type SectionAddOptions, type SectionAddResult, SectionExistsError, type SectionGateResult$1 as SectionGateResult, SectionGateResultSchema, type SectionGatesYaml, SectionGatesYamlSchema, SectionNotFoundError, type SectionReport, SectionReportAcceptanceSchema, SectionReportContradictionsSchema, SectionReportExtractionSchema, type SectionReportOptions, type SectionReportResult, SectionReportReviewSchema, SectionReportSchema, SectionReportSourcesSchema, SectionSchema, type SectionState, SectionStateSchema, type SectionStatusChange, SectionStatusChangeSchema, type Severity, SeveritySchema, type SharedSource, SharedSourceSchema, type SourceCard, SourceCardSchema, type SourceCounts, type SourceDiversityGapRow, SourceDiversityGapRowSchema, type SourceFetchPair, type SourceSummary, type SourceType, type SourceTypeGuess, SourceTypeGuessSchema, SourceTypeSchema, type StaleSourceRow, StaleSourceRowSchema, type SyncOptions, type SyncSummary, SynthesisNotReadyError, type SynthesisReadinessRow, SynthesisReadinessRowSchema, TemplateNotFoundError, type TriageDecision, TriageDecisionSchema, type TriageOptions, type TriageRunResult, type TriageSummary, TriageSummarySchema, type UnresolvedContradictionRow, UnresolvedContradictionRowSchema, type Verdict, VerdictSchema, type WaiverApplication, WaiverApplicationSchema, type WaiverDependency, WaiverDependencySchema, type WaiverEntry, WaiverEntrySchema, type WaiverSummary, type WeakSourceRow, WeakSourceRowSchema, type WorkspaceOptions, type WorkspaceSummary, add, aggregate, appendFetchLog, appendSectionSourceId, applySchema, applyWaivers, approve, assessScopeOverlap, audit, auditDensity, build, buildCard, buildExcerptIndex, buildResearchYaml, checkClaimIntegrity, checkContradiction, checkFreshness, checkScopeIntegrity, checkSectionBudget, checkSourceFloor, chunkKeyPoints, chunkRawText, collectUrls, dedupeAndValidate, defaultClaimExtractors, defaultContradictionDetectors, defaultExtractors, defaultReviewers, derive, deriveClaimReviews, deriveCrossSectionMap, discover, evidenceGrounded, exportRepoKnowledge, exportUrls, extract, extractClaimCitations, extractContradictionDisclosures, extractWaiverDisclosures, fetchOnce, freeze, gate, gather, handoff, hasNegation, indexDbPath, init, invalidateExtraction, invalidateReview, isValidProfileName, jaccardSimilarity, ledgerPathFor, loadOrBuildLedger, makeReceiptId, makeSourceId, map, normalizeOllamaHost, openIndexDb, parseUrlsFileText, pickClaimExtractor, pickContradictionDetector, pickExtractor, pickReviewer, profileDir, promote, query, readActiveProfile, readTriagedClaimIds, readUrlsFile, reject, renderCoworkMaster, renderCrossSectionMapMarkdown, renderDecisionBrief, renderFinalReport, renderFreezeReceiptMarkdown, renderFreezeRefusalMarkdown, renderGateMarkdown, renderLedgerForPrompt, renderMarkdownView, renderOrphanClaimsMarkdown, renderPackAuditMarkdown, renderReviewMarkdown, renderScopeWideningRisksMarkdown, renderSourceDiversityGapsMarkdown, renderStaleSourcesMarkdown, renderSynthesisReadinessMarkdown, renderUnresolvedContradictionsMarkdown, renderWeakSourcesMarkdown, renderWorkingReport, reportSection, resolve, review, reviewActivePath, slugify, syncRepoKnowledge, tokenize, triage, workspace, writeActiveProfile, writeSourceCard };
|
|
5925
|
+
export { type AllowedSynthesisInput, AllowedSynthesisInputSchema, type ApproveOptions, type ApproveResult, type ArchivedArtifact, ArchivedArtifactSchema, type ArtifactHash, ArtifactHashSchema, type AuditDensityOptions, type AuditDensityResult, type HandoffMode as AuditHandoffMode, HandoffModeSchema as AuditHandoffModeSchema, type AuditOptions, type AuditSummary, type CitationCoverage, type Claim, type ClaimCluster, ClaimClusterSchema, type ClaimCounts, type ClaimDensityAudit, ClaimDensityAuditSchema, type ClaimExtractionInput, type ClaimExtractionResult, type ClaimExtractor, type ClaimExtractorAdapter, ClaimExtractorSchema, type ClaimReview, ClaimReviewSchema, ClaimSchema, type ClaimSummary, type ClaimTriage, ClaimTriageSchema, type Confidence, ConfidenceSchema, type Contradiction, ContradictionConfidenceSchema, type ContradictionCounts, type ContradictionDetector, type ContradictionDetectorName, ContradictionDetectorSchema, type ContradictionResolution, ContradictionResolutionSchema, ContradictionSchema, type ContradictionStatus, ContradictionStatusSchema, type ContradictionSummary, type ContradictionType, ContradictionTypeSchema, type CoworkHandoffPayload$1 as CoworkHandoffPayload, CoworkHandoffPayloadSchema, type CrossSectionContradictionRef, CrossSectionContradictionRefSchema, type CrossSectionMap, CrossSectionMapSchema, DEFAULT_PROFILE, type DensityFlag, DensityFlagSchema, type DetectionResult, type DetectorMode, type DiscoverOptions, type DiscoverProposal, type DiscoverProvider, type DiscoverProviderInput, type DiscoverProviderResult, type DiscoverResult, type DiscoveryCandidate, DiscoveryCandidateSchema, type DiscoveryCandidateStatus, DiscoveryCandidateStatusSchema, type DiscoverySummary, DiscoverySummarySchema, type DraftClaim, type DraftContradiction, type DraftFinding, EXCERPT_ID_PATTERN, type Excerpt, type ExcerptDraft, type ExcerptOrigin, ExcerptOriginSchema, ExcerptSchema, type ExportOptions, type ExportSummary, type ExportUrlsOptions, type ExportUrlsResult, type ExtractClaimsOptions, type ExtractClaimsSummary, type ExtractionInput, type ExtractionResult, type Extractor, type ExtractorName, ExtractorNameSchema, FORBIDDEN_ACTIONS_ALWAYS, type FetchReceipt, FetchReceiptSchema, type FindingCategory, FindingCategorySchema, type FindingSeverity, FindingSeveritySchema, type ForbiddenInput, ForbiddenInputSchema, type FreezeOptions, type FreezeReceiptPayload, FreezeReceiptPayloadSchema, type FreezeRefusalPayload, FreezeRefusalPayloadSchema, type FreezeSummary, type FreshnessSummary, type GateCheckResult, GateCheckResultSchema, type GateCheckStatus, GateCheckStatusSchema, type GateConfig, GateConfigSchema, type GateFamily, GateFamilySchema, type GateInput, type GateVerdictEntry, GateVerdictEntrySchema, type GatherOptions, type GatherSummary, type HandoffMode$1 as HandoffMode, HandoffModeSchema$1 as HandoffModeSchema, HandoffNotFoundError, type HandoffOptions, type HandoffSummary, HeuristicClaimExtractor, HeuristicContradictionDetector, HeuristicExtractor, HeuristicReviewer, type IndexBuildOptions, type IndexBuildSummary, IndexNotBuiltError, type IndexQueryOptions, type IndexQuerySummary, type IndexStatus, IndexStatusSchema, type InitOptions, type InitResult, IntakeValidationError, type IntegrityCheck, IntegrityCheckSchema, InvalidSectionIdError, type InvalidateExtractionOptions, type InvalidateExtractionResult, type InvalidateReviewOptions, type InvalidateReviewResult, type InvalidationReceipt, InvalidationReceiptSchema, LlmHeuristicDiscoverProvider, type LoadOrBuildArgs, type LoadOrBuildResult, type MapOptions, type MapSummary, type NearDuplicateCluster, NearDuplicateClusterSchema, NoSourcesGatheredError, NoUrlsProvidedError, OllamaInternClaimExtractor, OllamaInternContradictionDetector, OllamaInternExtractor, OllamaInternReviewer, type OrphanClaimRow, OrphanClaimRowSchema, type OverlapAssessment, OverlapAssessmentSchema, type PackAuditPayload, PackAuditPayloadSchema, PackExistsError, PackNotFoundError, type PackVerdict, PackVerdictSchema, type PairedDraft, type PerSourceDensity, PerSourceDensitySchema, type PrimarySourceWaiver, PrimarySourceWaiverSchema, type PromoteOptions, type PromoteResult, type QueryHit, RESEARCH_OS_VERSION, type ReadinessSummary, type RecordType, type RejectOptions, type RejectResult, type Relevance, RelevanceSchema, ResearchOSError, type ResearchYaml, ResearchYamlSchema, type ResolutionStatus, ResolutionStatusSchema, type ReviewActive, ReviewActiveSchema, ReviewConfidenceSchema, type ReviewDecision, type ReviewDecisionCount, ReviewDecisionCountSchema, ReviewDecisionSchema, type ReviewFinding, ReviewFindingSchema, type ReviewInvalidationReceipt, ReviewInvalidationReceiptSchema, type ReviewSnapshot, ReviewSnapshotSchema, type ReviewState, ReviewStateSchema, type ReviewSummary, type Reviewer, type ReviewerInput, type ReviewerName, ReviewerNameSchema, type ReviewerResult, type RunGateOptions, type RunReviewOptions, type RunReviewSummary, SCHEMA_VERSION, type ScopeIntegritySummary, type ScopeOverlap, ScopeOverlapSchema, type ScopeWideningRiskRow, ScopeWideningRiskRowSchema, type Section, type SectionAcceptedSummary, SectionAcceptedSummarySchema, type SectionAddOptions, type SectionAddResult, SectionExistsError, type SectionGateResult$1 as SectionGateResult, SectionGateResultSchema, type SectionGatesYaml, SectionGatesYamlSchema, SectionNotFoundError, type SectionReport, SectionReportAcceptanceSchema, SectionReportContradictionsSchema, SectionReportExtractionSchema, type SectionReportOptions, type SectionReportResult, SectionReportReviewSchema, SectionReportSchema, SectionReportSourcesSchema, SectionSchema, type SectionState, SectionStateSchema, type SectionStatusChange, SectionStatusChangeSchema, type Severity, SeveritySchema, type SharedSource, SharedSourceSchema, type SourceCard, SourceCardSchema, type SourceCounts, type SourceDiversityGapRow, SourceDiversityGapRowSchema, type SourceFetchPair, type SourceSummary, type SourceType, type SourceTypeGuess, SourceTypeGuessSchema, SourceTypeSchema, type StaleSourceRow, StaleSourceRowSchema, type SyncOptions, type SyncSummary, SynthesisNotReadyError, type SynthesisReadinessRow, SynthesisReadinessRowSchema, TemplateNotFoundError, type TriageDecision, TriageDecisionSchema, type TriageOptions, type TriageRunResult, type TriageSummary, TriageSummarySchema, type UnresolvedContradictionRow, UnresolvedContradictionRowSchema, type Verdict, VerdictSchema, type WaiverApplication, WaiverApplicationSchema, type WaiverDependency, WaiverDependencySchema, type WaiverEntry, WaiverEntrySchema, type WaiverSummary, type WeakSourceRow, WeakSourceRowSchema, type WorkspaceOptions, type WorkspaceSummary, add, aggregate, appendFetchLog, appendSectionSourceId, applySchema, applyWaivers, approve, assessScopeOverlap, audit, auditDensity, build, buildCard, buildExcerptIndex, buildResearchYaml, checkClaimIntegrity, checkContradiction, checkFreshness, checkScopeIntegrity, checkSectionBudget, checkSourceFloor, chunkKeyPoints, chunkRawText, collectUrls, dedupeAndValidate, defaultClaimExtractors, defaultContradictionDetectors, defaultExtractors, defaultReviewers, derive, deriveClaimReviews, deriveCrossSectionMap, discover, evidenceGrounded, exportRepoKnowledge, exportUrls, extract, extractClaimCitations, extractContradictionDisclosures, extractWaiverDisclosures, fetchOnce, freeze, gate, gather, handoff, hasNegation, indexDbPath, init, invalidateExtraction, invalidateReview, isValidProfileName, jaccardSimilarity, ledgerPathFor, loadOrBuildLedger, makeReceiptId, makeSourceId, map, normalizeOllamaHost, openIndexDb, parseUrlsFileText, pickClaimExtractor, pickContradictionDetector, pickExtractor, pickReviewer, profileDir, promote, query, readActiveProfile, readTriagedClaimIds, readUrlsFile, reject, renderCoworkMaster, renderCrossSectionMapMarkdown, renderDecisionBrief, renderFinalReport, renderFreezeReceiptMarkdown, renderFreezeRefusalMarkdown, renderGateMarkdown, renderLedgerForPrompt, renderMarkdownView, renderOrphanClaimsMarkdown, renderPackAuditMarkdown, renderReviewMarkdown, renderScopeWideningRisksMarkdown, renderSourceDiversityGapsMarkdown, renderStaleSourcesMarkdown, renderSynthesisReadinessMarkdown, renderUnresolvedContradictionsMarkdown, renderWeakSourcesMarkdown, renderWorkingReport, reportSection, resolve, review, reviewActivePath, slugify, syncRepoKnowledge, tokenize, triage, workspace, writeActiveProfile, writeSourceCard };
|
package/dist/index.js
CHANGED
|
@@ -3262,6 +3262,48 @@ function buildContradiction(args) {
|
|
|
3262
3262
|
created_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
3263
3263
|
});
|
|
3264
3264
|
}
|
|
3265
|
+
async function resolveDetector(options) {
|
|
3266
|
+
const mode = options.detectorMode ?? "auto";
|
|
3267
|
+
if (!VALID_DETECTOR_MODES.includes(mode)) {
|
|
3268
|
+
throw new Error(
|
|
3269
|
+
`contradict map: invalid --detector value "${mode}"; valid values are: auto, heuristic, ollama-intern`
|
|
3270
|
+
);
|
|
3271
|
+
}
|
|
3272
|
+
if (mode === "heuristic") {
|
|
3273
|
+
return {
|
|
3274
|
+
detector: new HeuristicContradictionDetector(),
|
|
3275
|
+
announcement: "contradict map: using heuristic detector"
|
|
3276
|
+
};
|
|
3277
|
+
}
|
|
3278
|
+
if (mode === "ollama-intern") {
|
|
3279
|
+
const d = new OllamaInternContradictionDetector(options.ollamaConfig ?? {});
|
|
3280
|
+
if (!await d.available()) {
|
|
3281
|
+
throw new Error(
|
|
3282
|
+
`contradict map: ollama-intern detector requested but model ${d.model} is unavailable; aborting (use --detector heuristic to bypass)`
|
|
3283
|
+
);
|
|
3284
|
+
}
|
|
3285
|
+
return {
|
|
3286
|
+
detector: d,
|
|
3287
|
+
announcement: `contradict map: using ollama-intern detector with model ${d.model}`
|
|
3288
|
+
};
|
|
3289
|
+
}
|
|
3290
|
+
const detectors = options.detectors ?? [
|
|
3291
|
+
new OllamaInternContradictionDetector(options.ollamaConfig ?? {}),
|
|
3292
|
+
new HeuristicContradictionDetector()
|
|
3293
|
+
];
|
|
3294
|
+
const detector = await pickContradictionDetector(detectors);
|
|
3295
|
+
if (detector.name === "ollama-intern") {
|
|
3296
|
+
const modelName = detector instanceof OllamaInternContradictionDetector ? detector.model : process.env.OLLAMA_INTERN_MODEL ?? "hermes3:8b";
|
|
3297
|
+
return {
|
|
3298
|
+
detector,
|
|
3299
|
+
announcement: `contradict map: using ollama-intern detector with model ${modelName}`
|
|
3300
|
+
};
|
|
3301
|
+
}
|
|
3302
|
+
return {
|
|
3303
|
+
detector,
|
|
3304
|
+
announcement: "contradict map: ollama-intern unavailable; using heuristic detector"
|
|
3305
|
+
};
|
|
3306
|
+
}
|
|
3265
3307
|
async function map(options) {
|
|
3266
3308
|
const packPath = options.packPath ? resolve7(options.packPath) : process.cwd();
|
|
3267
3309
|
if (!existsSync9(join10(packPath, "research.yaml"))) throw new PackNotFoundError(packPath);
|
|
@@ -3273,8 +3315,7 @@ async function map(options) {
|
|
|
3273
3315
|
const allowed = await readTriagedClaimIds2(packPath, options.sectionId);
|
|
3274
3316
|
candidateClaims = candidateClaims.filter((c) => allowed.has(c.claim_id));
|
|
3275
3317
|
}
|
|
3276
|
-
const
|
|
3277
|
-
const detector = await pickContradictionDetector(adapters);
|
|
3318
|
+
const { detector, announcement } = await resolveDetector(options);
|
|
3278
3319
|
const summary = {
|
|
3279
3320
|
sectionId: options.sectionId,
|
|
3280
3321
|
detector: detector.name,
|
|
@@ -3284,7 +3325,8 @@ async function map(options) {
|
|
|
3284
3325
|
contradictionsAdded: 0,
|
|
3285
3326
|
contradictionsDeduped: 0,
|
|
3286
3327
|
contradictionIds: [],
|
|
3287
|
-
detectorError: null
|
|
3328
|
+
detectorError: null,
|
|
3329
|
+
detectorAnnouncement: announcement
|
|
3288
3330
|
};
|
|
3289
3331
|
const ledgerPath = join10(sectionDir, "contradictions.jsonl");
|
|
3290
3332
|
const mdPath = join10(sectionDir, "contradictions.md");
|
|
@@ -3348,7 +3390,7 @@ async function map(options) {
|
|
|
3348
3390
|
await writeFile9(mdPath, md, "utf8");
|
|
3349
3391
|
return summary;
|
|
3350
3392
|
}
|
|
3351
|
-
var DETECTOR_ID_PART;
|
|
3393
|
+
var DETECTOR_ID_PART, VALID_DETECTOR_MODES;
|
|
3352
3394
|
var init_map = __esm({
|
|
3353
3395
|
"src/contradictions/map.ts"() {
|
|
3354
3396
|
"use strict";
|
|
@@ -3356,11 +3398,14 @@ var init_map = __esm({
|
|
|
3356
3398
|
init_schema5();
|
|
3357
3399
|
init_schema7();
|
|
3358
3400
|
init_detectors();
|
|
3401
|
+
init_heuristic3();
|
|
3402
|
+
init_ollama_intern3();
|
|
3359
3403
|
init_markdown();
|
|
3360
3404
|
DETECTOR_ID_PART = {
|
|
3361
3405
|
heuristic: "heuristic",
|
|
3362
3406
|
"ollama-intern": "ollama_intern"
|
|
3363
3407
|
};
|
|
3408
|
+
VALID_DETECTOR_MODES = ["auto", "heuristic", "ollama-intern"];
|
|
3364
3409
|
}
|
|
3365
3410
|
});
|
|
3366
3411
|
|
|
@@ -12120,7 +12165,7 @@ var init_src = __esm({
|
|
|
12120
12165
|
init_triage();
|
|
12121
12166
|
init_discover();
|
|
12122
12167
|
init_errors();
|
|
12123
|
-
RESEARCH_OS_VERSION = "0.
|
|
12168
|
+
RESEARCH_OS_VERSION = "0.3.0";
|
|
12124
12169
|
}
|
|
12125
12170
|
});
|
|
12126
12171
|
init_src();
|