Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,8 @@ Confirmed-outcome feedback reinforcementは、同じ candidate class の `confir

Soft-start feedback reinforcementは、`soft_start_feedback_reinforcement=True`、`soft_start_feedback_ratio`、`confirmation_decay_ratio` を明示する別の default-off candidate です。credited relation edge の最初の新規 `used` は通常 bounded update の一部だけを provisional に適用し、最初の独立 `confirmed` が残りを補完します。後続 confirmation は既存 geometric decay に従い、same-source sibling normalization は `used` ではなく各 confirmation の actual delta だけへ適用します。confirmed-only candidate、hard quorum と同時には有効化できず、既存 q1/s0、q3/s1、confirmed-only、凍結評価 artifact と default fingerprint は変更しません。詳細は[Confirmed-outcome feedback reinforcement](docs/confirmed-outcome-feedback-reinforcement.md#soft-start-successor-candidate)を参照してください。

Outcome-driven feedback deactivationは、soft-startへ `outcome_driven_feedback_deactivation=True` を追加した時だけ有効になるdefault-off candidateです。保存済みtrace / credited pathへ帰属できる`corrected`と`rolled_back`は、credited加算と同じcontributionのsame-source sibling normalizationを一体で正確に戻します。`superseded`はedgeと証拠を削除せずdormantにし、同じ保存済みpathの後続`confirmed`で再活性化します。lexical、zero-hop、別source、uncredited failure、基礎weight以下へのpunitive updateは変更しません。mechanicsとresult-free snapshot protocolだけを先にfreezeし、観測はmerge後のsuccessor Issueへ分離します。詳細は[Outcome-driven feedback deactivation](docs/outcome-driven-feedback-deactivation.md)を参照してください。

local database上の比較は、[Soft-start snapshot evaluation](docs/soft-start-snapshot-evaluation.md)でtransaction-consistent private snapshot、固定4 arm、result-free manifest、one-time development、conditional holdout、privacy / mutation / rank hard gateとして分離しています。評価はsnapshotのfresh cloneだけを変更し、source database、live config、snapshot本体、private本文をpublic artifactへ含めません。支持結果も固定local snapshot上のcutover候補に限定し、このissue内でconfigやdefaultを変更しません。

v1 developmentはsnapshot既存evidenceによりq3/s1がfresh `used_2`で発火し、空baseline由来の`used_3`を固定したboundary gateだけが不合格となりました。この不支持resultを変更せず、[Baseline-aware soft-start snapshot evaluation](docs/baseline-aware-soft-start-snapshot-evaluation.md)はfresh snapshotと別caseを使い、initial evidence stateからq3 first mutationを導出します。baseline不一致やcapacity不足ではregistered resultを作りません。v2はregistered output不在のfreeze-only PRとして固定し、squash merge後の別Issueでdevelopmentを一度だけ実行して、全gate通過時だけholdoutを一度開きます。
Expand Down
1 change: 1 addition & 0 deletions docs/Decision-Structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
| [ceiling-aware-feedback-adaptation-gate](https://github.com/Liplus-Project/neuron-graph-rag/wiki/ceiling-aware-feedback-adaptation-gate) | active | 新規 feedback-adaptation experiment は baseline relation MRR が 1.0 未満なら strict improvement、1.0 なら全 safety gate を満たす non-regression を要求する。ceiling pass は default や一般化を意味しない。 |
| [evidence-gated-local-feedback-reinforcement](https://github.com/Liplus-Project/neuron-graph-rag/wiki/evidence-gated-local-feedback-reinforcement) | active | relation edge ごとの独立 success trace が固定 quorum に達するまで serving weight を変えず、到達後は既存 bounded reinforcement と same-source sibling normalization を一回ずつ適用する。candidate は default-preserving であり、採用値と一般化を主張しない。 |
| [confirmed-outcome-feedback-reinforcement](https://github.com/Liplus-Project/neuron-graph-rag/wiki/confirmed-outcome-feedback-reinforcement) | superseded | confirmed-only candidate の mechanics と証拠は保持するが、利用直後の小さな適応を残す [soft-start-feedback-reinforcement](https://github.com/Liplus-Project/neuron-graph-rag/wiki/soft-start-feedback-reinforcement) が後続比較の現在候補としてこの判断を supersede する。 |
| [outcome-driven-feedback-deactivation](https://github.com/Liplus-Project/neuron-graph-rag/wiki/outcome-driven-feedback-deactivation) | evaluating | 因果帰属できるnegative outcomeだけがsoft-start contributionと同一単位のsibling normalizationを正確に戻し、superseded edgeは削除せずdormant / reactivationで扱う。mechanicsとresult-free freezeを先に固定し、観測と採用判断はsuccessor Issueへ分離する。 |
| [frozen-output-round-trip-integrity](https://github.com/Liplus-Project/neuron-graph-rag/wiki/frozen-output-round-trip-integrity) | active | result-free evaluation は canonical gate ID array を唯一の順序正本とし、freeze 前に登録外 placeholder と temporary output で実 writer から実 verifier への非アルファベット順 round-trip を証明する。observed result は exclusive creation し、array の完全性、順序、重複なし、全 gate pass を検証する。 |
| [longitudinal-feedback-adaptation](https://github.com/Liplus-Project/neuron-graph-rag/wiki/longitudinal-feedback-adaptation) | active | longitudinal feedback-adaptation は、repository-native controlled corpus v3 の相互に独立した cluster と、その source 文書に明記した 0、1、3、10 credit ceiling を用いる。corpus phase は query、gold、schedule、runner、gate、manifest、result、既定値を定義・変更しない。 |
| [single-corpus-real-feedback-validation](https://github.com/Liplus-Project/neuron-graph-rag/wiki/single-corpus-real-feedback-validation) | superseded | [repository-native-controlled-corpus](https://github.com/Liplus-Project/neuron-graph-rag/wiki/repository-native-controlled-corpus) がこの node を supersede する。以後の evaluation は、NGR repository に公開する固定 SHA の controlled corpus を source とし、D1 single-corpus experiment は capacity が増えるまで waiting とする。 |
Expand Down
29 changes: 24 additions & 5 deletions docs/optional-mcp-interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

- MCP SDK が NGR core の必須依存である
- 認証方式、transport、公開 endpoint、remote deployment が決定済みである
- delayed outcome が現在の edge weight を自動的に減算または巻き戻す
- delayed outcome が既定 policy で現在の edge weight を自動的に減算または巻き戻す

`src/neuron_graph_rag_mcp/` の optional adapter がこの契約を local stdio transport で実装する。`pip install -e '.[mcp]'` で追加依存を導入し、`neuron-graph-rag-mcp --database <path>` で起動する。NGR core は引き続き Python 標準ライブラリだけで動作する。

Expand Down Expand Up @@ -52,6 +52,19 @@ neuron-graph-rag-mcp \

soft-start ratio と confirmation decay は有限の `0 < value < 1` とし、confirmed-only flag、hard evidence quorum と同時には有効化できない。MCP `search` は relation trace と active soft-start field を含む effective-config provenance を返す。最初の新規 `used` は通常 bounded update の provisional fraction を core と同じ receipt 形で返し、最初の独立 `confirmed` は残り、後続 confirmation は geometric decay を返す。`used` は sibling を変更せず、confirmation の actual delta だけが sibling normalization の対象になる。詳細は [Confirmed-outcome feedback reinforcement の soft-start 節](confirmed-outcome-feedback-reinforcement.md#soft-start-successor-candidate) を正本とする。

outcome-driven deactivation candidate は上のsoft-start三値に次のflagを追加したprocessだけで有効になる。

```bash
neuron-graph-rag-mcp \
--database /absolute/path/to/knowledge.db \
--soft-start-feedback-reinforcement \
--soft-start-feedback-ratio 0.25 \
--confirmation-decay-ratio 0.5 \
--outcome-driven-feedback-deactivation
```

帰属可能な`corrected` / `rolled_back`はcredited deltaと同一contributionのsibling normalization deltaを一体で逆適用し、`superseded`はedgeをdormantにする。後続`confirmed`は保存済みpathを再活性化する。MCP receiptは`deactivation_applied`、`reversed_contributions`、`dormancy_changes`、`reactivated_edges`をcoreと同じ形で返す。既定時のaudit-only動作とdescriptionは変更しない。詳細は[Outcome-driven feedback deactivation](outcome-driven-feedback-deactivation.md)を正本とする。

## 2. Protocol envelope

tool 名は `search`、`record_source_use`、`record_outcome` とする。すべての input と成功 output は JSON Schema で宣言し、未知 field を受け付けない。
Expand Down Expand Up @@ -366,7 +379,7 @@ core domain API は取得済みでない node を stage 更新前に拒否し、

### 7.1 Meaning

source を利用した判断や artifact に後から判明した結果を、即時 source-use とは別軸で記録する。既定 policy では評価用の履歴であり、edge weight を変更しない。明示 confirmed-only candidate では `confirmed` だけが保存済み relation credited path の diminishing reinforcement を発火できる。soft-start candidate では最初の `confirmed` が通常 update の残り、後続 `confirmed` が geometric decay を発火できる。
source を利用した判断や artifact に後から判明した結果を、即時 source-use とは別軸で記録する。既定 policy では評価用の履歴であり、edge weight を変更しない。明示 confirmed-only candidate では `confirmed` だけが保存済み relation credited path の diminishing reinforcement を発火できる。soft-start candidate では最初の `confirmed` が通常 update の残り、後続 `confirmed` が geometric decay を発火できる。outcome-driven deactivation candidateでは、帰属可能なnegative outcomeだけが保存済みcontributionを可逆に不活性化できる。

### 7.2 Normative model-facing description

Expand All @@ -376,6 +389,12 @@ source を利用した判断や artifact に後から判明した結果を、即
Record a delayed outcome for sources that were already marked used, such as confirmed, corrected, rolled_back, or superseded. In v1, delayed outcomes are audit and evaluation records only: they do not add, subtract, undo, or otherwise change graph weights. Do not use this tool instead of record_source_use for immediate source-use feedback. If the trace handle has expired or does not exist, this tool returns unknown_trace.
```

