narrowContribution is a separate hand-rolled proxy with no guarded list and will not inherit narrowView hardening

Open
#2,051 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Active
Tech stack
javascript
Domain
tooling

Research direction

Start with src/core/runtime/activation.js at narrowContribution and compare its proxy behavior with narrowView. Find and run the existing contribution-view tests; the payload does not name their file. Done means narrowContribution delegates to narrowView or uses the same guarded-field mechanism, with those tests passing and a test covering a hypothetical object-valued contribution field.

Written by the indexing model from the issue text.

Description

Source: #2042 at f77424adc609d7e01d9c90304bfe63b3213b5d04
Location: src/core/runtime/activation.js:651
Severity: minor

Evidence

Verified at f77424ad: narrowContribution builds its own Proxy with read = Reflect.get(contribution, prop, contribution) passed straight through for every field, and CONTRIBUTION_FIELDS (:621) is ['name', 'plugin', 'summary', 'configSection'], all declared string, so nothing object-valued reads through today. But it is not a narrowView caller, so any future hardening of the shared path (the guarded-copy mechanism, the extra own-check above) does not reach it.

Why deferral is safe

No incorrect behavior today: every narrowed contribution field is a string, so there is no object to edit through the view. This is structural convergence (fold narrowContribution onto narrowView, or give it the same guarded mechanism), which is speculative cleanup outside issue 1985's scope.

Acceptance condition

narrowContribution either delegates to narrowView or carries the same guarded-field mechanism, with the existing contribution-view tests still passing and a test covering a hypothetical object-valued contribution field.

Review preference; backlog only. A human may explicitly delegate it with neutral:fix.

Dominant language
JavaScript
Stars
11
Forks
0
Avg merge
2h 55m
Merged PRs (30d)
294

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from hyparam/hypaware

All issues in hyparam/hypaware

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.