Skip to content

FD-238: Open source ML auditing system in btcopilot #1

Closed
patrickkidd wants to merge 81 commits into
masterfrom
FD-238-open-source-3
Closed

FD-238: Open source ML auditing system in btcopilot #1
patrickkidd wants to merge 81 commits into
masterfrom
FD-238-open-source-3

Conversation

@patrickkidd
Copy link
Copy Markdown
Owner

No description provided.

@gitguardian
Copy link
Copy Markdown

gitguardian Bot commented Sep 23, 2025

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
21808676 Triggered Generic Password 42628dc btcopilot/pro/tasks.py View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

patrickkidd-hurin pushed a commit that referenced this pull request Mar 4, 2026
Three fixes to f1_metrics.py PairBond matching accuracy:

1. Fix parent ID resolution in match_people: Person.parents references a
   PairBond ID, but PairBond IDs are never in the id_map (only person IDs
   are). The old code fell through to comparing raw IDs which always failed.
   Now skips parent comparison when the parent ID can't be resolved, breaking
   the circular dependency between people matching and PairBond matching.

2. Add _augment_committed_id_map: resolves committed (positive) person ID
   mismatches when diagram_data has duplicate entries for the same person.

3. Add _augment_duplicate_person_id_map: when AI creates duplicate people
   (same name, different IDs), match_people only maps one (1:1). This adds
   many-to-one mappings so PairBonds referencing unmapped duplicates resolve
   correctly.

Also adds PairBond completeness checklist to DATA_FULL_EXTRACTION_CONTEXT
prompt, addressing the #1 extraction failure mode (under-extraction of
PairBonds — disc 36 had 0 bonds extracted).

Results (disc 36/37/39/48):
- PairBond F1: 0.37 → 0.52 (target ≥ 0.50)
- People F1: 0.72 → 0.79
- All 451 tests pass (308 training + 143 schema/personal)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
patrickkidd pushed a commit that referenced this pull request Mar 4, 2026
* Raise PairBond F1 from 0.37 to 0.52 via matching fixes and prompt update

Three fixes to f1_metrics.py PairBond matching accuracy:

1. Fix parent ID resolution in match_people: Person.parents references a
   PairBond ID, but PairBond IDs are never in the id_map (only person IDs
   are). The old code fell through to comparing raw IDs which always failed.
   Now skips parent comparison when the parent ID can't be resolved, breaking
   the circular dependency between people matching and PairBond matching.

2. Add _augment_committed_id_map: resolves committed (positive) person ID
   mismatches when diagram_data has duplicate entries for the same person.

3. Add _augment_duplicate_person_id_map: when AI creates duplicate people
   (same name, different IDs), match_people only maps one (1:1). This adds
   many-to-one mappings so PairBonds referencing unmapped duplicates resolve
   correctly.

Also adds PairBond completeness checklist to DATA_FULL_EXTRACTION_CONTEXT
prompt, addressing the #1 extraction failure mode (under-extraction of
PairBonds — disc 36 had 0 bonds extracted).

Results (disc 36/37/39/48):
- PairBond F1: 0.37 → 0.52 (target ≥ 0.50)
- People F1: 0.72 → 0.79
- All 451 tests pass (308 training + 143 schema/personal)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Address PR #65 review: remove PII from logs, add relationshipTriangles, improve markdown

- Remove person names from debug log messages in _augment_committed_id_map
  and _augment_duplicate_person_id_map to prevent PII leakage
- Add relationshipTriangles to committed ID collection loop (was only
  collecting relationshipTargets, missing triangle person IDs)
- Improve MVP_DASHBOARD.md table cell readability with <br/> tags

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Revert PairBond checklist from public prompts — already in fdserver

The PairBond completeness checklist is already in
fdserver/prompts/private_prompts.py, so the public btcopilot
prompts don't need it.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Hurin <hurin@openclaw.ai>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
patrickkidd pushed a commit that referenced this pull request Mar 8, 2026
- Defer production prompt loading to avoid import-time FileNotFoundError
  in Docker CI where fdserver is not co-located
