@mcptoolshop/research-os 0.1.1 → 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 +152 -0
- package/README.md +80 -60
- package/dist/cli.js +616 -12
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +21 -3
- package/dist/index.js +54 -7
- 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);
|
|
@@ -2486,6 +2495,7 @@ interface SectionState {
|
|
|
2486
2495
|
candidate_claims_total: number;
|
|
2487
2496
|
unresolved_contradiction_ids: string[];
|
|
2488
2497
|
blocking_reasons: string[];
|
|
2498
|
+
active_blockers: string[];
|
|
2489
2499
|
blocking_contradictions_unresolved: number;
|
|
2490
2500
|
provenance_summary?: ProvenanceSummary;
|
|
2491
2501
|
}
|
|
@@ -2612,6 +2622,7 @@ declare const SectionStateSchema: z.ZodObject<{
|
|
|
2612
2622
|
candidate_claims_total: z.ZodNumber;
|
|
2613
2623
|
unresolved_contradiction_ids: z.ZodArray<z.ZodString, "many">;
|
|
2614
2624
|
blocking_reasons: z.ZodArray<z.ZodString, "many">;
|
|
2625
|
+
active_blockers: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
2615
2626
|
blocking_contradictions_unresolved: z.ZodNumber;
|
|
2616
2627
|
provenance_summary: z.ZodOptional<z.ZodObject<{
|
|
2617
2628
|
accepted_count: z.ZodNumber;
|
|
@@ -2687,6 +2698,7 @@ declare const SectionStateSchema: z.ZodObject<{
|
|
|
2687
2698
|
dispositioned_claim_ids: string[];
|
|
2688
2699
|
candidate_claims_total: number;
|
|
2689
2700
|
unresolved_contradiction_ids: string[];
|
|
2701
|
+
active_blockers: string[];
|
|
2690
2702
|
blocking_contradictions_unresolved: number;
|
|
2691
2703
|
provenance_summary?: {
|
|
2692
2704
|
accepted_count: number;
|
|
@@ -2721,6 +2733,7 @@ declare const SectionStateSchema: z.ZodObject<{
|
|
|
2721
2733
|
unresolved_contradiction_ids: string[];
|
|
2722
2734
|
blocking_contradictions_unresolved: number;
|
|
2723
2735
|
dispositioned_claim_ids?: string[] | undefined;
|
|
2736
|
+
active_blockers?: string[] | undefined;
|
|
2724
2737
|
provenance_summary?: {
|
|
2725
2738
|
accepted_count: number;
|
|
2726
2739
|
rejected_count: number;
|
|
@@ -2806,6 +2819,7 @@ declare const CoworkHandoffPayloadSchema: z.ZodObject<{
|
|
|
2806
2819
|
candidate_claims_total: z.ZodNumber;
|
|
2807
2820
|
unresolved_contradiction_ids: z.ZodArray<z.ZodString, "many">;
|
|
2808
2821
|
blocking_reasons: z.ZodArray<z.ZodString, "many">;
|
|
2822
|
+
active_blockers: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
2809
2823
|
blocking_contradictions_unresolved: z.ZodNumber;
|
|
2810
2824
|
provenance_summary: z.ZodOptional<z.ZodObject<{
|
|
2811
2825
|
accepted_count: z.ZodNumber;
|
|
@@ -2881,6 +2895,7 @@ declare const CoworkHandoffPayloadSchema: z.ZodObject<{
|
|
|
2881
2895
|
dispositioned_claim_ids: string[];
|
|
2882
2896
|
candidate_claims_total: number;
|
|
2883
2897
|
unresolved_contradiction_ids: string[];
|
|
2898
|
+
active_blockers: string[];
|
|
2884
2899
|
blocking_contradictions_unresolved: number;
|
|
2885
2900
|
provenance_summary?: {
|
|
2886
2901
|
accepted_count: number;
|
|
@@ -2915,6 +2930,7 @@ declare const CoworkHandoffPayloadSchema: z.ZodObject<{
|
|
|
2915
2930
|
unresolved_contradiction_ids: string[];
|
|
2916
2931
|
blocking_contradictions_unresolved: number;
|
|
2917
2932
|
dispositioned_claim_ids?: string[] | undefined;
|
|
2933
|
+
active_blockers?: string[] | undefined;
|
|
2918
2934
|
provenance_summary?: {
|
|
2919
2935
|
accepted_count: number;
|
|
2920
2936
|
rejected_count: number;
|
|
@@ -3005,6 +3021,7 @@ declare const CoworkHandoffPayloadSchema: z.ZodObject<{
|
|
|
3005
3021
|
dispositioned_claim_ids: string[];
|
|
3006
3022
|
candidate_claims_total: number;
|
|
3007
3023
|
unresolved_contradiction_ids: string[];
|
|
3024
|
+
active_blockers: string[];
|
|
3008
3025
|
blocking_contradictions_unresolved: number;
|
|
3009
3026
|
provenance_summary?: {
|
|
3010
3027
|
accepted_count: number;
|
|
@@ -3074,6 +3091,7 @@ declare const CoworkHandoffPayloadSchema: z.ZodObject<{
|
|
|
3074
3091
|
unresolved_contradiction_ids: string[];
|
|
3075
3092
|
blocking_contradictions_unresolved: number;
|
|
3076
3093
|
dispositioned_claim_ids?: string[] | undefined;
|
|
3094
|
+
active_blockers?: string[] | undefined;
|
|
3077
3095
|
provenance_summary?: {
|
|
3078
3096
|
accepted_count: number;
|
|
3079
3097
|
rejected_count: number;
|
|
@@ -5902,6 +5920,6 @@ declare class SynthesisNotReadyError extends ResearchOSError {
|
|
|
5902
5920
|
constructor(mode: string);
|
|
5903
5921
|
}
|
|
5904
5922
|
|
|
5905
|
-
declare const RESEARCH_OS_VERSION = "0.
|
|
5923
|
+
declare const RESEARCH_OS_VERSION = "0.3.0";
|
|
5906
5924
|
|
|
5907
|
-
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
|
|
|
@@ -7277,6 +7322,7 @@ function buildSectionState(args) {
|
|
|
7277
7322
|
candidate_claims_total: candidateClaims.length,
|
|
7278
7323
|
unresolved_contradiction_ids: unresolved.map((c) => c.contradiction_id),
|
|
7279
7324
|
blocking_reasons: gate2?.blocking_reasons ?? [],
|
|
7325
|
+
active_blockers: gate2?.blocking_reasons ?? [],
|
|
7280
7326
|
blocking_contradictions_unresolved: blocking.length,
|
|
7281
7327
|
provenance_summary: provenanceSummary
|
|
7282
7328
|
};
|
|
@@ -7320,7 +7366,7 @@ function determineMode(sections, waivers, warnings) {
|
|
|
7320
7366
|
return "human_review_required";
|
|
7321
7367
|
}
|
|
7322
7368
|
const allReady = sections.every(
|
|
7323
|
-
(s) => s.has_gate_run && s.synthesis_eligible && s.has_review_run && s.candidate_claims_total > 0 && s.
|
|
7369
|
+
(s) => s.has_gate_run && s.synthesis_eligible && s.has_review_run && s.candidate_claims_total > 0 && s.active_blockers.length === 0 && s.unresolved_contradiction_ids.length === 0
|
|
7324
7370
|
);
|
|
7325
7371
|
if (allReady && sections.length > 0) return "synthesis_ready";
|
|
7326
7372
|
return "repair_required";
|
|
@@ -7529,6 +7575,7 @@ var init_schema13 = __esm({
|
|
|
7529
7575
|
candidate_claims_total: z14.number().int().nonnegative(),
|
|
7530
7576
|
unresolved_contradiction_ids: z14.array(z14.string()),
|
|
7531
7577
|
blocking_reasons: z14.array(z14.string()),
|
|
7578
|
+
active_blockers: z14.array(z14.string()).default([]),
|
|
7532
7579
|
blocking_contradictions_unresolved: z14.number().int().nonnegative(),
|
|
7533
7580
|
provenance_summary: ProvenanceSummarySchema.optional()
|
|
7534
7581
|
});
|
|
@@ -9145,7 +9192,7 @@ function buildReadinessSummary(rows, handoff2, unresolvedContradictions) {
|
|
|
9145
9192
|
if (!r.has_gate_run) noGate += 1;
|
|
9146
9193
|
if (!r.has_review_run) noReview += 1;
|
|
9147
9194
|
const unresolvedCount = unresolvedBySection.get(r.section_id) ?? 0;
|
|
9148
|
-
if (r.synthesis_eligible && r.has_review_run && r.candidate_claims > 0 && r.
|
|
9195
|
+
if (r.synthesis_eligible && r.has_review_run && r.candidate_claims > 0 && r.blocking_reasons.length === 0 && unresolvedCount === 0) {
|
|
9149
9196
|
ready += 1;
|
|
9150
9197
|
} else if (r.has_gate_run && r.gate_verdict === "blocked" && !r.synthesis_eligible) {
|
|
9151
9198
|
blocked += 1;
|
|
@@ -12118,7 +12165,7 @@ var init_src = __esm({
|
|
|
12118
12165
|
init_triage();
|
|
12119
12166
|
init_discover();
|
|
12120
12167
|
init_errors();
|
|
12121
|
-
RESEARCH_OS_VERSION = "0.
|
|
12168
|
+
RESEARCH_OS_VERSION = "0.3.0";
|
|
12122
12169
|
}
|
|
12123
12170
|
});
|
|
12124
12171
|
init_src();
|