outcome-driven deactivation candidateを明示したprocessは、代わりに次をexact `description`とする。

```text
Record a delayed outcome for sources already marked used. This server uses the outcome-driven deactivation candidate: confirmed follows the soft-start schedule; causally attributed corrected and rolled_back outcomes exactly reverse each active credited contribution together with its same-source sibling normalization mutations. Superseded makes the saved relation path dormant without deleting evidence, and a later confirmed outcome on that saved path reactivates it. Unattributed, duplicate, lexical, and zero-hop outcomes remain non-mutating.
```

### 7.3 Outcome enum

| outcome | 意味 |
Expand All @@ -385,7 +404,7 @@ Record a delayed outcome for sources that were already marked used, such as conf
| `rolled_back` | 判断または artifact が撤回、revert、rollback された |
| `superseded` | 誤りと断定せず、新しい前提または判断に置き換えられた |

`corrected` と `rolled_back` を即時の負の reinforcement に変換しない。query、index、source selection、source 自体、実装のどこに原因があるかを一件の outcome だけで判別できないためである。既定 policy の `confirmed` も `used` の reinforcement を重複加算しない。soft-start の `confirmed` は provisional と合算して通常 update 一回を超えない remainder だけを最初に加算する。
既定 policy では`corrected` と `rolled_back` を即時の負の reinforcement に変換しない。query、index、source selection、source 自体、実装のどこに原因があるかを一件の outcome だけで判別できないためである。明示deactivation candidateだけが保存済みtrace / credited pathへ帰属できるsoft-start contributionをexact reversalする。既定 policy の `confirmed` も `used` の reinforcement を重複加算しない。soft-start の `confirmed` は provisional と合算して通常 update 一回を超えない remainder だけを最初に加算する。

