Skip to content

feat(insights): define time-confidence provenance contract - #2786

Merged
Sinity merged 6 commits into
masterfrom
feature/fanout/temporal-provenance
Jul 12, 2026
Merged

Sinity merged 6 commits into
masterfrom
feature/fanout/temporal-provenance

Conversation

@Sinity

@Sinity Sinity commented Jul 12, 2026 •

Copy link
Copy Markdown
Owner

Summary\n\nDefine a consumer-visible contract and propagate it through direct insight record adapters and aggregate provenance: , , or .\n\n## Problem\n\nTemporal-source provenance reached insight records, but consumers lacked a single rule for showing whether event time was recorded, inferred, or unavailable. Materialization and fallback times must not masquerade as event time.\n\n## Solution\n\n- Define the shared contract and source projection.\n- Reduce aggregate confidence through the existing weakest-source lattice, including absent or legacy source tags.\n- Add , its source, and to public insight provenance.\n- Preserve those fields in direct profile, work-event, phase, thread, inference, and enrichment adapters.\n- Render materialization/fallback/unknown source tags as ; never fabricate event time.\n\n## Acceptance criteria\n\n- Satisfied: documented consumer contract and a total signal for timeless rows.\n- Satisfied: direct record adapters and aggregate provenance use weakest-source propagation; absent and legacy tags degrade to .\n- Deferred to : the storage-owned ArchiveStore projection must forward the already-stored high-water-mark source into API/CLI/MCP archive reads. It currently defaults to , which is safe but prevents recorded/estimated values from reaching those live surfaces. This PR does not modify , per lane ownership.\n- Satisfied: the real library profile-record route preserves for a timeless row.\n- Satisfied: a timeline work event with renders , resolving the Shape-B false-freshness caveat without inventing event time.\n\n## Verification\n\n- — 50 passed.\n- — 131 passed.\n- render cli-reference: sync OK: docs/cli-reference.md

render cli-output-schemas: sync OK: docs/schemas/cli-output
render openapi: sync OK: docs/openapi/search.yaml
render devtools-reference: sync OK: docs/devtools.md
render demo-corpus-datasheet: sync OK
render quality-reference: sync OK: docs/test-quality-workflows.md
render product-workflows: sync OK
render docs-surface: sync OK
OK: site sources render and generated local links resolve. — generated surfaces in sync.\n- Pre-push {
"timestamp": "2026-07-12T22:54:43.892281+00:00",
"git_head": "445811aae4ea00ac4438763dd28892a9d57d40fe",
"tier": "quick",
"run_id": "20260712T222556Z-quick-1495891-a945ab1c",
"artifact_dir": ".cache/verify/runs/20260712T222556Z-quick-1495891-a945ab1c",
"steps": [
{
"name": "ruff format",
"duration_s": 0.06,
"exit": 0,
"run_id": "20260712T222556Z-quick-1495891-a945ab1c",
"artifact_dir": ".cache/verify/runs/20260712T222556Z-quick-1495891-a945ab1c/steps/01-ruff-format"
},
{
"name": "ruff check",
"duration_s": 0.02,
"exit": 0,
"run_id": "20260712T222556Z-quick-1495891-a945ab1c",
"artifact_dir": ".cache/verify/runs/20260712T222556Z-quick-1495891-a945ab1c/steps/02-ruff-check"
},
{
"name": "mypy",
"duration_s": 4.2,
"exit": 0,
"run_id": "20260712T222556Z-quick-1495891-a945ab1c",
"artifact_dir": ".cache/verify/runs/20260712T222556Z-quick-1495891-a945ab1c/steps/03-mypy"
},
{
"name": "render all",
"duration_s": 1663.83,
"exit": 0,
"run_id": "20260712T222556Z-quick-1495891-a945ab1c",
"artifact_dir": ".cache/verify/runs/20260712T222556Z-quick-1495891-a945ab1c/steps/04-render-all"
},
{
"name": "verify topology",
"duration_s": 0.91,
"exit": 0,
"run_id": "20260712T222556Z-quick-1495891-a945ab1c",
"artifact_dir": ".cache/verify/runs/20260712T222556Z-quick-1495891-a945ab1c/steps/05-verify-topology"
},
{
"name": "verify layering",
"duration_s": 16.25,
"exit": 0,
"run_id": "20260712T222556Z-quick-1495891-a945ab1c",
"artifact_dir": ".cache/verify/runs/20260712T222556Z-quick-1495891-a945ab1c/steps/06-verify-layering"
},
{
"name": "verify closure-matrix",
"duration_s": 0.68,
"exit": 0,
"run_id": "20260712T222556Z-quick-1495891-a945ab1c",
"artifact_dir": ".cache/verify/runs/20260712T222556Z-quick-1495891-a945ab1c/steps/07-verify-closure-matrix"
},
{
"name": "lab schema roundtrip",
"duration_s": 3.55,
"exit": 0,
"run_id": "20260712T222556Z-quick-1495891-a945ab1c",
"artifact_dir": ".cache/verify/runs/20260712T222556Z-quick-1495891-a945ab1c/steps/08-lab-schema-roundtrip"
},
{
"name": "verify manifests",
"duration_s": 3.8,
"exit": 0,
"run_id": "20260712T222556Z-quick-1495891-a945ab1c",
"artifact_dir": ".cache/verify/runs/20260712T222556Z-quick-1495891-a945ab1c/steps/09-verify-manifests"
},
{
"name": "verify ci-workflows",
"duration_s": 0.57,
"exit": 0,
"run_id": "20260712T222556Z-quick-1495891-a945ab1c",
"artifact_dir": ".cache/verify/runs/20260712T222556Z-quick-1495891-a945ab1c/steps/10-verify-ci-workflows"
},
{
"name": "verify doc-commands",
"duration_s": 9.22,
"exit": 0,
"run_id": "20260712T222556Z-quick-1495891-a945ab1c",
"artifact_dir": ".cache/verify/runs/20260712T222556Z-quick-1495891-a945ab1c/steps/11-verify-doc-commands"
},
{
"name": "verify test-infra-currency",
"duration_s": 0.66,
"exit": 0,
"run_id": "20260712T222556Z-quick-1495891-a945ab1c",
"artifact_dir": ".cache/verify/runs/20260712T222556Z-quick-1495891-a945ab1c/steps/12-verify-test-infra-currency"
},
{
"name": "verify test-clock-hygiene",
"duration_s": 5.19,
"exit": 0,
"run_id": "20260712T222556Z-quick-1495891-a945ab1c",
"artifact_dir": ".cache/verify/runs/20260712T222556Z-quick-1495891-a945ab1c/steps/13-verify-test-clock-hygiene"
},
{
"name": "verify pytest-timeout-overrides",
"duration_s": 10.65,
"exit": 0,
"run_id": "20260712T222556Z-quick-1495891-a945ab1c",
"artifact_dir": ".cache/verify/runs/20260712T222556Z-quick-1495891-a945ab1c/steps/14-verify-pytest-timeout-overrides"
},
{
"name": "verify degrade-loudly",
"duration_s": 5.42,
"exit": 0,
"run_id": "20260712T222556Z-quick-1495891-a945ab1c",
"artifact_dir": ".cache/verify/runs/20260712T222556Z-quick-1495891-a945ab1c/steps/15-verify-degrade-loudly"
}
],
"total_duration_s": 1727.08,
"exit_code": 0
} — format, lint, mypy, rendering, topology, layering, schema, and policy gates passed.\n\n## Anti-vacuity\n\n rebuilds an actual timestamp-less session and reads it through ; it fails if the production record route disappears or if missing/fallback provenance is upgraded. drives the real profile record-to-insight projection, including nested inference/enrichment. The aggregate tests pass actual models to ; removing source reduction, excluding legacy contributors, or choosing the strongest source makes them fail.\n\nRef polylogue-cuxz\n

Sinity and others added 2 commits July 12, 2026 22:50
Problem
Temporal-source provenance reached insight records, but consumers had no
single, honest rule for deciding whether a timestamp was recorded,
estimated, or unknown.

What changed
Define the documented time-confidence vocabulary and project individual,
aggregate, and provenance-bearing records through the existing weakest-source
lattice. Missing and legacy source tags deliberately degrade to unknown.

Compatibility
This is an additive consumer adapter contract. It does not alter archive-tier
storage or fabricate a fallback event timestamp.

Ref polylogue-cuxz

Co-Authored-By: Claude <[email protected]>
Problem
The consumer-facing projection accepts legacy source tags, but its typed
lookup did not narrow unknown strings before indexing the closed map.

What changed
Use the existing temporal-source validator as a type guard before projecting
a source. Missing and unrecognized values continue to degrade to unknown.

Ref polylogue-cuxz

Co-Authored-By: Claude <[email protected]>
@coderabbitai

coderabbitai Bot commented Jul 12, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

@Sinity, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 50 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 2497d8f3-4357-4b06-8b01-5b9fc56a9e35

📥 Commits

Reviewing files that changed from the base of the PR and between 901825e and 445811a.

📒 Files selected for processing (8)
  • polylogue/insights/archive.py
  • polylogue/insights/archive_models.py
  • polylogue/insights/registry.py
  • polylogue/insights/temporal_source.py
  • tests/unit/cli/test_insights.py
  • tests/unit/core/test_temporal_confidence.py
  • tests/unit/insights/test_registry.py
  • tests/unit/mcp/test_tool_contracts.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/fanout/temporal-provenance

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sinity and others added 2 commits July 12, 2026 23:15
Problem
The temporal-confidence contract existed only as a helper, leaving public
insight payloads unable to tell consumers whether displayed time was
recorded, estimated, or unknown.

What changed
Add the provenance field to every insight payload, project record source
provenance through the weakest-source lattice, and show it in plain CLI
insight rows. API, JSON CLI, and MCP now serialize the same field.

Compatibility
Archive-only reads lacking a trustworthy source tag report unknown. No
fallback timestamp is displayed as event time.

Ref polylogue-cuxz

Co-Authored-By: Claude <[email protected]>
Verify the profile insight registry renders the public provenance confidence
rather than leaving the plain CLI path untested.

Ref polylogue-cuxz

Co-Authored-By: Claude <[email protected]>
@Sinity
Sinity marked this pull request as ready for review July 12, 2026 21:27

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 23c915e424

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread polylogue/insights/archive_models.py Resolved
Sinity and others added 2 commits July 12, 2026 23:49
Prove a work-event ordered by materialization time remains publicly unknown rather than appearing to have a fresh event timestamp.

Ref polylogue-cuxz

Co-Authored-By: Claude <[email protected]>
Problem: nested inference/enrichment adapters and aggregate rollups could\ndiscard a row's temporal-source evidence, allowing legacy missing tags to\nbe upgraded by recorded contributors.\n\nWhat changed: preserve high-water-mark source and confidence for nested\nrecord provenance; reduce aggregate sources through the weakest-source\nlattice and treat absent or unknown legacy tags as unknown.\n\nRef polylogue-cuxz\n\nCo-Authored-By: Codex <[email protected]>
@Sinity

Sinity commented Jul 12, 2026

Copy link
Copy Markdown
Owner Author

Adversarial iteration 1

Findings and disposition:

  • Fixed in 445811a: nested inference/enrichment provenance omitted the high-water-mark source and confidence. Direct record adapters now preserve both fields.
  • Fixed in 445811a: aggregate provenance discarded absent or legacy source tags, allowing a recorded contributor to launder a mixed rollup. Such contributors now degrade the aggregate to unknown.
  • Deferred within Ref polylogue-cuxz: public ArchiveStore reads construct provenance in the storage-owned archive-tier path and currently omit the stored source tag. That keeps live API/CLI/MCP rows safely unknown, but cannot expose recorded/estimated values until the owner forwards the field. This lane must not modify polylogue/storage/sqlite/archive_tiers/.

Verification: env TMPDIR=/realm/tmp POLYLOGUE_PYTEST_BASETEMP_ROOT=/realm/tmp/polylogue-pytest nix develop --command devtools test tests/unit/core/test_temporal_confidence.py → 50 passed; pre-push devtools verify --quick passed.

What survived scrutiny: direct record adapters still render materialization/fallback provenance as unknown, and aggregate reduction remains weakest-source rather than strongest-source.

@Sinity

Sinity commented Jul 12, 2026

Copy link
Copy Markdown
Owner Author

Adversarial iteration 2

Zero new findings.

A fresh cold review re-ran the full branch-diff, bead, PR-body, and review-comment audit. It independently confirmed the already documented cross-lane ArchiveStore blocker: live API/CLI/MCP archive reads remain conservatively unknown until the storage-owned archive-tier projection forwards the stored temporal source. No additional code, test, contract, or PR-claim defect was found beyond that deferred item.

The prior substantive review comment is replied to with the 445811a disposition. CodeRabbit remains rate-limited; GitHub Actions init-only billing failures remain known infrastructure.

@Sinity

Sinity commented Jul 12, 2026

Copy link
Copy Markdown
Owner Author

Final acceptance-criteria matrix for polylogue-cuxz

  • Satisfied — settled design: provenance.time_confidence is a closed recorded / estimated / unknown consumer contract. Missing, legacy, materialization, and fallback source tags render unknown; no timestamp is fabricated.
  • Satisfied — weakest-source propagation: direct record adapters, nested inference/enrichment provenance, and aggregate summary/rollup provenance reduce temporal sources conservatively. A missing or legacy contributor degrades an aggregate to unknown.
  • Satisfied — timeless-row behavior: the real rebuilt record route and the production CLI JSON surface expose unknown for timeless provenance; the Shape-B materialization-time case is explicitly unknown rather than fresh event time.
  • Deferred to polylogue-cuxz / storage owner — recorded and estimated values on live ArchiveStore-backed API/CLI/MCP reads: the archive-tier projection currently drops the persisted source tag and therefore returns the safe unknown default. This PR intentionally leaves polylogue/storage/sqlite/archive_tiers/ untouched under lane ownership.
  • Deferred to polylogue-cuxz follow-up — earlier z29t, rvtu, and 2seq fixes landed before this consumer contract and do not consume it; the remaining s5mm surface likewise needs its own storage/query integration.

Verification for the implemented slice: env TMPDIR=/realm/tmp POLYLOGUE_PYTEST_BASETEMP_ROOT=/realm/tmp/polylogue-pytest nix develop --command devtools test tests/unit/core/test_temporal_confidence.py (50 passed); pre-push devtools verify --quick passed.

Ref polylogue-cuxz

@Sinity
Sinity merged commit e7c1b20 into master Jul 12, 2026
3 of 16 checks passed
@Sinity
Sinity deleted the feature/fanout/temporal-provenance branch July 12, 2026 23:07
Sinity added a commit that referenced this pull request Jul 12, 2026
…789,2792,2797

d3xj, w8et, w379 (cost-honesty, PR #2776), fs1.3 (hermes-wedge, PR #2789), and
f2qv.5 (usage-convergence, PR #2797) fully satisfied — closed. cuxz
(temporal-provenance, PR #2786), th0 (test-harness, PR #2777), and fs1.11/
fs1.12 (hermes-wedge cluster, PR #2792) partially satisfied — noted with
disposition, left open per closure-discipline (no closing on partial ACs).

Co-Authored-By: Claude <[email protected]>
@Sinity

Sinity commented Sep 30, 2026

Copy link
Copy Markdown
Owner Author

Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.

Only the rows listed above are dispositioned. Held findings remain open.

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