featureparity 0.0.35 → 0.0.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 312f91d87b5afc777f045b11dd38db0660bfc55aaa7faa523f2cd4ca464c348b
4
- data.tar.gz: 3c8b90e1c24911b17751e1574555fc9e5692cf4eacc94c5d27af262dcf6e7328
3
+ metadata.gz: 6d6fb30ab7c332dcae4d9e8596eedc79f39703a9e1b27b7bfbd350a8577fb04f
4
+ data.tar.gz: 899c9e95e30f1a0bbf4ee0ad4ae51f2f220f3bf7fac4224c0a00abaf118c00ad
5
5
  SHA512:
6
- metadata.gz: 803c8fc5b8586ea9d62a3eaa171f04373308c67d13e2f66aa7cf82213f4ba65f95f840c60596c145790d32e39e8116570a48074431c03727930a9085dc85dcf9
7
- data.tar.gz: ca6aa9b65707f0bcf5c839672135c1419918760df4027e414acfc7a20854ae697cd58be43cbc381841863869f136e69a8e825a575f8d634550d28c20e057c13a
6
+ metadata.gz: 570b953fad5c9c12936f1903d9ebdbe04ce21c76a43a6230834471fe8bb7362a2ccc95d02927692a42a0692485d0a6216ceba746df4cc4950401d1c1f057a9b0
7
+ data.tar.gz: e9caaa1068766f560d7615630ae575fb84ab39de61fa11979c29a5ab2c501f4d30b5e73bc64d269b8284ee3fb562aefb45218653c42d21297577500edd6548bf
@@ -237,7 +237,7 @@ module Fp
237
237
  end
238
238
 
239
239
  puts
240
- RepoDetector.print_summary(repo)
240
+ RepoDetector.print_summary(repo, project: cfg[:project])
241
241
  end
242
242
  end
243
243
  end
@@ -263,6 +263,12 @@ module Fp
263
263
  puts "Note: #{unscoped} requirement(s) name no surface this project has, " \
264
264
  'so nothing can cover them.'
265
265
  end
266
+ # Gaps are counted on approved requirements. A project that is all drafts has
267
+ # none of those, which is not the same as having nothing left to test.
268
+ if filter_desc.empty? && (report['summary'] || {})['requirements'].to_i.zero?
269
+ puts 'No requirement has been approved yet, so there is nothing to measure. ' \
270
+ 'Drafts with no test: fp list --status draft --gaps, or fp coverage.'
271
+ end
266
272
  next
267
273
  end
268
274
 
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'timeout'
4
+
3
5
  require 'digest'
4
6
  require 'fileutils'
5
7
  require 'json'
@@ -77,6 +79,9 @@ module Fp
77
79
  # number from a later, fresh read is rarely second-guessed.
78
80
  JOURNAL_TTL = 30 * 60
79
81
 
82
+ # How long the check that a slug names a requirement may take before it is skipped.
83
+ SLUG_LOOKUP_SECONDS = 3
84
+
80
85
  def run(args)
81
86
  opts, positional = parse_flags(args, KNOWN_FLAGS)
82
87
  slug, *locations = positional
@@ -112,11 +117,42 @@ module Fp
112
117
  mark_file(path, files[path], file_targets, slug, marker, opts, earlier[path])
113
118
  end
114
119
 
115
- report(results)
120
+ report(results, unknown_slug_warning(slug))
116
121
  end
117
122
 
118
123
  private
119
124
 
125
+ # A marker whose slug names no requirement binds nothing, and a typo here is silent
126
+ # until someone wonders why a test never showed up as evidence (Fizzy #2040). So
127
+ # when fp can ask, it says. It only asks from a checkout whose .featureparity.yml
128
+ # names the project and with a key configured; `fp mark` needs neither, and marking
129
+ # before the requirement is proposed is fine, so this warns and never refuses.
130
+ def unknown_slug_warning(slug)
131
+ return nil unless config&.valid?
132
+
133
+ project = ProjectConfig.discover(Dir.pwd).project
134
+ return nil unless project
135
+
136
+ api = client || Client.new(config)
137
+ # Marking is a local edit; a slow API must not make it wait.
138
+ requirements = Timeout.timeout(SLUG_LOOKUP_SECONDS) do
139
+ projects = api.list_projects
140
+ return nil unless projects[:ok]
141
+
142
+ found = (projects[:data]['projects'] || []).find { |p| p['slug'] == project || p['id'] == project }
143
+ return nil unless found
144
+
145
+ api.list_requirements(project_id: found['id'])
146
+ end
147
+ return nil unless requirements[:ok]
148
+ return nil if (requirements[:data]['requirements'] || []).any? { |r| r['slug'] == slug }
149
+
150
+ "No requirement '#{slug}' in project '#{project}'. The marker is written, but it binds nothing until " \
151
+ "that requirement exists: check the slug against `fp list` and `fp list --status draft`, or propose it."
152
+ rescue StandardError, Timeout::Error
153
+ nil
154
+ end
155
+
120
156
  # Insert the marker above each target in one file. Targets go in from the bottom up,