### 7.4 Input

Expand Down Expand Up @@ -430,11 +449,11 @@ Record a delayed outcome for sources that were already marked used, such as conf
}
```

既定 policy の `reinforcement_applied` は常に `false` とする。confirmed-only と soft-start candidate では新しい独立 edge confirmation を保存した時だけ `true` とし、`confirmations` に count、multiplier、actual delta、old/new weight、`credited_paths` に保存済み relation steps、`normalized_sibling_edges` に局所変更を返す。duplicate trace と idempotency replay は count と weight を重複変更しない。`corrected`、`rolled_back`、`superseded` は candidate 有効時も `false` のままである
既定 policy の `reinforcement_applied` は常に `false` とする。confirmed-only と soft-start candidate では新しい独立 edge confirmation を保存した時だけ `true` とし、`confirmations` に count、multiplier、actual delta、old/new weight、`credited_paths` に保存済み relation steps、`normalized_sibling_edges` に局所変更を返す。duplicate trace と idempotency replay は count と weight を重複変更しない。negative outcomeでは`reinforcement_applied`を`false`のまま保ち、明示deactivation candidateの変更有無は`deactivation_applied`、exact inverseは`reversed_contributions[].mutations`、dormancy遷移は`dormancy_changes`、再活性化は`reactivated_edges`に返す

### 7.6 Core mapping

transport-neutral な `FeedbackLedger.record_outcome` は既定 policy では outcome ledger にだけ保存する。confirmed-only と soft-start candidate では `record_success` を再利用せず、outcome、confirmation count、edge/sibling update、receipt を candidate 専用の一つの storage transaction へ渡す。
transport-neutral な `FeedbackLedger.record_outcome` は既定 policy では outcome ledger にだけ保存する。confirmed-only と soft-start candidate では `record_success` を再利用せず、outcome、confirmation count、edge/sibling update、receipt を candidate 専用の一つの storage transaction へ渡す。deactivation candidateもoutcome、credited/sibling inverse、contribution state、dormancy、receiptを一つのtransactionへ渡す。

## 8. Failure contract

Expand Down
Loading