A Loom process package for allocator-level portfolio construction under explicit investor constraints, including optional external household exposures (for example private real estate) so recommendations optimize total balance-sheet risk, not just the liquid sleeve.
This process runs a strict 9-phase workflow:
- Intake Normalization
- Total Balance-Sheet Exposure Model
- Macro and Sentiment Regime
- Universe and Candidate Construction
- Expected Return Risk Model
- Opportunity Ranking
- Portfolio Construction
- Stress Testing and Hedge Validation
- Recommendation and Monitoring
It is designed to produce:
- target weights and dollar allocations that reconcile exactly to input capital
- objective-aware construction logic (return target, preservation, or hedge)
- explicit stress-test coverage with mitigation actions
- thesis-break triggers and monitoring alert rules for ongoing governance
The process supports both numeric and natural-language objectives:
- numeric:
target_return_annual,max_drawdown - mandate-style: "protect capital in turmoil", "hedge my real-estate exposure"
Objective type is normalized into one of:
return_targetcapital_preservationincomebalancedtotal_portfolio_hedge
Run with natural language only:
/run Design a portfolio for $600k targeting 9% annualized return with max 15% drawdown.
Provide files in the workspace:
portfolio-brief.yamlorportfolio-brief.json- optional
external-holdings.csv - optional
constraints.json
The process normalizes inputs into portfolio-intake.normalized.json.
This package uses Loom finance and planning tools, including:
- market and fundamentals:
market_data_api,symbol_universe_api,sec_fundamentals_api - regime and factor tools:
macro_regime_engine,sentiment_feeds_api,factor_exposure_engine - construction and validation:
opportunity_ranker,portfolio_optimizer,portfolio_evaluator,portfolio_recommender,valuation_engine - macro helpers:
economic_data_api,historical_currency_normalizer,inflation_calculator - artifact generation:
spreadsheet,calculator,document_write,read_file,write_file,search_files
This package currently ships no bundled tools/ Python code. Workspace mutation
behavior is therefore driven by built-in Loom tools in tools.required.
Workspace-writing tools in this package's required set:
- direct path writers:
document_write,write_file,spreadsheet(write operations only) - output-path writers:
fact_checker,market_data_api,symbol_universe_api,sec_fundamentals_api,sentiment_feeds_api,macro_regime_engine,factor_exposure_engine,valuation_engine,opportunity_ranker,portfolio_optimizer,portfolio_evaluator,portfolio_recommender,economic_data_api,historical_currency_normalizer,inflation_calculator
Non-mutating required tools: read_file, search_files, calculator.
edit_file, move_file, and delete_file remain excluded to preserve existing
process behavior.
If you add package-local tools under tools/, ensure every workspace writer:
- Sets
is_mutating = True. - Returns accurate workspace-relative
files_changedfor every successful write/move/delete. - Declares
mutation_target_arg_keyswhen write targets are not plainpath(for exampleoutput_path,destination,output_json_path). - Uses
ctx.workspace+_resolve_path(...)so policy targeting is normalized and safe. - Is validated against sealed-artifact flow:
- preflight blocks sealed+verified targets without post-seal confirmation evidence
- same mutation passes once valid post-seal confirmation evidence exists
- Confirms reseal/provenance behavior is tool-agnostic (no hardcoded tool-name assumptions).
- Treats
execution.sealed_artifact_post_call_guard = off|warn|enforceas defense-in-depth only (offdefault for package rollout).
Expected sealed-artifact runtime events to monitor:
sealed_policy_preflight_blockedsealed_reseal_appliedsealed_unexpected_mutation_detected
Install from GitHub:
loom install https://github.com/sfw/portfolio-design
# or
loom install sfw/portfolio-designInstall from local path:
loom install /path/to/portfolio-designInteractive:
loom -w /path/to/workspace --process portfolio-designThen run:
/run Protect $500000 in market turmoil; I also own $1.2M Bay Area private real estate and want to hedge total exposure.
Non-interactive:
loom run "Design a portfolio for $600k targeting 9% annualized return with max 15% drawdown." \
--workspace /path/to/workspace \
--process portfolio-designSee examples/portfolio-brief.template.yaml and related files:
examples/portfolio-brief.return-target.yamlexamples/portfolio-brief.external-hedge.yamlexamples/external-holdings.template.csvexamples/constraints.template.json
| Phase | Key files |
|---|---|
| Intake Normalization | portfolio-intake.normalized.json, intake-notes.md |
| Exposure Model | external-exposure-model.csv, total-portfolio-baseline-risk.md |
| Regime | macro-regime.md, headwind-tailwind-scorecard.csv, sentiment-scorecard.csv |
| Candidate Construction | candidate-universe.csv, candidate-rationales.md |
| Return/Risk Model | expected-returns.csv, covariance-matrix.csv, factor-exposure-matrix.csv, assumptions-register.md |
| Ranking | opportunity-rankings.csv, thesis-breakers.csv |
| Construction | target-portfolio-weights.csv, dollar-allocation-plan.csv, rebalancing-trade-list.csv |
| Stress and Hedge Validation | stress-test-results.csv, hedge-effectiveness.md, total-portfolio-outcomes.csv |
| Final Recommendation | portfolio-recommendation.md, monitoring-alert-rules.csv, rebalance-policy.md, source-index.csv |
The package enforces:
- allocation math integrity and capital reconciliation
- explicit process-level validity contract floors with claim extraction and strict support thresholds
- temporal consistency gates for synthesis outputs (as-of alignment, cross-claim date conflict checks, source staleness limits)
- objective-specific alignment checks
- required hedge effectiveness analysis when external exposures exist
- required scenario coverage (equity selloff, recession, inflation spike, rate shock, plus real-estate downturn when relevant)
- assumption transparency and thesis-break coverage
- monitoring rule completeness (metric, threshold, action, cadence)
- placeholder blocking (
[TBD],[TODO],[INSERT],[PLACEHOLDER])
Run deterministic package tests:
loom process test .Run a single deterministic case:
loom process test . --case smoke-total-portfolio-hedgeRun live canary:
loom process test . --live