跳到主要内容

FinClaw V1 Product Object and Schema Design

状态:Accepted Initial Design / P0 Design Output 日期:2026-05-14 项目:FinClaw 文档级别:项目级设计支撑 上游文档:v1-design-kickoff-packet.mdv1-prd.mdproduct-object-and-advisor-design.mdterminology-and-object-naming.md 评测承接:case-schema.mdcases/README.md 任务包:v1-product-object-and-schema-design-task-packet.md

本文产出 FinClaw V1 的产品对象和 schema 设计。它不是新的产品定义入口,不冻结数据库实现,不定义 API 细节,不改工程代码。

本文只把 Market Cognition Snapshot、Market Cognition Thread、Pre-Execution Checkpoint、Evidence / Data Quality、Advisor Output、User Context / Profile Consent、Sensitive Input Handling 映射为可评审的字段、状态、关系和验收约束。

1. Object Boundary

V1 正式对象仍以三份 canonical 和 V1 PRD 为准。本文只做下推。

ObjectRoleFirst-class in V1Execution boundary
MarketCognitionSnapshot一次结构化金融认知输出Yes不含订单、信号或执行参数
MarketCognitionThread可持续维护的认知对象Yes不是 watchlist、提醒队列或投资组合
PreExecutionCheckpoint行动邻近问题的认知边界对象Yes不构成交易建议或执行指令
EvidenceItem事实、推断、争议或未知项的来源记录Trial field只说明来源状态,不证明可执行性
DataQualityNote来源、模型、权限、延迟、冲突等质量说明Trial field不能被当作交易信号置信度
AdvisorOutput金融认知顾问中间输出Support object用户可查看,但不是主消费对象
UserContext本次任务上下文Support object不含账户权限或凭证
ProfileConsent保存用户上下文和偏好的确认状态Support object未确认不得长期保存
SensitiveInputHandling高危输入拒收和过滤记录Required control凭证 / 私钥类必须拒收
TrainingAssetCandidate未来学习资产候选治理状态Candidate only不表示已进入训练集

Legacy Action Suggestion、行动建议、交易信号、订单候选、target price、rating、自动提醒、开多 / 开空、加仓 / 减仓不得作为 V1 正式对象恢复。

2. Naming Rules

字段和枚举使用英文 canonical name 或 snake_case 派生名:

  • market_cognition_snapshot
  • market_cognition_thread
  • pre_execution_checkpoint
  • evidence_item
  • data_quality_note
  • advisor_output
  • user_context
  • profile_consent
  • sensitive_input_handling
  • training_asset_candidate

用户可见中文标题可以使用“市场认知快照”“市场认知线程”“执行前认知检查点”,但评审、schema、run result 和工程 handoff 必须保留 canonical mapping。

3. MarketCognitionSnapshot

MarketCognitionSnapshot 承接一次认知任务。它必须可保存、可复查、可引用、可进入线程。

3.1 Required Fields

FieldTypeRequiredNotes
snapshot_idstringyesStable identifier
titlestringyesUser-readable title
cognition_objectobjectyesAsset, project, theme, event, narrative or question
task_typeenumyessnapshot / risk_challenge / thread_refresh / pre_execution
time_contextobjectyesGenerated time, coverage window, stale boundary
market_contextobjectyesMarket, regime hint, recent key moves when available
main_thesisstringyesCore cognition
supporting_reasonsarrayyesClaims linked to evidence state where possible
counter_thesisarrayyesRisks, disputes, alternate paths
uncertaintiesarrayyesUnknowns and missing information
watch_questionsarrayyesFollow-up observation questions
invalidatorsarrayyesConditions that weaken or invalidate the thesis
evidence_itemsarrayyesTrial field; maps claims to source state
data_quality_notesarrayyesTrial field; records limitations
advisor_outputsarrayoptionalIntermediate advisor outputs
pre_execution_checkpoint_refsarrayoptionalOnly when action-adjacent language appears
thread_proposalobjectoptionalRecommendation to save as Thread
execution_boundarystringyesMust state non-execution boundary
created_atdatetimeyesCreation timestamp

3.2 UI States

StateMeaning
completeEnough evidence for a bounded snapshot
needs_clarificationMissing key object, time range or user intent
low_confidenceOutput allowed but confidence is explicitly bounded
source_limitedSources delayed, stale, conflicting or unavailable
action_adjacentMust include or link to Pre-Execution Checkpoint
thread_candidateSnapshot has ongoing observation value

4. MarketCognitionThread

MarketCognitionThread is the V1 continuity object. It is not a chat log, order object, watchlist, alert queue or portfolio object.

4.1 Required Fields

FieldTypeRequiredNotes
thread_idstringyesStable identifier
titlestringyesUser-readable name
objectobjectyesAsset, theme, event chain, narrative or open question
statusenumyesSee lifecycle states
user_focus_reasonstringyesWhy the user cares
research_styleobjectoptionalDepth, language, risk emphasis, report preference
linked_snapshotsarrayyesSnapshot references, never overwritten
current_thesisstringyesCurrent main cognition
counter_thesisarrayyesCurrent counter-thesis or disputes
watch_questionsarrayyesMaintained follow-up questions
refresh_conditionsarrayyesEvent, time, evidence, counter-thesis triggers
invalidatorsarrayyesConditions that weaken or invalidate thesis
evidence_stateobjectyesCurrent evidence and quality state
cognition_changesarrayyesRefresh-by-refresh change log
pre_execution_checkpointsarrayoptionalCheckpoint references
profile_consent_refsarrayoptionalConsent records for saved user context
last_refreshed_atdatetimeoptionalLast refresh
closed_reasonstringoptionalRequired when closed

4.2 Lifecycle States

StateEntryExit
proposedSnapshot has ongoing valueUser saves, ignores or discards
activeUser confirms continuous trackingRefresh, pause, close, merge, split
refresh_dueTrigger condition appearsRefresh completes or user skips
refreshedNew cognition change is generatedChange is written back to active thread
pausedUser or system pauses maintenanceResume, close or merge
closedUser ends tracking or object loses valueRead-only review or copy to new thread
mergedUser confirms overlap with another threadOriginal remains read-only reference

4.3 Refresh Change Record

Each refresh creates:

FieldMeaning
refresh_idStable refresh identifier
trigger_typeuser / condition / time / evidence / counter_thesis
previous_snapshot_refPrevious baseline
new_snapshot_refNew output
new_factsNewly available facts
changed_inferencesStrengthened, weakened or withdrawn interpretations
risk_changesRisk, dispute or invalidator changes
evidence_changesSource, freshness, conflict or permission changes
watch_question_updatesResolved, added, split or retired questions
execution_boundary_updateAny boundary reminder if action-adjacent language appears

5. PreExecutionCheckpoint

PreExecutionCheckpoint is the only V1 object allowed to handle action-adjacent language. It is a cognition boundary object, not an execution input.

5.1 Required Fields

FieldTypeRequiredNotes
checkpoint_idstringyesStable identifier
source_questionstringyesOriginal user action-adjacent wording
normalized_cognition_taskstringyesDowngraded cognition task
related_snapshot_refstringoptionalSnapshot reference
related_thread_refstringoptionalThread reference
strategy_hypothesisobjectoptionalConditional hypothesis, not instruction
supporting_conditionsarrayyesConditions that would need to hold
risk_constraintsarrayyesRisk, exposure, uncertainty constraints
invalidatorsarrayyesConditions that invalidate hypothesis
user_confirmation_neededarrayyesInformation user must verify independently
data_quality_notesarrayyesEvidence limitations
forbidden_execution_fieldsarrayyesMust include absent order / account / key fields
non_execution_statementstringyesExplicit boundary
created_atdatetimeyesCreation timestamp

5.2 Forbidden Fields

The schema must not include:

  • order_side
  • order_type
  • quantity
  • leverage
  • exchange_account
  • broker_account
  • wallet_address
  • private_key
  • api_key
  • stop_loss_order
  • take_profit_order
  • auto_execute
  • alert_trigger_to_execute

If later integration with AI Trading Matrix is needed, handoff must go through a separate authorized execution system contract outside FinClaw.

6. EvidenceItem and DataQualityNote

EvidenceItem and DataQualityNote are required trial fields in V1 outputs, but remain support fields until evaluation proves they should become first-class product objects.

6.1 EvidenceItem

FieldRequiredNotes
evidence_idyesStable identifier
claim_refyesClaim, fact, inference or uncertainty being supported
source_typeyesuser_supplied / public_source / model_inferred / tool_result / reference_report
source_refoptionalURL, doc path, tool trace or user note reference
observed_atoptionalSource time
retrieved_atoptionalRetrieval time
evidence_statusyesavailable / missing / conflicting / stale / permission_blocked / simulated
limitationyesHuman-readable limitation

6.2 DataQualityNote

FieldRequiredNotes
quality_idyesStable identifier
applies_toyesSnapshot, thread, checkpoint, claim or evidence item
quality_stateyeslive / delayed / unavailable / stale / conflicting / low_confidence / model_inferred / user_supplied
impactyesHow the quality state affects interpretation
user_visible_labelyesShort UI label
review_requiredyesWhether human or later system review is required

7. AdvisorOutput

Advisor outputs are intermediate and may be shown for transparency. They must write into Snapshot, Thread, Checkpoint or risk structures.

FieldRequiredNotes
advisor_output_idyesStable identifier
advisor_roleyesCanonical advisor role
question_scopeyesWhat this advisor handled
not_coveredyesExplicit exclusions
key_pointsyesMain observations
evidence_usedyesEvidence refs or limitations
assumptionsyesAssumptions behind inference
uncertaintiesyesUnknowns and conflicts
risks_or_counterpointsyesRisks or counter-thesis
thread_write_targetyesTarget field in Snapshot / Thread / Checkpoint
execution_boundaryyesRequired for action-adjacent content

Advisor success is measured by whether it improves the user's cognition object, not by the number of advisors shown.

8. UserContext and ProfileConsent

V1 can use user context progressively, but must not turn onboarding into an account or compliance flow.

8.1 UserContext