- Remove dead _BASE_SARF_REVIEW variable (review comment #1)
- Extract error message to PROMPTS_UNAVAILABLE_ERROR constant shared
  between litreview.py and compare.py (review comment #2)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
patrickkidd added a commit that referenced this pull request Mar 8, 2026
- Defer production prompt loading to avoid import-time FileNotFoundError
  in Docker CI where fdserver is not co-located
- Remove dead _BASE_SARF_REVIEW variable (review comment #1)
- Extract error message to PROMPTS_UNAVAILABLE_ERROR constant shared
  between litreview.py and compare.py (review comment #2)

Co-authored-by: Hurin <hurin@openclaw.ai>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
patrickkidd added a commit that referenced this pull request May 2, 2026
- apply_local_changes: refactored to two-phase form. Local edits now
  beat server-side deletes per item-level last-write-wins (per
  docstring). Added regression test `test_local_edit_beats_server_delete`.
  (Gemini #1)

- reserve_id_block: hoisted `import PyQt5.sip` out of retry loop.
  Marked `# noqa: F401` since the import is for SIP registration
  side effects, not a name reference. (Gemini #2)

- merge_scene_collection: removed entirely. Pre-release feature with
  no production callers — deprecation was over-cautious. Deleted the
  associated test file. (Patrick review comment)

All apply_local_changes tests pass (16, incl. new regression case).
Full schema + pro suites green, no regressions.
patrickkidd added a commit that referenced this pull request May 18, 2026
#1 _remap_person_refs no longer remaps PairBond person.parents nor the
   mixed-entity deltas.delete list with a person-id-only map.
#2 _drop_committed_dup_pair_bonds remaps a dropped duplicate bond's
   child onto the surviving committed pair_bond instead of nulling it,
   preserving the parent-child link (_committed_dyads now dyad→pb-id).
#4 _windowed_conversation: empty tail keeps the cursor marker/nonce so
   the model emits nothing rather than re-extracting the full thread.

Tests updated to the new contracts; 59 personal/isolation tests pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
patrickkidd added a commit that referenced this pull request May 18, 2026
* FD-319: per-discussion re-extraction cursor + commit-pdp

Adds discussions.extracted_through_order /
pending_extracted_through_order, the _windowed_conversation cursor
windowing with an unforgeable per-call nonce marker, the
POST /personal/discussions/<id>/commit-pdp accept endpoint, the
cursor Alembic migration, and prompt-idempotency work from the
committed-duplicate induction runs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* FD-319: re-extraction cursor repairs + committed-data integrity

- Empty-PDP "Accept all" is a valid full accept and advances the cursor
  (empty item_ids allowed only with full_accept).
- fix_committed_person_duplicates iterated to a fixed point (fixes
  intermittent extraction 500 on real diagrams).
- Validator: event person/spouse/child positive refs must be committed.
- fix_unresolved_person_refs drops events/pair_bonds with unresolvable
  refs and clears orphaned parents; commit_pdp_items skips orphaned pair
  bonds; inferred bonds require resolvable people.
- child_of (parent/offspring) F1 metric + dashboard; structural-completion
  pass evaluated and rejected (logged).
- Tests: cursor + pdp/commit/isolation green.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* FD-319: address PR #119 review (pdp ref remap + empty-tail cursor)

#1 _remap_person_refs no longer remaps PairBond person.parents nor the
   mixed-entity deltas.delete list with a person-id-only map.
#2 _drop_committed_dup_pair_bonds remaps a dropped duplicate bond's
   child onto the surviving committed pair_bond instead of nulling it,
   preserving the parent-child link (_committed_dyads now dyad→pb-id).
#4 _windowed_conversation: empty tail keeps the cursor marker/nonce so
   the model emits nothing rather than re-extracting the full thread.

Tests updated to the new contracts; 59 personal/isolation tests pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Patrick Stinson <patrick@alaskafamilysystems.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant