Skip to content

Port hybrid report acquisition planner onto current main - #74

Merged
masarray merged 2 commits into
mainfrom
cleanup/hybrid-report-p22-current-main-20260814
Aug 14, 2026
Merged

Port hybrid report acquisition planner onto current main#74
masarray merged 2 commits into
mainfrom
cleanup/hybrid-report-p22-current-main-20260814

Conversation

@masarray

Copy link
Copy Markdown
Owner

Current-main consolidation of stale draft PR #66.

This PR is based on main d04fe94877679d66330c5e5bd1a83c245aa9ccb2. The planner, documentation, and P2.2 regression files are copied byte-for-byte from the previously CI-green #66 head; only CHANGELOG.md is updated against current main.

Behavior remains engine-owned and fail-closed:

  • per-signal StaticBrcb, StaticUrcb, DynamicBrcb, DynamicUrcb, MmsPollingFallback, and Uncovered acquisition intents;
  • fresh MmsRcbAvailabilityResult remains the safety authority;
  • static coverage is calculated per requested signal;
  • caller-owned static reports are reused read-only;
  • dynamic report plans require exact evidence for an empty DataSet, RptEna=false, and explicit free reservation state (Resv=false for URCB; ResvTms=0 for BRCB);
  • busy, unknown, unreadable, or unverified reservation state never becomes an automatic write plan;
  • dynamic member resolution is exact-only;
  • polling fallback / uncovered never imply Absent or Signal missing;
  • the planner emits intent only and performs no IED writes.

No ARSAS protocol heuristic is introduced. If this fresh current-main port passes full CI and merges, old draft #66 will be closed as superseded rather than merged directly.

@masarray
masarray merged commit 2af88f5 into main Aug 14, 2026
1 check passed

@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: 82fb724114

ℹ️ 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 on lines +682 to +683
if (options.RequireExactAvailabilityEvidence && snapshot.Confidence != MmsRcbAvailabilityConfidence.Exact)
return false;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reject stale availability snapshots before planning writes

When a cached MmsRcbAvailabilityResult is supplied, these checks accept snapshots of any age because only confidence is examined and neither CheckedAtUtc value is validated. The resulting segment can claim an RCB is free and emit RequiresWrite=true long after another client has enabled or reserved it, despite the option contract promising fresh evidence; enforce a bounded age/session requirement or explicitly reject unverifiable freshness.

AGENTS.md reference: AGENTS.md:L151-L155

Useful? React with 👍 / 👎.

MmsRcbAvailabilitySnapshot snapshot,
MmsReportInventory inventory)
{
var candidate = FindCandidate(inventory, snapshot.Reference) ?? CandidateFromSnapshot(snapshot);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Build caller-owned report details from the fresh snapshot

When the live DatSet or other RCB attributes change between inventory discovery and the availability probe, FindCandidate selects the stale inventory object while the rest of this plan uses the fresh snapshot. This can produce a self-contradictory plan where ReportPlan.ReportControl.DataSetReference differs from ReportPlan.DataSetReference and its members, so consumers may map the active report against the wrong DataSet; construct or refresh the candidate from the snapshot instead.

AGENTS.md reference: AGENTS.md:L153-L156

Useful? React with 👍 / 👎.

Comment on lines +629 to +630
return normalizedMms.Equals(memberMms, StringComparison.OrdinalIgnoreCase) ||
normalizedUser.Equals(memberUser, StringComparison.OrdinalIgnoreCase);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Require FC compatibility for static DataSet matches

When a live DataSet member has the same normalized user reference as a requested signal but a different functional constraint, the user-reference comparison still declares coverage because neither membership.FunctionalConstraint nor member.FunctionalConstraint is checked. The signal is then removed from polling even though the report carries a different MMS variable, so static identity matching must reject known FC mismatches before accepting either reference form.

AGENTS.md reference: AGENTS.md:L144-L156

Useful? React with 👍 / 👎.

Comment on lines +710 to +711
if (!string.IsNullOrWhiteSpace(snapshot.Owner) && snapshot.Owner.Trim() != "-")
return false;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve zero-valued Owner as an unowned RCB

When an IED exposes an empty Owner as a zero-filled OCTET STRING, the probe renderer produces text such as 0000; MmsRcbAvailabilityEvaluator.HasOwner intentionally classifies that as no owner and can return Available, but this second check rejects every nonblank value. Consequently an otherwise explicitly free BRCB is silently excluded and acquisition falls back to polling; reuse the evaluator's Owner interpretation here.

AGENTS.md reference: AGENTS.md:L151-L155

Useful? React with 👍 / 👎.

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