121
157
  # so every line number still means what it meant when the command started; each
122
158
  # result's `line` is then where its marker sits in the file as written.
@@ -317,7 +353,9 @@ module Fp
317
353
  s
318
354
  end
319
355
 
320
- def report(results)
356
+ def report(results, warning = nil)
357
+ # On stderr, so --json output stays one parseable document.
358
+ warn "Warning: #{warning}" if warning
321
359
  data = results.map do |r|
322
360
  { file: r[:file], line: r[:line], marker: r[:marker], already_marked: r[:already] || false,
323
361
  dry_run: r[:dry_run] || false, binds_to: r[:found] && r[:found][:title] }.compact
@@ -56,6 +56,7 @@ module Fp
56
56
  if requirements.empty?
57
57
  output.success(report.merge('project' => project_slug)) do
58
58
  puts 'No active requirements. The matrix is empty.'
59
+ puts 'Drafts join it once a human approves them. Until then, see them with: fp coverage'
59
60
  puts "Surfaces: #{surfaces.join(', ')}" unless surfaces.empty?
60
61
  end
61
62
  return
@@ -29,7 +29,7 @@ module Fp
29
29
  help_flag :test_type, "Kind of test (project's vocabulary, e.g. unit, integration, e2e)"
30
30
  help_flag :file, 'Path to the test file (single-requirement mode)', required: true
31
31
  help_flag :line, 'Line number of the test within the file'
32
- help_flag :repo, 'Repository the test lives in (org/repo)', required: true
32
+ help_flag :repo, "Repository the test lives in (org/repo). Defaults to the checkout's git origin remote"
33
33
  help_flag :pr, 'Pull request URL'
34
34
  help_flag :sha, 'Commit SHA the evidence was observed at'
35
35
  help_flag :work_item, 'Work-item URL (card/issue) that prompted the work'
@@ -69,6 +69,11 @@ module Fp
69
69
 
70
70
  VALID_STATES = %w[present stub].freeze
71
71
 
72
+ # "org/repo" from the git origin remote of the checkout at `dir`, or nil.
73
+ def self.inferred_repo(dir = Dir.pwd)
74
+ RepoDetector.new(dir).git_remote_repo
75
+ end
76
+
72
77
  def run(args)
73
78
  opts, positional = parse_flags(args, KNOWN_FLAGS)
74
79
 
@@ -83,7 +88,7 @@ module Fp
83
88
  require_project!(opts)
84
89
  require_flag(opts, :surface)
85
90
  require_flag(opts, :file)
86
- require_flag(opts, :repo)
91
+ resolve_repo!(opts)
87
92
 
88
93
  # Validate state
89
94
  state = opts[:state] || 'present'
@@ -207,13 +212,20 @@ module Fp
207
212
  stored_source == 'ci' && CI_STATUSES.include?(stored_status) && stored_status != requested_state
208
213
  end
209
214
 
215
+ # --repo, or the checkout's own origin remote when it wasn't given: an agent working
216
+ # in a clone shouldn't have to retype what git already knows (Fizzy #2040).
217
+ def resolve_repo!(opts)
218
+ opts[:repo] ||= self.class.inferred_repo
219
+ require_flag(opts, :repo, '--repo is required (org/repo): this checkout has no git origin remote to read it from')
220
+ end
221
+
210
222
  # Batch-upload evidence from a JUnit XML report.
211
223
  def run_junit(opts)
212
224
  # The report's own checkout says which project it is: discovering from the
213
225
  # report's directory (and up) means `fp report --junit hexhaven/junit.xml` run
214
226
  # from a parent folder reads hexhaven's .featureparity.yml, not the parent's.
215
227
  require_project!(opts, ProjectConfig.discover(File.dirname(File.expand_path(opts[:junit].to_s))))
216
- require_flag(opts, :repo)
228
+ resolve_repo!(opts)
217
229
  # --surface is the default for markers that don't pin their own surface
218
230
  # (e.g. `fp:slug@api,web`). It's only strictly required when at least one
219
231
  # matched marker omits a surface — validated below once we know.
@@ -62,6 +62,18 @@ module Fp
62
62
  exit 1
63
63
  end
64
64
 
65
+ # The report needs a repo. Settle it before the suite runs, so a missing one costs
66
+ # a second rather than the whole run (Fizzy #2040).
67
+ unless report_args.include?('--repo') || report_args.any? { |a| a.start_with?('--repo=') }
68
+ repo = Report.inferred_repo
69
+ unless repo
70
+ output.error('--repo is required (org/repo): this checkout has no git origin remote to read it from. ' \
71
+ 'Nothing was run.')
72
+ exit 1
73
+ end
74
+ report_args += ['--repo', repo]
75
+ end
76
+
65
77
  tmp = Dir.mktmpdir('fp-run-')
66
78
  begin
67
79
  report_path, argv, env = self.class.inject(runner, command, tmp)
@@ -80,7 +80,7 @@ module Fp
80
80
  help_flag :repo, 'Repository the surface maps to (org/repo)'
81
81
  help_flag :default_branch, 'Default branch for the repo'
82
82
  help_flag :from, 'Source surface to copy requirements from (drafts them for the new surface)'
83
- help_flag :evaluate, 'With --from: run each requirement through Jev to evaluate applicability (returns data; does not auto-draft)'
83
+ help_flag :evaluate, 'With --from: ask AI which of the source requirements apply to the new surface (paid plans; returns data, drafts nothing)'
84
84
  help_flag :showroom_url, 'Client showroom card: the http(s) link a client opens (edit; empty clears)'
85
85
  help_flag :showroom_label, 'Client showroom card: the button text for that link (edit)'
86
86
  help_flag :showroom_instructions, 'Client showroom card: how to sign in and try the surface (edit)'
@@ -186,8 +186,13 @@ module Fp
186
186
 
187
187
  project_id = resolve_project_id(opts[:project])
188
188
 
189
- # Validate --from surface exists before creating anything
189
+ # With --from, everything that can refuse is checked before the surface is created:
190
+ # the source surface, the new key, that there is something to carry over, and (for
191
+ # --evaluate) that the project may use AI. A run that can't do its job leaves
192
+ # nothing behind (Fizzy #2040).
190
193
  source_surface = nil
194
+ candidates = []
195
+ evaluations = []
191
196
  if opts[:from]
192
197
  source_result = client.find_surface_by_key(project_id, opts[:from])
193
198
  unless source_result[:ok]
@@ -195,6 +200,14 @@ module Fp
195
200
  exit 1
196
201
  end
197
202
  source_surface = source_result[:data]['surface']
203
+
204
+ surface_exists!(key, opts[:project]) if client.find_surface_by_key(project_id, key)[:ok]
205
+
206
+ candidates = carry_over_candidates!(project_id, opts, key)
207
+ evaluations = evaluate_requirements_for_surface!(candidates, opts[:from], key) if opts[:evaluate]
208
+ elsif opts[:evaluate]
209
+ output.error('--evaluate needs --from <source surface>: it asks which of that surface\'s requirements apply to the new one.')
210
+ exit 1
198
211
  end
199
212
 
200
213
  # The API derives key from name and defaults kind/audience/default_branch, but we
@@ -208,14 +221,7 @@ module Fp
208
221
 
209
222
  result = client.create_surface(project_id, params)
210
223
 
211
- if !result[:ok] && result[:status] == 409
212
- output.error(
213
- "Surface '#{key}' already exists in project '#{opts[:project]}'. " \
214
- "Change it with: fp surfaces edit #{key} --project #{opts[:project]} [--name ...] [--kind ...] [--repo ...]",
215
- status: 409
216
- )
217
- exit 1
218
- end
224
+ surface_exists!(key, opts[:project]) if !result[:ok] && result[:status] == 409
219
225
 
220
226
  unless result[:ok]
221
227
  output.error(result[:error], status: result[:status])
@@ -224,21 +230,17 @@ module Fp
224
230
 
225
231
  surface = result[:data]['surface'] || {}
226
232
 
227
- # If --from was given, either evaluate or draft requirements from the source surface
233
+ # Without --evaluate, propose the new surface on every candidate.
228
234
  drafted = []
229
235
  gaps = []
230
- evaluations = []
231
- if source_surface
232
- if opts[:evaluate]
233
- # --evaluate: run each through Jev and return applicability data (no drafting)
234
- evaluations = evaluate_requirements_for_surface(project_id, opts[:project], source_surface, key)
235
- else
236
- # No --evaluate: draft all requirements from the source surface
237
- drafted, gaps = draft_requirements_from_surface(project_id, opts[:project], source_surface, key)
238
- end
236
+ skipped = []
237
+ if source_surface && !opts[:evaluate]
238
+ drafted, gaps, skipped = draft_requirements_from_surface(project_id, opts[:project], surface, candidates,
239
+ opts[:from], key)
239
240
  end
240
241
 
241
242
  response_data = result[:data].merge('drafted' => drafted, 'gaps' => gaps)
243
+ response_data['skipped'] = skipped unless skipped.empty?
242
244
  response_data['evaluations'] = evaluations unless evaluations.empty?
243
245
 
244
246
  output.success(response_data) do
@@ -255,6 +257,7 @@ module Fp
255
257
  print_evaluations(evaluations, opts[:from], key)
256
258
  else
257
259
  print_drafted_requirements(drafted, opts[:from], key)
260
+ print_skipped_requirements(skipped)
258
261
  print_gap_list(gaps, key) unless gaps.empty?
259
262
  end
260
263
  end
@@ -679,61 +682,98 @@ module Fp
679
682
 
680
683
  # --- --from: draft requirements from a source surface ---
681
684
 
682
- # Draft requirements from a source surface for the newly created surface. For each
683
- # active requirement that includes the source surface, propose adding the new
684
- # surface to its required_surfaces. Returns the list of drafted requirements and
685
- # the gap list for the new surface.
686
- def draft_requirements_from_surface(project_id, project_slug, source_surface, new_surface_key)
685
+ def surface_exists!(key, project_slug)
686
+ output.error(
687
+ "Surface '#{key}' already exists in project '#{project_slug}'. " \
688
+ "Change it with: fp surfaces edit #{key} --project #{project_slug} [--name ...] [--kind ...] [--repo ...]",
689
+ status: 409
690
+ )
691
+ exit 1
692
+ end
693
+
694
+ # The requirements --from carries over: active ones and drafts that name the source
695
+ # surface and not yet the new one. Drafts count because a project an agent has just
696
+ # onboarded has nothing else, and `fp surfaces batch-draft` takes them too. Parents
697
+ # come before their children, since a child can't require a surface its parent
698
+ # doesn't. Exits before anything is created when the list can't be read or is empty.
699
+ def carry_over_candidates!(project_id, opts, new_surface_key)
700
+ source_key = opts[:from]
687
701
  result = client.list_requirements(project_id: project_id)
688
702
  unless result[:ok]
689
- warn "Warning: could not list requirements to draft from '#{source_surface['key']}': #{result[:error]}"
690
- return [[], []]
703
+ output.error("Could not list requirements to carry over from '#{source_key}': #{result[:error]}. " \
704
+ 'Nothing was created.', status: result[:status])
705
+ exit 1
691
706
  end
692
707
 
693
708
  requirements = result[:data]['requirements'] || []
694
- source_key = source_surface['key']
695
-
696
- # Find active requirements that include the source surface
697
709
  candidates = requirements.select do |req|
698
- req['status'] == 'active' && (req['required_surfaces'] || []).include?(source_key)
710
+ surfaces = req['required_surfaces'] || []
711
+ %w[active draft].include?(req['status']) && surfaces.include?(source_key) && !surfaces.include?(new_surface_key)
699
712
  end
700
713
 