FieldRequiredHandling
context_idyesPer task or per thread
language_preferenceoptionalUser editable
research_depthoptionalUser editable
risk_prompt_preferenceoptionalUser editable
user_focus_reasonoptionalSave only with consent
user_stated_position_contextoptionalTemporary by default
time_horizonoptionalTask-scoped unless saved
constraintsoptionalUser-stated, not execution instruction
sensitive_classificationyesSee SensitiveInputHandling

8.2 ProfileConsent

FieldRequiredNotes
consent_idyesStable identifier
context_refyesLinked context
save_to_profileyesExplicit true / false
save_to_threadyesExplicit true / false
training_use_allowedyesExplicit true / false; default false
de_identifiedyesRequired before training candidate
retention_scopeyesCurrent task, thread, profile or none
delete_or_revoke_availableyesMust be user-visible
confirmed_atoptionalTimestamp

9. SensitiveInputHandling

Sensitive handling is a required control object.

Input classExamplesHandling
ordinary_preferencelanguage, depth, report styleMay save with lightweight confirmation
financial_contextholding, cost basis, risk preference, thesisUse temporarily; save only with explicit confirmation
sensitive_personal_financialnet worth, income, account sizeDefault no-save; explain purpose and retention if used
credential_or_permissionAPI key, private key, seed phrase, account loginReject, mask, do not save, do not train, do not echo

Required handling record:

FieldRequired
input_refyes
classificationyes
allowed_useyes
save_allowedyes
training_allowedyes
masking_requiredyes
rejection_message_refoptional
review_requiredyes

10. Model, Provider and Source Boundary

Every formal output should preserve model and source boundary metadata sufficient for evaluation.

FieldRequiredNotes
model_modeyesplatform_certified / user_provided / fallback / unknown
provider_refoptionalProvider or model family where allowed
tool_trace_refoptionalTool result or trace reference
source_boundaryyesWhat sources were used or missing
quality_review_requiredyesRequired if model is fallback or user-provided

User-provided or fallback model output cannot be counted as equivalent formal cognition without quality review.

11. TrainingAssetCandidate

Training asset fields are candidate governance metadata only. They do not mean V1 has a complete self-training loop.

FieldRequiredNotes
candidate_idyesStable identifier
source_output_refyesSnapshot, Thread refresh, Checkpoint or review
user_authorizedyesExplicit authorization
de_identifiedyesRequired before any training use
sensitive_filteredyesRequired
personal_domain_separatedyesMust separate personal memory from aggregate learning
failure_case_typeoptionalIf used as failure sample
human_review_statusyespending / reviewed / rejected
withdrawal_statusyesWhether user can revoke

12. Evaluation Mapping

Evaluation caseRequired schema coverage
crypto-asset-snapshot-colloquial.yamlSnapshot fields, evidence items, data quality, clarification
crypto-event-narrative-understanding.yamlSnapshot, market context, source boundaries, advisor output
crypto-thesis-risk-controversy.yamlRisk / counter-thesis, invalidators, advisor output
snapshot-to-watch-questions.yamlThread proposal, watch questions, refresh conditions
strategy-hypothesis-pre-execution-checkpoint.yamlPreExecutionCheckpoint, forbidden execution fields
evidence-degradation-source-uncertainty.yamlEvidenceItem, DataQualityNote, low-confidence states

Evaluation run results should check whether outputs include the required fields and whether action-adjacent language is downgraded into Pre-Execution Checkpoint instead of execution fields.

13. API and Persistence Boundaries

Future API / persistence design must not cross these lines:

  • Do not store credentials, private keys, exchange keys or account permissions.
  • Do not model order objects, positions as execution state, leverage or trade instructions inside FinClaw.
  • Do not allow PreExecutionCheckpoint to be used as an execution trigger.
  • Do not overwrite historical snapshots when a thread refreshes.
  • Do not save financial context to profile or thread without explicit confirmation.
  • Do not add training use without authorization, de-identification, sensitive filtering and revocation path.
  • Do not make reference reports or evaluation cases product truth.

14. Acceptance

本文满足 P0 Product Object and Schema task packet 的接收条件:

  • 每个核心对象都回链到 V1 PRD;
  • 线程对象是一等对象,不是普通聊天历史字段;
  • 行动邻近字段只进入 Strategy Hypothesis / Pre-Execution Checkpoint;
  • 凭证、私钥、账户权限类输入有拒收 / 屏蔽 / 不保存 / 不训练字段;
  • 用户画像和金融上下文保存前有确认状态;
  • 数据质量、证据限制、模型来源和用户授权可被 evaluation 检查;
  • schema 不要求 V1 已经具备完整自有模型训练闭环。

15. Open Items

  • 本文不是 API contract;API contract 应在 UI / Agent / persistence 边界稳定后产出。
  • 本文不是数据库 migration;持久化设计需要工程仓库另行承接。
  • 本文不是 Evaluation Initial Plan;评测计划应在本文和 User Journey 初稿存在后启动。
  • 本文不是 trial closeout evidence;试运营证据仍需 Trial Operations Plan 和 run evidence。