alphacouncil-agent 1.0.0 → 1.0.2
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/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/AGENTS.md +5 -6
- package/CHANGELOG.md +86 -0
- package/CLAUDE.md +5 -6
- package/README.ja.md +13 -12
- package/README.md +16 -16
- package/README.zh-CN.md +11 -11
- package/data/authored/core-seats.mjs +3 -3
- package/data/authored/quant-seats.mjs +2 -2
- package/data/authored/value-seats.mjs +4 -4
- package/data/build-profile.v1.json +1 -1
- package/docs/INSTALL.md +6 -10
- package/docs/plans/v1.1-basket-native-seats.md +267 -0
- package/knowledge/ai-assisted-solo/experiments/runs/a.json +10 -10
- package/knowledge/ai-assisted-solo/experiments/runs/b.json +2 -2
- package/knowledge/ai-assisted-solo/experiments/runs/c.json +2 -2
- package/knowledge/ai-assisted-solo/experiments/runs/d13.json +52 -52
- package/knowledge/ai-assisted-solo/experiments/runs/d26.json +68 -68
- package/knowledge/ai-assisted-solo/experiments/runs/e-d13.json +55 -55
- package/knowledge/ai-assisted-solo/experiments/runs/e-d26.json +71 -71
- package/knowledge/ai-assisted-solo/experiments/runs/h_ai_reference.json +72 -72
- package/knowledge/ai-assisted-solo/experiments/simulation-input.json +51 -51
- package/knowledge/ai-assisted-solo/experiments/simulation-manifest.json +19 -19
- package/knowledge/ai-assisted-solo/reviews/persona-v3-ai-formula-reviews/master_ackman/reviews/market_capitalisation.ai-review.json +35 -35
- package/knowledge/ai-assisted-solo/reviews/persona-v3-ai-formula-reviews/master_ackman/reviews/owner_earnings_yield.ai-review.json +15 -15
- package/knowledge/ai-assisted-solo/reviews/persona-v3-ai-formula-reviews/master_aschenbrenner/reviews/market_capitalisation.ai-review.json +35 -35
- package/knowledge/ai-assisted-solo/reviews/persona-v3-ai-formula-reviews/master_aschenbrenner/reviews/price_implied_cash_yield.ai-review.json +15 -15
- package/knowledge/ai-assisted-solo/reviews/persona-v3-ai-formula-reviews/master_asness/reviews/nominal_earnings_yield_gap.ai-review.json +15 -15
- package/knowledge/ai-assisted-solo/reviews/persona-v3-ai-formula-reviews/master_asness/reviews/real_earnings_yield_gap.ai-review.json +15 -15
- package/knowledge/ai-assisted-solo/reviews/persona-v3-ai-formula-reviews/master_bogle/reviews/expected_return_over_long_bond.ai-review.json +15 -15
- package/knowledge/ai-assisted-solo/reviews/persona-v3-ai-formula-reviews/master_bogle/reviews/fundamental_expected_return.ai-review.json +15 -15
- package/knowledge/ai-assisted-solo/reviews/persona-v3-ai-formula-reviews/master_buffett/reviews/market_capitalisation.ai-review.json +35 -35
- package/knowledge/ai-assisted-solo/reviews/persona-v3-ai-formula-reviews/master_buffett/reviews/owner_earnings_yield.ai-review.json +15 -15
- package/knowledge/ai-assisted-solo/reviews/persona-v3-ai-formula-reviews/master_burry/reviews/net_current_asset_surplus_per_share.ai-review.json +15 -15
- package/knowledge/ai-assisted-solo/reviews/persona-v3-ai-formula-reviews/master_burry/reviews/net_current_asset_value_per_share.ai-review.json +35 -35
- package/knowledge/ai-assisted-solo/reviews/persona-v3-ai-formula-reviews/master_cathie_wood/reviews/current_cash_yield.ai-review.json +15 -15
- package/knowledge/ai-assisted-solo/reviews/persona-v3-ai-formula-reviews/master_cathie_wood/reviews/market_capitalisation.ai-review.json +35 -35
- package/knowledge/ai-assisted-solo/reviews/persona-v3-ai-formula-reviews/master_dalio/reviews/policy_real_rate.ai-review.json +15 -15
- package/knowledge/ai-assisted-solo/reviews/persona-v3-ai-formula-reviews/master_dalio/reviews/real_curve_slope.ai-review.json +15 -15
- package/knowledge/ai-assisted-solo/reviews/persona-v3-ai-formula-reviews/master_damodaran/reviews/implied_equity_risk_premium.ai-review.json +15 -15
- package/knowledge/ai-assisted-solo/reviews/persona-v3-ai-formula-reviews/master_damodaran/reviews/premium_versus_long_run_average.ai-review.json +15 -15
- package/knowledge/ai-assisted-solo/reviews/persona-v3-ai-formula-reviews/master_druckenmiller/reviews/liquidity_curve_impulse.ai-review.json +15 -15
- package/knowledge/ai-assisted-solo/reviews/persona-v3-ai-formula-reviews/master_druckenmiller/reviews/policy_real_rate.ai-review.json +15 -15
- package/knowledge/ai-assisted-solo/reviews/persona-v3-ai-formula-reviews/master_duan_yongping/reviews/five_year_opportunity_cost.ai-review.json +35 -35
- package/knowledge/ai-assisted-solo/reviews/persona-v3-ai-formula-reviews/master_duan_yongping/reviews/margin_retention.ai-review.json +15 -15
- package/knowledge/ai-assisted-solo/reviews/persona-v3-ai-formula-reviews/master_fisher/reviews/margin_retention.ai-review.json +15 -15
- package/knowledge/ai-assisted-solo/reviews/persona-v3-ai-formula-reviews/master_fisher/reviews/reinvestment_spread.ai-review.json +15 -15
- package/knowledge/ai-assisted-solo/reviews/persona-v3-ai-formula-reviews/master_forensic_short/reviews/cash_conversion_gap.ai-review.json +15 -15
- package/knowledge/ai-assisted-solo/reviews/persona-v3-ai-formula-reviews/master_forensic_short/reviews/cash_cover_of_leverage.ai-review.json +15 -15
- package/knowledge/ai-assisted-solo/reviews/persona-v3-ai-formula-reviews/master_graham/reviews/defensive_hurdle_base.ai-review.json +35 -35
- package/knowledge/ai-assisted-solo/reviews/persona-v3-ai-formula-reviews/master_graham/reviews/half_normalised_earnings_yield.ai-review.json +15 -15
- package/knowledge/ai-assisted-solo/reviews/persona-v3-ai-formula-reviews/master_jhunjhunwala/reviews/cash_quality_gap.ai-review.json +15 -15
- package/knowledge/ai-assisted-solo/reviews/persona-v3-ai-formula-reviews/master_jhunjhunwala/reviews/real_structural_growth.ai-review.json +15 -15
- package/knowledge/ai-assisted-solo/reviews/persona-v3-ai-formula-reviews/master_klarman/reviews/downside_asset_coverage.ai-review.json +15 -15
- package/knowledge/ai-assisted-solo/reviews/persona-v3-ai-formula-reviews/master_klarman/reviews/market_capitalisation.ai-review.json +35 -35
- package/knowledge/ai-assisted-solo/reviews/persona-v3-ai-formula-reviews/master_li_lu/reviews/cash_backed_decade_return.ai-review.json +15 -15
- package/knowledge/ai-assisted-solo/reviews/persona-v3-ai-formula-reviews/master_li_lu/reviews/decade_return_over_long_bond.ai-review.json +15 -15
- package/knowledge/ai-assisted-solo/reviews/persona-v3-ai-formula-reviews/master_lynch/reviews/growth_justified_capitalisation.ai-review.json +15 -15
- package/knowledge/ai-assisted-solo/reviews/persona-v3-ai-formula-reviews/master_lynch/reviews/market_capitalisation.ai-review.json +35 -35
- package/knowledge/ai-assisted-solo/reviews/persona-v3-ai-formula-reviews/master_marks/reviews/credit_cycle_position.ai-review.json +15 -15
- package/knowledge/ai-assisted-solo/reviews/persona-v3-ai-formula-reviews/master_marks/reviews/equity_over_corporate_debt.ai-review.json +15 -15
- package/knowledge/ai-assisted-solo/reviews/persona-v3-ai-formula-reviews/master_munger/reviews/debt_service_cushion.ai-review.json +15 -15
- package/knowledge/ai-assisted-solo/reviews/persona-v3-ai-formula-reviews/master_munger/reviews/reported_earnings_cash_gap.ai-review.json +15 -15
- package/knowledge/ai-assisted-solo/reviews/persona-v3-ai-formula-reviews/master_natenberg/reviews/normalised_skew.ai-review.json +15 -15
- package/knowledge/ai-assisted-solo/reviews/persona-v3-ai-formula-reviews/master_natenberg/reviews/round_trip_cost.ai-review.json +15 -15
- package/knowledge/ai-assisted-solo/reviews/persona-v3-ai-formula-reviews/master_pabrai/reviews/downside_floor_coverage.ai-review.json +15 -15
- package/knowledge/ai-assisted-solo/reviews/persona-v3-ai-formula-reviews/master_pabrai/reviews/market_capitalisation.ai-review.json +35 -35
- package/knowledge/ai-assisted-solo/reviews/persona-v3-ai-formula-reviews/master_simons/reviews/absolute_session_move.ai-review.json +15 -15
- package/knowledge/ai-assisted-solo/reviews/persona-v3-ai-formula-reviews/master_simons/reviews/session_move_over_implied.ai-review.json +15 -15
- package/knowledge/ai-assisted-solo/reviews/persona-v3-ai-formula-reviews/master_sinclair/reviews/round_trip_cost.ai-review.json +15 -15
- package/knowledge/ai-assisted-solo/reviews/persona-v3-ai-formula-reviews/master_sinclair/reviews/volatility_per_unit_of_width.ai-review.json +15 -15
- package/knowledge/ai-assisted-solo/reviews/persona-v3-ai-formula-reviews/master_soros/reviews/credit_cycle_position.ai-review.json +15 -15
- package/knowledge/ai-assisted-solo/reviews/persona-v3-ai-formula-reviews/master_soros/reviews/financing_burden.ai-review.json +15 -15
- package/knowledge/ai-assisted-solo/reviews/persona-v3-ai-formula-reviews/master_taleb/reviews/debt_service_cushion.ai-review.json +15 -15
- package/knowledge/ai-assisted-solo/reviews/persona-v3-ai-formula-reviews/master_taleb/reviews/normalised_skew.ai-review.json +15 -15
- package/knowledge/ai-assisted-solo/reviews/persona-v3-ai-formula-reviews/master_thorp/reviews/edge_per_unit_of_volatility.ai-review.json +15 -15
- package/knowledge/ai-assisted-solo/reviews/persona-v3-ai-formula-reviews/master_thorp/reviews/net_edge.ai-review.json +15 -15
- package/knowledge/ai-assisted-solo/reviews/persona-v3-ai-formula-reviews/review-manifest.json +164 -164
- package/knowledge/solo-test/masters/master_ackman/provisional-index.json +1 -1
- package/knowledge/solo-test/masters/master_ackman/tools.json +6 -6
- package/knowledge/solo-test/masters/master_aschenbrenner/provisional-index.json +1 -1
- package/knowledge/solo-test/masters/master_aschenbrenner/tools.json +6 -6
- package/knowledge/solo-test/masters/master_asness/provisional-index.json +1 -1
- package/knowledge/solo-test/masters/master_bogle/provisional-index.json +1 -1
- package/knowledge/solo-test/masters/master_buffett/provisional-index.json +1 -1
- package/knowledge/solo-test/masters/master_buffett/tools.json +6 -6
- package/knowledge/solo-test/masters/master_burry/provisional-index.json +1 -1
- package/knowledge/solo-test/masters/master_burry/tools.json +6 -6
- package/knowledge/solo-test/masters/master_cathie_wood/provisional-index.json +1 -1
- package/knowledge/solo-test/masters/master_cathie_wood/tools.json +6 -6
- package/knowledge/solo-test/masters/master_dalio/provisional-index.json +1 -1
- package/knowledge/solo-test/masters/master_damodaran/provisional-index.json +1 -1
- package/knowledge/solo-test/masters/master_druckenmiller/provisional-index.json +1 -1
- package/knowledge/solo-test/masters/master_duan_yongping/provisional-index.json +1 -1
- package/knowledge/solo-test/masters/master_duan_yongping/tools.json +6 -6
- package/knowledge/solo-test/masters/master_fisher/provisional-index.json +1 -1
- package/knowledge/solo-test/masters/master_forensic_short/provisional-index.json +1 -1
- package/knowledge/solo-test/masters/master_graham/decision_policy.json +1 -1
- package/knowledge/solo-test/masters/master_graham/provisional-index.json +1 -1
- package/knowledge/solo-test/masters/master_graham/tools.json +6 -6
- package/knowledge/solo-test/masters/master_jhunjhunwala/provisional-index.json +1 -1
- package/knowledge/solo-test/masters/master_klarman/decision_policy.json +1 -1
- package/knowledge/solo-test/masters/master_klarman/provisional-index.json +1 -1
- package/knowledge/solo-test/masters/master_klarman/tools.json +6 -6
- package/knowledge/solo-test/masters/master_li_lu/provisional-index.json +1 -1
- package/knowledge/solo-test/masters/master_lynch/provisional-index.json +1 -1
- package/knowledge/solo-test/masters/master_lynch/tools.json +6 -6
- package/knowledge/solo-test/masters/master_marks/provisional-index.json +1 -1
- package/knowledge/solo-test/masters/master_munger/provisional-index.json +1 -1
- package/knowledge/solo-test/masters/master_natenberg/provisional-index.json +1 -1
- package/knowledge/solo-test/masters/master_pabrai/decision_policy.json +1 -1
- package/knowledge/solo-test/masters/master_pabrai/provisional-index.json +1 -1
- package/knowledge/solo-test/masters/master_pabrai/tools.json +6 -6
- package/knowledge/solo-test/masters/master_simons/provisional-index.json +1 -1
- package/knowledge/solo-test/masters/master_sinclair/provisional-index.json +1 -1
- package/knowledge/solo-test/masters/master_soros/provisional-index.json +1 -1
- package/knowledge/solo-test/masters/master_taleb/provisional-index.json +1 -1
- package/knowledge/solo-test/masters/master_thorp/provisional-index.json +1 -1
- package/knowledge/solo-test/persona-v3-solo-test-formulas/compilation-manifest.json +21 -21
- package/knowledge/solo-test/persona-v3-solo-test-formulas/master_ackman/components/tools.json +6 -6
- package/knowledge/solo-test/persona-v3-solo-test-formulas/master_ackman/provisional-derivations/market_capitalisation.derived-proxy-evidence.json +3 -3
- package/knowledge/solo-test/persona-v3-solo-test-formulas/master_aschenbrenner/components/tools.json +6 -6
- package/knowledge/solo-test/persona-v3-solo-test-formulas/master_aschenbrenner/provisional-derivations/market_capitalisation.derived-proxy-evidence.json +3 -3
- package/knowledge/solo-test/persona-v3-solo-test-formulas/master_buffett/components/tools.json +6 -6
- package/knowledge/solo-test/persona-v3-solo-test-formulas/master_buffett/provisional-derivations/market_capitalisation.derived-proxy-evidence.json +3 -3
- package/knowledge/solo-test/persona-v3-solo-test-formulas/master_burry/components/tools.json +6 -6
- package/knowledge/solo-test/persona-v3-solo-test-formulas/master_burry/provisional-derivations/net_current_asset_value_per_share.derived-proxy-evidence.json +3 -3
- package/knowledge/solo-test/persona-v3-solo-test-formulas/master_cathie_wood/components/tools.json +6 -6
- package/knowledge/solo-test/persona-v3-solo-test-formulas/master_cathie_wood/provisional-derivations/market_capitalisation.derived-proxy-evidence.json +3 -3
- package/knowledge/solo-test/persona-v3-solo-test-formulas/master_duan_yongping/components/tools.json +6 -6
- package/knowledge/solo-test/persona-v3-solo-test-formulas/master_duan_yongping/provisional-derivations/five_year_opportunity_cost.derived-proxy-evidence.json +3 -3
- package/knowledge/solo-test/persona-v3-solo-test-formulas/master_graham/components/tools.json +6 -6
- package/knowledge/solo-test/persona-v3-solo-test-formulas/master_graham/provisional-derivations/defensive_hurdle_base.derived-proxy-evidence.json +3 -3
- package/knowledge/solo-test/persona-v3-solo-test-formulas/master_klarman/components/tools.json +6 -6
- package/knowledge/solo-test/persona-v3-solo-test-formulas/master_klarman/provisional-derivations/market_capitalisation.derived-proxy-evidence.json +3 -3
- package/knowledge/solo-test/persona-v3-solo-test-formulas/master_lynch/components/tools.json +6 -6
- package/knowledge/solo-test/persona-v3-solo-test-formulas/master_lynch/provisional-derivations/market_capitalisation.derived-proxy-evidence.json +3 -3
- package/knowledge/solo-test/persona-v3-solo-test-formulas/master_pabrai/components/tools.json +6 -6
- package/knowledge/solo-test/persona-v3-solo-test-formulas/master_pabrai/provisional-derivations/market_capitalisation.derived-proxy-evidence.json +3 -3
- package/mcp/lib/basket-news.mjs +181 -0
- package/mcp/lib/breadth.mjs +29 -1
- package/mcp/lib/cross-market.mjs +180 -0
- package/mcp/lib/fund-observations.mjs +152 -0
- package/mcp/lib/fundamentals.mjs +6 -1
- package/mcp/lib/funds.mjs +35 -0
- package/mcp/lib/grounding.mjs +55 -2
- package/mcp/lib/index-aggregate.mjs +16 -1
- package/mcp/lib/industry.mjs +23 -2
- package/mcp/lib/instrument-facts.mjs +318 -17
- package/mcp/lib/instruments.mjs +25 -0
- package/mcp/lib/markdown.mjs +41 -8
- package/mcp/lib/personas-v3/grounding-adapter.mjs +139 -0
- package/mcp/lib/xbrl-series.mjs +4 -2
- package/package.json +2 -2
- package/scripts/lib/persona-v3-solo-formula-pipeline.mjs +18 -1
|
@@ -571,6 +571,143 @@ function fundamentalFacts(grounding, context) {
|
|
|
571
571
|
* across the newest ownership document per reporting owner, and the coverage limits of Section
|
|
572
572
|
* 16 are real. Labelling it reported would claim a document that does not exist.
|
|
573
573
|
*/
|
|
574
|
+
/**
|
|
575
|
+
* What else a basket is a bet on, as typed facts.
|
|
576
|
+
*
|
|
577
|
+
* Correlation to the broad market decides how much diversification a position actually buys,
|
|
578
|
+
* which is the input Dalio's authored policy already asks for and could never get. Correlation
|
|
579
|
+
* to Korea is the semiconductor cycle read from outside the United States. Sector dispersion is
|
|
580
|
+
* whether one factor or many are repricing the market.
|
|
581
|
+
*/
|
|
582
|
+
/**
|
|
583
|
+
* News as counts, never as content.
|
|
584
|
+
*
|
|
585
|
+
* A headline cannot reach a seat's arithmetic: the same symbol would answer differently
|
|
586
|
+
* depending on what was published that morning, and a frozen deterministic stance would stop
|
|
587
|
+
* being reproducible. What IS a fact is how much of the basket generated dated news in a stated
|
|
588
|
+
* window, and how many constituents filed an 8-K in it. Both are counts with a date, and both
|
|
589
|
+
* are the kind of thing an event-driven method legitimately asks for.
|
|
590
|
+
*
|
|
591
|
+
* The headlines themselves stay in the grounding for the report and for the voice worker that
|
|
592
|
+
* explains a stance the seat already reached.
|
|
593
|
+
*/
|
|
594
|
+
function basketNewsFacts(grounding, context) {
|
|
595
|
+
const news = grounding?.basket_news;
|
|
596
|
+
if (!news?.available) return;
|
|
597
|
+
const publicAt = timestampAtOrBefore(grounding?.gathered_at || context.asOf, context.cutoff);
|
|
598
|
+
if (!publicAt) return;
|
|
599
|
+
const sourceIdValue = sourceId("news", "basket_window", news.window_days, publicAt.slice(0, 10));
|
|
600
|
+
if (!registerSource(context, {
|
|
601
|
+
source_id: sourceIdValue,
|
|
602
|
+
source_kind: "news_aggregate",
|
|
603
|
+
title: `dated items for the basket's largest holdings over ${news.window_days} days`,
|
|
604
|
+
url: "https://news.google.com/rss",
|
|
605
|
+
public_at: publicAt,
|
|
606
|
+
retrieved_at: grounding.gathered_at || publicAt,
|
|
607
|
+
locator: { window_days: news.window_days, constituents_read: news.constituents_read, industry: news.industry?.id || null },
|
|
608
|
+
})) return;
|
|
609
|
+
const shared = {
|
|
610
|
+
asOf: context.asOf,
|
|
611
|
+
publicAt,
|
|
612
|
+
sources: [sourceIdValue],
|
|
613
|
+
confidence: 0.6,
|
|
614
|
+
derivation: "rederived",
|
|
615
|
+
};
|
|
616
|
+
addUnique(context.facts, context.diagnostics, baseFact({
|
|
617
|
+
...shared,
|
|
618
|
+
factId: "news.covered_weight",
|
|
619
|
+
valueKind: "ratio",
|
|
620
|
+
value: news.coverage_weight,
|
|
621
|
+
unit: "decimal",
|
|
622
|
+
ratioDenominator: `weight_of_${news.constituents_read}_largest_holdings`,
|
|
623
|
+
derivationToolId: `${ADAPTER_ID}:news:covered_weight`,
|
|
624
|
+
derivationInput: { window_days: news.window_days },
|
|
625
|
+
}));
|
|
626
|
+
addUnique(context.facts, context.diagnostics, baseFact({
|
|
627
|
+
...shared,
|
|
628
|
+
factId: "news.filing_event_weight",
|
|
629
|
+
valueKind: "ratio",
|
|
630
|
+
value: news.filing_event_weight,
|
|
631
|
+
unit: "decimal",
|
|
632
|
+
ratioDenominator: `weight_of_${news.constituents_read}_largest_holdings`,
|
|
633
|
+
derivationToolId: `${ADAPTER_ID}:news:filing_event_weight`,
|
|
634
|
+
derivationInput: { window_days: news.window_days, filers: news.filing_event_count },
|
|
635
|
+
}));
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
function crossMarketFacts(grounding, context) {
|
|
639
|
+
const rows = grounding?.cross_market;
|
|
640
|
+
const stamp = grounding?.gathered_at || context.asOf;
|
|
641
|
+
const publicAt = timestampAtOrBefore(stamp, context.cutoff);
|
|
642
|
+
if (Array.isArray(rows) && publicAt) {
|
|
643
|
+
for (const row of rows) {
|
|
644
|
+
if (!finite(row?.correlation)) continue;
|
|
645
|
+
const factId = CROSS_MARKET_FACTS[row.reference];
|
|
646
|
+
if (!factId) continue;
|
|
647
|
+
const sourceIdValue = sourceId("market", "cross_correlation", row.reference, row.to);
|
|
648
|
+
if (!registerSource(context, {
|
|
649
|
+
source_id: sourceIdValue,
|
|
650
|
+
source_kind: "market_snapshot",
|
|
651
|
+
title: `daily closes for ${row.label}`,
|
|
652
|
+
url: `https://query1.finance.yahoo.com/v8/finance/chart/${encodeURIComponent(row.reference)}?range=1y&interval=1d`,
|
|
653
|
+
public_at: publicAt,
|
|
654
|
+
retrieved_at: stamp,
|
|
655
|
+
locator: { reference: row.reference, from: row.from, to: row.to, sessions: row.sessions },
|
|
656
|
+
})) continue;
|
|
657
|
+
addUnique(context.facts, context.diagnostics, baseFact({
|
|
658
|
+
factId,
|
|
659
|
+
valueKind: "ratio",
|
|
660
|
+
value: row.correlation,
|
|
661
|
+
unit: "decimal",
|
|
662
|
+
ratioDenominator: `pearson_over_${row.sessions}_paired_sessions`,
|
|
663
|
+
asOf: context.asOf,
|
|
664
|
+
publicAt,
|
|
665
|
+
sources: [sourceIdValue],
|
|
666
|
+
confidence: 0.8,
|
|
667
|
+
derivation: "rederived",
|
|
668
|
+
derivationToolId: `${ADAPTER_ID}:cross_market:${row.reference}`,
|
|
669
|
+
derivationInput: { reference: row.reference, from: row.from, to: row.to, relative_return: row.relative_return },
|
|
670
|
+
}));
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
const dispersion = grounding?.sector_dispersion;
|
|
674
|
+
if (dispersion?.available && finite(dispersion.dispersion) && publicAt) {
|
|
675
|
+
const sourceIdValue = sourceId("market", "sector_dispersion", dispersion.to);
|
|
676
|
+
if (registerSource(context, {
|
|
677
|
+
source_id: sourceIdValue,
|
|
678
|
+
source_kind: "market_snapshot",
|
|
679
|
+
title: "Select Sector SPDR daily closes",
|
|
680
|
+
url: "https://query1.finance.yahoo.com/v8/finance/chart/XLK?range=1y&interval=1d",
|
|
681
|
+
public_at: publicAt,
|
|
682
|
+
retrieved_at: stamp,
|
|
683
|
+
locator: { sectors: dispersion.measured, from: dispersion.from, to: dispersion.to },
|
|
684
|
+
})) {
|
|
685
|
+
addUnique(context.facts, context.diagnostics, baseFact({
|
|
686
|
+
factId: "market.sector_dispersion",
|
|
687
|
+
valueKind: "ratio",
|
|
688
|
+
value: dispersion.dispersion,
|
|
689
|
+
unit: "decimal",
|
|
690
|
+
ratioDenominator: `stdev_of_${dispersion.measured}_sector_total_returns`,
|
|
691
|
+
asOf: context.asOf,
|
|
692
|
+
publicAt,
|
|
693
|
+
sources: [sourceIdValue],
|
|
694
|
+
confidence: 0.8,
|
|
695
|
+
derivation: "rederived",
|
|
696
|
+
derivationToolId: `${ADAPTER_ID}:sector_dispersion`,
|
|
697
|
+
derivationInput: { leader: dispersion.leader?.symbol, laggard: dispersion.laggard?.symbol, from: dispersion.from, to: dispersion.to },
|
|
698
|
+
}));
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
/** Reference market -> the fact id its correlation is published under. */
|
|
704
|
+
const CROSS_MARKET_FACTS = Object.freeze({
|
|
705
|
+
"^GSPC": "market.correlation_to_broad_market",
|
|
706
|
+
"^KS11": "market.correlation_to_kospi",
|
|
707
|
+
"^KQ11": "market.correlation_to_kosdaq",
|
|
708
|
+
"^SOX": "market.correlation_to_semiconductors",
|
|
709
|
+
});
|
|
710
|
+
|
|
574
711
|
function insiderOwnershipFacts(grounding, context) {
|
|
575
712
|
const owned = grounding?.insider_ownership;
|
|
576
713
|
if (!owned || !finite(owned.value)) return;
|
|
@@ -669,6 +806,8 @@ export function adaptGroundingToTypedFacts(grounding, { asOf, knowledgeAsOf = as
|
|
|
669
806
|
fundamentalFacts(grounding, context);
|
|
670
807
|
instrumentAggregateFacts(grounding, context);
|
|
671
808
|
insiderOwnershipFacts(grounding, context);
|
|
809
|
+
crossMarketFacts(grounding, context);
|
|
810
|
+
basketNewsFacts(grounding, context);
|
|
672
811
|
for (const family of ["screen", "macro", "market"]) {
|
|
673
812
|
if (grounding?.[family] && !grounding[family].public_at) {
|
|
674
813
|
if (family === "screen" && context.diagnostics.some((item) => String(item.source || "").startsWith("screen."))) continue;
|
package/mcp/lib/xbrl-series.mjs
CHANGED
|
@@ -315,8 +315,10 @@ export function buildMetric({
|
|
|
315
315
|
currency,
|
|
316
316
|
scale,
|
|
317
317
|
ratio_denominator: ratioDenominator,
|
|
318
|
-
|
|
319
|
-
|
|
318
|
+
// A metric may declare itself a point-in-time quantity, in which case the span its inputs
|
|
319
|
+
// were aligned over is not the period it covers and stating one would be wrong.
|
|
320
|
+
period_start: alignment.suppressInterval ? null : alignment.period_start,
|
|
321
|
+
period_end: alignment.suppressInterval ? null : alignment.period_end,
|
|
320
322
|
fiscal_year: Number.isInteger(alignment.fiscal_year) ? alignment.fiscal_year : null,
|
|
321
323
|
// Never the clock: the newest filing among the inputs is the moment this became knowable.
|
|
322
324
|
public_at: alignment.public_at,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "alphacouncil-agent",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Multi-agent company, ETF and market-index research workflow for Codex & Claude Code: sourced evidence, method seats, bull/bear debate and portfolio-manager synthesis.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"publishConfig": {
|
|
29
29
|
"access": "public",
|
|
30
|
-
"tag": "
|
|
30
|
+
"tag": "latest"
|
|
31
31
|
},
|
|
32
32
|
"scripts": {
|
|
33
33
|
"check": "node scripts/selfcheck.mjs",
|
|
@@ -106,7 +106,10 @@ export const CANONICAL_SOLO_TEST_FACT_CONTRACTS = Object.freeze({
|
|
|
106
106
|
"valuation.revenue_growth": Object.freeze({ value_kind: "ratio", unit: "decimal", period: duration(ANY_REPORTING_INTERVAL) }),
|
|
107
107
|
"valuation.downside_asset_value": Object.freeze({ value_kind: "monetary", unit: "currency_units", period: INSTANT_AS_OF }),
|
|
108
108
|
"valuation.downside_floor": Object.freeze({ value_kind: "monetary", unit: "currency_units", period: INSTANT_AS_OF }),
|
|
109
|
-
|
|
109
|
+
// Shares outstanding is measured AT a date, not over one. The filing reports it inside a
|
|
110
|
+
// fiscal year, which is where the interval came from, but a count is an instant quantity --
|
|
111
|
+
// and a fund's share count, which carries no fiscal year at all, could satisfy no duration.
|
|
112
|
+
"capital_allocation.share_count": Object.freeze({ value_kind: "count", unit: "shares", period: INSTANT_AS_OF }),
|
|
110
113
|
|
|
111
114
|
// Basket-level facts. Without these an index or fund method has nothing to reason about,
|
|
112
115
|
// which is why every seat abstained on an ETF regardless of how well it was written.
|
|
@@ -122,6 +125,20 @@ export const CANONICAL_SOLO_TEST_FACT_CONTRACTS = Object.freeze({
|
|
|
122
125
|
"index.breadth_counted_above_200dma": Object.freeze({ value_kind: "ratio", unit: "decimal", period: INSTANT_AS_OF }),
|
|
123
126
|
"fund.aum": Object.freeze({ value_kind: "monetary", unit: "currency_units", period: INSTANT_AS_OF }),
|
|
124
127
|
"fund.expense_ratio": Object.freeze({ value_kind: "ratio", unit: "decimal", period: INSTANT_AS_OF }),
|
|
128
|
+
// Creations minus redemptions, priced. A crowding signal, never a valuation one.
|
|
129
|
+
// What else the holding is a bet on. Correlation decides what a position actually
|
|
130
|
+
// diversifies; dispersion says whether one factor or many are repricing the market.
|
|
131
|
+
"market.correlation_to_broad_market": Object.freeze({ value_kind: "ratio", unit: "decimal", period: INSTANT_AS_OF }),
|
|
132
|
+
"market.correlation_to_kospi": Object.freeze({ value_kind: "ratio", unit: "decimal", period: INSTANT_AS_OF }),
|
|
133
|
+
"market.correlation_to_kosdaq": Object.freeze({ value_kind: "ratio", unit: "decimal", period: INSTANT_AS_OF }),
|
|
134
|
+
"market.correlation_to_semiconductors": Object.freeze({ value_kind: "ratio", unit: "decimal", period: INSTANT_AS_OF }),
|
|
135
|
+
// News as counts. The headlines never enter a computation; how much of the basket is in the
|
|
136
|
+
// news, and how much of it filed, are dated quantities an event-driven method may read.
|
|
137
|
+
"news.covered_weight": Object.freeze({ value_kind: "ratio", unit: "decimal", period: INSTANT_AS_OF }),
|
|
138
|
+
"news.filing_event_weight": Object.freeze({ value_kind: "ratio", unit: "decimal", period: INSTANT_AS_OF }),
|
|
139
|
+
"market.sector_dispersion": Object.freeze({ value_kind: "ratio", unit: "decimal", period: INSTANT_AS_OF }),
|
|
140
|
+
"fund.net_flow": Object.freeze({ value_kind: "monetary", unit: "currency_units", period: INSTANT_AS_OF }),
|
|
141
|
+
"fund.net_flow_ratio": Object.freeze({ value_kind: "ratio", unit: "decimal", period: INSTANT_AS_OF }),
|
|
125
142
|
|
|
126
143
|
// The US has no promoter shareholding record. Section 16 ownership is the filed analogue,
|
|
127
144
|
// and it is what lets a governance-first method reach a number on this universe at all.
|