701
- return [[], []] if candidates.empty?
702
-
703
- drafted = []
704
- errors = []
705
-
706
- candidates.each do |req|
707
- current_surfaces = req['required_surfaces'] || []
708
- next if current_surfaces.include?(new_surface_key) # Already has this surface
709
-
710
- new_surfaces = current_surfaces + [new_surface_key]
711
- change_result = client.propose_requirement_change(
712
- req['id'],
713
- required_surfaces: new_surfaces,
714
- reason: "Adding '#{new_surface_key}' surface (from 'fp surfaces add --from #{source_key}')",
715
- source_type: 'manual'
714
+ if candidates.empty?
715
+ output.error(
716
+ "No active or draft requirement names '#{source_key}' without already naming '#{new_surface_key}', " \
717
+ "so there is nothing to carry over. Nothing was created. To add the surface on its own: " \
718
+ "fp surfaces add #{new_surface_key} --project #{opts[:project]}"
716
719
  )
720
+ exit 1
721
+ end
717
722
 
718
- if change_result[:ok]
719
- drafted << {
720
- 'slug' => req['slug'],
721
- 'title' => req['title'],
722
- 'surfaces' => new_surfaces
723
- }
724
- else
725
- errors << {
726
- 'slug' => req['slug'],
727
- 'error' => change_result[:error]
728
- }
729
- end
723
+ by_id = requirements.to_h { |req| [req['id'], req] }
724
+ candidates.sort_by.with_index { |req, index| [requirement_depth(req, by_id), index] }
725
+ end
726
+
727
+ def requirement_depth(requirement, by_id)
728
+ depth = 0
729
+ seen = {}
730
+ parent = by_id[requirement['parent_id']]
731
+ while parent && !seen[parent['id']]
732
+ seen[parent['id']] = true
733
+ depth += 1
734
+ parent = by_id[parent['parent_id']]
735
+ end
736
+ depth
737
+ end
738
+
739
+ # Propose the new surface on every candidate, through the same endpoint as
740
+ # `fp surfaces batch-draft` so the two can't disagree about what gets drafted or
741
+ # skipped. Returns [drafted, gaps, skipped].
742
+ def draft_requirements_from_surface(project_id, project_slug, surface, candidates, source_key, new_surface_key)
743
+ result = client.batch_draft_surface_requirements(
744
+ project_id,
745
+ surface['id'],
746
+ slugs: candidates.map { |req| req['slug'] },
747
+ reason: "Adding '#{new_surface_key}' surface (from 'fp surfaces add --from #{source_key}')",
748
+ source_type: 'manual'
749
+ )
750
+
751
+ unless result[:ok]
752
+ output.error(
753
+ "Created surface '#{new_surface_key}', but could not draft requirements for it: #{result[:error]}. " \
754
+ "Retry with: fp surfaces batch-draft #{new_surface_key} --project #{project_slug} " \
755
+ "--slugs #{candidates.map { |req| req['slug'] }.join(',')}",
756
+ status: result[:status]
757
+ )
758
+ exit 1
730
759
  end
731
760
 
732
- # Warn about errors but don't fail the whole operation
733
- errors.each do |err|
761
+ data = result[:data]
762
+ by_slug = candidates.to_h { |req| [req['slug'], req] }
763
+
764
+ (data['errors'] || []).each do |err|
734
765
  warn "Warning: could not draft '#{err['slug']}': #{err['error']}"
735
766
  end
736
767
 
768
+ drafted = (data['drafted'] || []).map do |row|
769
+ req = by_slug[row['slug']] || {}
770
+ {
771
+ 'slug' => row['slug'],
772
+ 'title' => row['title'] || req['title'],
773
+ 'surfaces' => (req['required_surfaces'] || []) + [new_surface_key]
774
+ }
775
+ end
776
+
737
777
  # The gap list is every requirement we just drafted — they all need evidence on
738
778
  # the new surface. Format matches what `fp list --gaps` returns.
739
779
  gaps = drafted.map do |req|
@@ -744,48 +784,28 @@ module Fp
744
784
  }
745
785
  end
746
786
 
747
- [drafted, gaps]
787
+ [drafted, gaps, data['skipped'] || []]
748
788
  end
749
789
 
750
790
  # --- --from --evaluate: evaluate requirements for applicability ---
751
791
 
752
- # Evaluate requirements from a source surface to determine which apply to a new
753
- # surface. For each active requirement that includes the source surface, ask Jev
754
- # whether it applies to the target surface. Returns a list of evaluations with
755
- # applicability verdicts and reasoning for agent decision-making.
756
- def evaluate_requirements_for_surface(project_id, project_slug, source_surface, new_surface_key)
757
- result = client.list_requirements(project_id: project_id)
758
- unless result[:ok]
759
- warn "Warning: could not list requirements to evaluate from '#{source_surface['key']}': #{result[:error]}"
760
- return []
761
- end
762
-
763
- requirements = result[:data]['requirements'] || []
764
- source_key = source_surface['key']
765
-
766
- # Find active requirements that include the source surface
767
- candidates = requirements.select do |req|
768
- req['status'] == 'active' && (req['required_surfaces'] || []).include?(source_key)
769
- end
770
-
771
- return [] if candidates.empty?
772
-
773
- evaluations = []
774
- candidates.each do |req|
775
- current_surfaces = req['required_surfaces'] || []
776
- next if current_surfaces.include?(new_surface_key) # Already has this surface
792
+ # A refusal that will be the same for every requirement: no AI access for this
793
+ # project (402), a key that can't reach it, or the analyzer being unavailable.
794
+ EVALUATION_BLOCKED = [401, 402, 403, 503].freeze
777
795
 
