Skip to content

Implement staged Read Need-Fit boundary#7

Closed
geraldarthurdavis wants to merge 2 commits into
version/v28from
v28/staged-reading-need-fit
Closed

Implement staged Read Need-Fit boundary#7
geraldarthurdavis wants to merge 2 commits into
version/v28from
v28/staged-reading-need-fit

Conversation

@geraldarthurdavis

Copy link
Copy Markdown
Contributor

Summary

  • add typed Read-Need synthesis, acceptance, strict Need-Fit admission, and Share-to-Fee preview primitives
  • wire accepted Need into depository search and the Vercel Sandbox harness manifest/runner
  • document the branch-based contribution workflow from the Bitcode Core Contributions ruleset

Verification

  • pnpm --filter @bitcode/pipeline-asset-pack test -- --runTestsByPath src/tests/read-need.test.ts src/tests/depository-search.test.ts src/tests/bounded-structured-inference.test.ts --forceExit
  • pnpm --filter @bitcode/pipeline-hosts test -- --runTestsByPath src/tests/manifest.test.ts src/tests/asset-pack-harness.test.ts --forceExit
  • npm --prefix protocol-demonstration run test:v28-mvp-qa
  • pnpm --filter @bitcode/pipeline-asset-pack typecheck
  • pnpm --filter @bitcode/pipeline-hosts typecheck
  • pnpm --filter @bitcode/pipeline-asset-pack exec jest --config jest.config.cjs --passWithNoTests --forceExit
  • pnpm --filter @bitcode/pipeline-hosts exec jest --config jest.config.cjs --passWithNoTests --forceExit
  • git diff --check
  • staged secret-pattern scan: no matches

@vercel

vercel Bot commented May 18, 2026

Copy link
Copy Markdown

Deployment failed with the following error:

There is no GitHub account connected to this Vercel account.

@vercel

vercel Bot commented May 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
engi-uapi Ready Ready Preview, Comment May 18, 2026 4:16pm

@geraldarthurdavis

Copy link
Copy Markdown
Contributor Author

Superseded by #8 from gate-number-prefixed branch v28/gate-3-staged-reading-need-fit.

@geraldarthurdavis
geraldarthurdavis deleted the v28/staged-reading-need-fit branch May 18, 2026 16:19

@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: 748ee9c32f

ℹ️ 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 +336 to +343
export function isAcceptedReadNeed(value: unknown): value is ReadNeed {
const record = recordValue(value);
return Boolean(
record?.schema === 'bitcode.read.need' &&
record.reviewState === 'accepted' &&
typeof record.needId === 'string' &&
typeof record.measurementRoot === 'string'
);

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 incomplete accepted Needs

When a caller supplies acceptedReadNeed/readNeed from the harness manifest or API with only schema, reviewState, needId, and measurementRoot, this guard treats it as accepted even though read and sourceConstraints may be missing. normalizeDepositorySearchRead then calls readNeedToDepositorySearchRead and dereferences need.read.prompt / need.sourceConstraints, so a malformed accepted Need crashes the pipeline instead of producing the intended blocked_readiness admission failure. Please validate the required nested fields before admitting the Need.

Useful? React with 👍 / 👎.

Comment on lines +397 to +400
const weightedAdmittedVolume = weightedMeasurementVolume(
input.need.pricingMeasurementInputs.measurementVector,
Math.max(0, Math.min(1, input.admittedFitQuality))
);

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 Clamp non-finite fit quality before pricing

If the admitted fit quality is NaN or another non-finite number (for example from parsing an absent score), Math.min/Math.max propagate it into weightedMeasurementVolume, and the returned preview has weightedAdmittedVolume: NaN and sats: NaN despite the minimum fee. Since this preview is the deterministic Share-to-Fee boundary, non-finite quality should be rejected or coerced before calculating the BTC quote.

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