796
+ # Ask, for each candidate, whether it applies to the new surface. Returns a list of
797
+ # evaluations with applicability verdicts and reasoning for agent decision-making.
798
+ # Runs before the surface is created: a project without AI access is told once and
799
+ # the command exits 1 with nothing made, as `fp analyze` does.
800
+ def evaluate_requirements_for_surface!(candidates, source_key, new_surface_key)
801
+ candidates.map do |req|
778
802
  progress("Evaluating #{req['slug']} ...")
779
803
 
780
- eval_result = client.evaluate_surface_applicability(
781
- req['id'],
782
- new_surface_key,
783
- source_key
784
- )
804
+ eval_result = client.evaluate_surface_applicability(req['id'], new_surface_key, source_key)
785
805
 
786
806
  if eval_result[:ok]
787
807
  evaluation = eval_result[:data]['evaluation'] || {}
788
- evaluations << {
808
+ {
789
809
  'slug' => req['slug'],
790
810
  'title' => req['title'],
791
811
  'applies' => evaluation['applies'],
@@ -793,9 +813,16 @@ module Fp
793
813
  'confidence' => evaluation['confidence'],
794
814
  'reason' => evaluation['reason']
795
815
  }
816
+ elsif EVALUATION_BLOCKED.include?(eval_result[:status])
817
+ output.error(
818
+ "#{eval_result[:error]} Nothing was created. Without --evaluate, " \
819
+ "fp surfaces add #{new_surface_key} --from #{source_key} drafts every requirement on '#{source_key}' for review.",
820
+ status: eval_result[:status]
821
+ )
822
+ exit 1
796
823
  else
797
- # Evaluation failed (likely 402 for no AI access) — include as an error entry
798
- evaluations << {
824
+ # One requirement failed for a reason of its own; the rest still get an answer.
825
+ {
799
826
  'slug' => req['slug'],
800
827
  'title' => req['title'],
801
828
  'applies' => nil,
@@ -806,16 +833,9 @@ module Fp
806
833
  }
807
834
  end
808
835
  end
809
-
810
- evaluations
811
836
  end
812
837
 
813
838
  def print_evaluations(evaluations, source_key, new_key)
814
- if evaluations.empty?
815
- puts "No requirements on '#{source_key}' to evaluate for '#{new_key}'."
816
- return
817
- end
818
-
819
839
  applies = evaluations.select { |e| e['applies'] == true }
820
840
  does_not_apply = evaluations.select { |e| e['applies'] == false }
821
841
  errors = evaluations.select { |e| e['error'] }
@@ -844,8 +864,8 @@ module Fp
844
864
  end
845
865
 
846
866
  puts
847
- puts 'Nothing was drafted. Use the evaluation data above to decide which requirements to'
848
- puts 'add manually, or re-run without --evaluate to draft all requirements at once.'
867
+ puts 'Nothing was drafted. Draft the ones you decide apply with:'
868
+ puts " fp surfaces batch-draft #{new_key} --slugs slug1,slug2"
849
869
  end
850
870
 
851
871
  def progress(message)
@@ -854,7 +874,7 @@ module Fp
854
874
 
855
875
  def print_drafted_requirements(drafted, source_key, new_key)
856
876
  if drafted.empty?
857
- puts "No requirements on '#{source_key}' to draft for '#{new_key}'."
877
+ puts "No requirement on '#{source_key}' was drafted for '#{new_key}'."
858
878
  return
859
879
  end
860
880
 
@@ -865,6 +885,20 @@ module Fp
865
885
  puts ' A human must approve each change in the web app before the surface is measured.'
866
886
  end
867
887
 
888
+ SKIP_REASONS = {
889
+ 'has_pending_change' => 'already has a change awaiting review',
890
+ 'already_includes_surface' => 'already names this surface',
891
+ 'archived' => 'archived'
892
+ }.freeze
893
+
894
+ def print_skipped_requirements(skipped)
895
+ return if skipped.empty?
896
+
897
+ puts
898
+ puts "Skipped (#{skipped.size}):"
899
+ skipped.each { |row| puts " - #{row['slug']}: #{SKIP_REASONS[row['reason']] || row['reason']}" }
900
+ end
901
+
868
902
  def print_gap_list(gaps, new_key)
869
903
  puts
870
904
  puts "Gap list for '#{new_key}' (#{gaps.size} requirement(s) need coverage):"
@@ -22,7 +22,8 @@ module Fp
22
22
  help_note "Needs no API key. Same as `gem update featureparity`, or re-running the installer.\n" \
23
23
  'After an update, run `fp skill install` and `fp init --force` in each repo that uses fp, ' \
24
24
  "to refresh the agent skill and the AGENTS.md section.\n" \
25
- 'fp also says when a newer version exists, at most once a day; FP_NO_UPDATE_CHECK=1 turns that off.'
25
+ 'fp also says when a newer version exists, at most once a day; FP_NO_UPDATE_CHECK=1 turns that off.' \
26
+ "\nWhat changed in each release: #{UpdateCheck::CHANGELOG_URL}"
26
27
 
27
28
  KNOWN_FLAGS = { check: :boolean }.freeze
28
29
 
@@ -62,7 +63,10 @@ module Fp
62
63
  end
63
64
 
64
65
  if opts[:check]
65
- return output.success(status.merge(updated: false)) { puts UpdateCheck.message(latest) }
66
+ return output.success(status.merge(updated: false, changelog_url: UpdateCheck::CHANGELOG_URL)) do
67
+ puts UpdateCheck.message(latest)
68
+ puts "What changed: #{UpdateCheck::CHANGELOG_URL}"
69
+ end
66
70
  end
67
71
 
68
72
  install(status)
@@ -79,8 +83,10 @@ module Fp
79
83
  exit 1
80
84
  end
81
85
 
82
- output.success(status.merge(updated: true, next_steps: AFTER_UPDATE.map(&:first))) do
86
+ payload = status.merge(updated: true, next_steps: AFTER_UPDATE.map(&:first), changelog_url: UpdateCheck::CHANGELOG_URL)
87
+ output.success(payload) do
83
88
  puts "✓ fp is updated. `fp version` shows what's installed."
89
+ puts "What changed: #{UpdateCheck::CHANGELOG_URL}"
84
90
  puts
85
91
  puts 'Next, in each repo that uses fp:'
86
92
  AFTER_UPDATE.each { |command, why| puts " #{command.ljust(18)} # #{why}" }
@@ -101,9 +101,15 @@ module Fp
101
101
  end
102
102
 
103
103
  # Human-readable summary of #detect, printed by `fp doctor` and `fp init --detect`.
104
- def self.print_summary(repo, out: $stdout)
104
+ # `project` is the slug the repo's .featureparity.yml already names; with one there is
105
+ # nothing left to suggest.
106
+ def self.print_summary(repo, out: $stdout, project: nil)
105
107
  out.puts 'Repo'
106
- out.puts " Suggested slug: #{repo['slug']}#{repo['repo'] ? " (from git remote #{repo['repo']})" : ' (from the directory name)'}"
108
+ if project
109
+ out.puts " Project: #{project} (from the project file)"
110
+ else
111
+ out.puts " Suggested slug: #{repo['slug']}#{repo['repo'] ? " (from git remote #{repo['repo']})" : ' (from the directory name)'}"
112
+ end
107
113
  frameworks = repo['frameworks'].map { |f| f['dir'] == '.' ? f['name'] : "#{f['name']} (#{f['dir']})" }
108
114
  out.puts " Frameworks: #{frameworks.empty? ? '(none recognised)' : frameworks.uniq.join(', ')}"
109
115
 
@@ -20,6 +20,8 @@ module Fp
20
20
  CACHE_NAME = 'update_check.json'
21
21
  UPDATE_COMMAND = 'fp update'
22
22
  GEM_COMMAND = 'gem update featureparity'
23
+ # Every release and what changed in it, newest first (Fizzy #2044).
24
+ CHANGELOG_URL = 'https://featureparity.dev/changelog'
23
25
 
24
26
  # Commands that say it themselves, or that are about the version already.
25
27
  QUIET_COMMANDS = %w[update doctor version help].freeze
data/lib/fp/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Fp
4
- VERSION = '0.0.35'
4
+ VERSION = '0.0.37'
5
5
  end
data/skills/fp/SKILL.md CHANGED
@@ -516,6 +516,23 @@ media remove <id> --yes` takes one down. A surface with media but no link is sti
516
516
  Feedback and the share link are human-only, so after writing the content tell a person
517
517
  it's ready.
518
518
 
519
+ ### 10. Add a platform the product now ships on
520
+
521
+ When the product gains a surface (Android when it already has web), carry the catalog
522
+ over instead of re-typing it:
523
+
524
+ ```bash
525
+ fp surfaces add android --from web # create android, propose it on every requirement that names web
526
+ fp surfaces add android --from web --evaluate --json > eval.json # or ask AI which ones apply first (paid plans)
527
+ fp surfaces batch-draft android --slugs login,checkout # then propose it on the ones you chose
528
+ ```
529
+
530
+ `--from` takes active and draft requirements, and creates nothing when it has nothing to
531
+ carry over or `--evaluate` isn't available on the project's plan. Each proposal waits for
532
+ a human: until it is approved the new surface isn't required, the existing tests keep
533
+ their verdicts, and `fp check` is unchanged. After approval, `fp list --gaps --surface
534
+ android` is the list of tests to write.
535
+
519
536
  ### Repo-local config (`.featureparity.yml`)
520
537
 
521
538
  If a repo has a `.featureparity.yml`, `--project` is optional — `fp` reads the slug from
@@ -74,16 +74,26 @@ create --surfaces` made with defaults. `edit` only sends the flags you pass. `de
74
74
  asks you to type the key back in a terminal and refuses without `--yes` otherwise.
75
75
 
76
76
  **`--from`**: When adding a platform that mirrors an existing one (Android when you
77
- have web), `--from web` finds every active requirement on `web`, proposes adding the
78
- new surface to each, and returns a gap list. The drafts await human review.
77
+ have web), `--from web` finds every active or draft requirement that names `web`,
78
+ proposes adding the new surface to each (parents before their children), and returns a
79
+ gap list. The proposals await human review. It goes through the same endpoint as `fp
80
+ surfaces batch-draft`, so a requirement that already has a change awaiting review is
81
+ skipped and named. Everything is checked first: if the source surface doesn't exist, the
82
+ new key is taken, or no requirement names the source, the command exits 1 and creates
83
+ nothing.
79
84
 
80
85
  **`--from --evaluate`**: Instead of mass-drafting, asks the AI whether each source
81
86
  requirement applies to the target platform. Returns applicability verdicts with
82
87
  reasoning — which requirements apply (✅), which don't (❌), and why. Nothing is
83
- drafted; the agent uses the evaluation data to decide which requirements to add
84
- manually. Useful for filtering the ~10% that are platform-specific (browser resize,
85
- web-only APIs) from the 90% that transfer to any client. Requires a Pro plan or a
86
- project owner with AI access.
88
+ drafted; send the slugs you decide apply to `fp surfaces batch-draft`. Useful for
89
+ filtering the ~10% that are platform-specific (browser resize, web-only APIs) from the
90
+ 90% that transfer to any client. Requires a Pro plan or a project owner with AI access:
91
+ without it the command says so once, exits 1, and creates nothing.
92
+
93
+ **While a new surface awaits review, nothing else moves.** A proposal that only adds a
94
+ required surface leaves the existing tests' verdicts as they were, and the gate keeps
95
+ measuring the requirement on the surfaces it already had. The new surface is required
96
+ (and its cells `missing`) only once a human approves it.
87
97
 
88
98
  A surface that requirements still require can't be deleted or re-keyed — the server
89
99
  refuses and names them. Taking a surface off a requirement is a human's call, so ask
@@ -1067,7 +1077,7 @@ fp repos unset customer_android --project acme
1067
1077
  fp is a Ruby gem, so any of these installs the newest version:
1068
1078
 
1069
1079
  ```bash
1070
- fp update # from fp 0.0.35
1080
+ fp update # fp 0.0.34 and newer
1071
1081
  gem update featureparity
1072
1082
  curl -fsSL https://api.featureparity.dev/api/cli/install | bash # the installer again
1073
1083
  ```
@@ -1079,6 +1089,8 @@ fp skill install # refresh the agent skill, if the repo has it installed
1079
1089
  fp init --force # refresh the FeatureParity section of AGENTS.md
1080
1090
  ```
1081
1091
 
1092
+ What changed in each release is at https://featureparity.dev/changelog, newest first.
1093
+
1082
1094
  `fp version` shows what's installed and `fp update --check` whether a newer one exists.
1083
1095
  `fp doctor` shows the newest published version and, when the one running is behind, the
1084
1096
  command that installs it. At most once a day, an fp command that finds a newer version
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: featureparity
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.35
4
+ version: 0.0.37
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stowzilla
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-11-17 00:00:00.000000000 Z
11
+ date: 2026-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-http
@@ -161,6 +161,7 @@ metadata:
161
161
  rubygems_mfa_required: 'true'
162
162
  homepage_uri: https://featureparity.dev
163
163
  documentation_uri: https://featureparity.dev/docs
164
+ changelog_uri: https://featureparity.dev/changelog
164
165
  post_install_message:
165
166
  rdoc_options: []
166
167
  require_paths: