featureparity 0.0.31 → 0.0.33

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: 2f0f78517e010302b866caf565d5327e7c98929a82230ecf98da1bac55d51d9f
4
- data.tar.gz: 956d1c46e86711b37653f387044709d76e0a4e83161ca3f49f12d555ce1309e2
3
+ metadata.gz: ed664952f7dd1c088b3d534868eb06023a3dcdfe5783417288745560217ab1ee
4
+ data.tar.gz: de7931594143ee7c9324a6b29968b77f60435c51af0f935ec01ea9f8347aebdc
5
5
  SHA512:
6
- metadata.gz: 8c6252c44e1a635cb54b9044dd9b3f9037e405811913f100dedbcac598dfebb57432842856481b1dc943989b44c84350a9559433c110d9ab31d19b266389b967
7
- data.tar.gz: c28eb89f74bc8e205e855df172621aac1f79dca7c2f30a3232c8072fd1a6acf4a9cf1898efb581699732b885f9ac872fa7ccf7aa83471d80fd2c47eebaaaa306
6
+ metadata.gz: 73231f3b48feda8c832eaedaa25c58d637ffecc436be1f2518da1089c9e9747517a08b53765a1f44b9faf92174a4711f1eb371abac522a64d6a3c292ed7ac98a
7
+ data.tar.gz: f7fb9b80fe7d7236523279c13d1e42b1d80cd89bd3bdf8163015abe88cbb33f13b14acb35ca95a9de9bcbddbc6d15ade21a1cb362537038c8e6b4e3ce731b5f5
data/lib/fp/cli.rb CHANGED
@@ -38,6 +38,7 @@ module Fp
38
38
  'repos' => Commands::Repos,
39
39
  'setup' => Commands::Setup,
40
40
  'whoami' => Commands::Whoami,
41
+ 'skill' => Commands::Skill,
41
42
  'version' => Commands::Version,
42
43
  'help' => Commands::Help,
43
44
  'attach' => Commands::Attach,
@@ -60,6 +61,9 @@ module Fp
60
61
  # reported "Unknown command: --version".
61
62
  command_name = 'version' if %w[--version -v].include?(command_name)
62
63
 
64
+ # `fp --help` / `fp -h` are aliases for `fp help`, for the same reason.
65
+ command_name = 'help' if %w[--help -h].include?(command_name)
66
+
63
67
  command_class = COMMANDS[command_name]
64
68
 
65
69
  unless command_class
@@ -80,7 +84,7 @@ module Fp
80
84
 
81
85
  # Profile/config commands don't need auth. `init` is here too: it only writes
82
86
  # files into the repo, and onboarding a repo must work before anyone has a key.
83
- needs_auth = !%w[init doctor profile config repos setup whoami version help mark].include?(command_name)
87
+ needs_auth = !%w[init doctor profile config repos setup whoami skill version help mark tutorial].include?(command_name)
84
88
 
85
89
  if needs_auth
86
90
  config = Config.new(profile: global_opts[:profile], api_url: global_opts[:api_url])
@@ -92,6 +96,8 @@ module Fp
92
96
  client = Client.new(config)
93
97
  else
94
98
  config = Config.new(profile: global_opts[:profile], api_url: global_opts[:api_url])
99
+ # whoami asks the API who the key acts as, but still works with no valid key.
100
+ client = Client.new(config) if command_name == 'whoami' && config.valid?
95
101
  end
96
102
 
97
103
  output = Output.new(json: global_opts[:json])
data/lib/fp/client.rb CHANGED
@@ -22,6 +22,11 @@ module Fp
22
22
  get("/api/projects/#{id}")
23
23
  end
24
24
 
25
+ # GET /whoami — who the key acts as (key name and owner)
26
+ def whoami
27
+ get('/api/whoami')
28
+ end
29
+
25
30
  # POST /projects
26
31
  def create_project(params)
27
32
  post('/api/projects', params)
@@ -22,8 +22,8 @@ module Fp
22
22
  help_flag :conflicts, 'Include cross-requirement conflict findings'
23
23
  help_flag :force, 'Re-analyze even cached (unchanged) requirements'
24
24
  help_flag :cached, 'Read cached analyses only; do not spend model calls'
25
- help_example 'fp analyze --project stowzilla'
26
- help_example 'fp analyze print_container_qr --project stowzilla --conflicts'
25
+ help_example 'fp analyze --project acme'
26
+ help_example 'fp analyze print_container_qr --project acme --conflicts'
27
27
 
28
28
  KNOWN_FLAGS = {
29
29
  project: :string,
@@ -18,8 +18,8 @@ module Fp
18
18
  help_flag :sha, 'Commit SHA the capture observed'
19
19
  help_flag :example_title, 'Name of the individual test this media proves'
20
20
  help_flag :evidence_key, 'Composite receipt key (surface:repo:test_type) to bind to'
21
- help_example 'fp attach print_qr e2e-run.webm --project stowzilla --surface customer_web --example-title "prints a QR code onto the container label"'
22
- help_example 'fp attach rm print_qr <attachment-id> --project stowzilla'
21
+ help_example 'fp attach print_qr e2e-run.webm --project acme --surface customer_web --example-title "prints a QR code onto the container label"'
22
+ help_example 'fp attach rm print_qr <attachment-id> --project acme'
23
23
  help_note 'Visual: png, jpg, gif, webp, mp4, webm, mov. Text/docs: txt, md, json, svg, pdf. Max 100 MB.'
24
24
 
25
25
  CONTENT_TYPES = {
@@ -10,7 +10,7 @@ module Fp
10
10
  help_usage 'fp attachments <slug> --project <slug>',
11
11
  'fp attachments <slug> <attachment-id> --project <slug>'
12
12
  help_flag :project, 'Project slug (falls back to .featureparity.yml)'
13
- help_example 'fp attachments print_container_qr --project stowzilla'
13
+ help_example 'fp attachments print_container_qr --project acme'
14
14
 
15
15
  KNOWN_FLAGS = { project: :string }.freeze
16
16
 
@@ -281,6 +281,7 @@ module Fp
281
281
  print_inherited(report)
282
282
  print_orphans(report)
283
283
  print_pending_reviews(report, project_slug)
284
+ print_retirements(report)
284
285
  print_unscoped_warning(summary, project_slug)
285
286
  print_next_steps(report, violations)
286
287
  print_verdict(passed, violations, opts, report)
@@ -333,6 +334,34 @@ module Fp
333
334
  puts
334
335
  end
335
336
 
337
+ # Retired requirements whose tests still run somewhere: a removal was approved, but
338
+ # the feature hasn't come out of every surface yet (Fizzy #1820). It fails the gate
339
+ # wherever `missing` does — the server decides (`retirements_violate`, already
340
+ # folded into `passing`); here it is rendered as a violation or a note. On a pull
341
+ # request only the surfaces this run put it back on count.
342
+ def print_retirements(report)
343
+ retirements = report['retirements'] || []
344
+ return if retirements.empty?
345
+
346
+ violates = report['retirements_violate']
347
+ lead = "#{retirements.size} retired requirement(s) still shipping — the removal was approved, " \
348
+ 'but their tests still run'
349
+ puts violates ? "#{lead} (a violation at this level):" : "#{lead} (not failing the gate at this level):"
350
+ headers = %w[SLUG STILL_SHIPPING_ON REMOVED_FROM]
351
+ headers << 'ADDED_BY_THIS_CHANGE' if report['pull_request']
352
+ output.table(
353
+ headers,
354
+ retirements.map do |r|
355
+ row = [r['slug'], Array(r['still_shipping_on']).join(', '), Array(r['removed_from']).join(', ')]
356
+ row << Array(r['introduced_on']).join(', ') if report['pull_request']
357
+ row
358
+ end
359
+ )
360
+ hint = retirements.first['action_hint']
361
+ puts "Next step (agent): #{hint}" if hint
362
+ puts
363
+ end
364
+
336
365
  def print_violations(violations, report = {})
337
366
  return if violations.empty?
338
367
 
@@ -69,7 +69,7 @@ module Fp
69
69
  help_flag :sha, 'Checkout commit SHA'
70
70
  help_flag :allow_empty, 'Do not error when a report resolves no fp:<slug> markers'
71
71
  help_flag :local, 'No CI available: report a suite a person ran locally at a clean, committed HEAD (--ci-url optional)'
72
- help_example 'fp ci-report --junit junit.xml --project stowzilla --surface api --ci-url "$CI_RUN_URL"'
72
+ help_example 'fp ci-report --junit junit.xml --project acme --surface api --ci-url "$CI_RUN_URL"'
73
73
  help_example 'fp ci-report --junit web.xml --surface web --base-dir frontend --pr "$PR_URL"'
74
74
  help_example 'fp ci-report --local --junit junit.xml --surface api'
75
75
  help_note "This is CI's command, not an agent's: only it writes passing/failing. Run it on both\n" \
@@ -27,7 +27,7 @@ module Fp
27
27
  help_flag :source_type, "Origin type: #{VALID_SOURCE_TYPES.join(', ')}"
28
28
  help_flag :source_url, 'Origin URL'
29
29
  help_flag :source_context, 'Free-form origin note'
30
- help_example 'fp comment print_qr --body "This conflicts with the freezer label requirement" --project stowzilla'
30
+ help_example 'fp comment print_qr --body "This conflicts with the freezer label requirement" --project acme'
31
31
 
32
32
  def run(args)
33
33
  opts, positional = parse_flags(args, KNOWN_FLAGS)
@@ -19,7 +19,7 @@ module Fp
19
19
  help_flag :project, 'Project slug (falls back to .featureparity.yml)'
20
20
  help_flag :body, 'Post this comment (omit to list the comments)'
21
21
  help_flag :tag, 'Comma-separated people (email or name) or agents (name or key name) to tag'
22
- help_example 'fp comments print_qr --project stowzilla'
22
+ help_example 'fp comments print_qr --project acme'
23
23
  help_example 'fp comments print_qr --body "The redesign dropped this screen — retire it?" --tag andy@example.com'
24
24
 
25
25
  def run(args)
@@ -18,8 +18,8 @@ module Fp
18
18
  help_flag :category, 'Only requirements in this category'
19
19
  help_flag :surface, 'Only requirements that name this surface'
20
20
  help_flag :output, 'Write to this file instead of stdout'
21
- help_example 'fp export --project stowzilla > requirements.md'
22
- help_example 'fp export --project stowzilla --status active --surface customer_android --output reqs.md'
21
+ help_example 'fp export --project acme > requirements.md'
22
+ help_example 'fp export --project acme --status active --surface customer_android --output reqs.md'
23
23
 
24
24
  KNOWN_FLAGS = {
25
25
  project: :string,
@@ -9,6 +9,8 @@ module Fp
9
9
  class Help < Base
10
10
  def run(args)
11
11
  topic = args.first
12
+ return print_index if output&.json? && (topic.nil? || topic.start_with?('-'))
13
+
12
14
  if topic && Fp::CLI::COMMANDS.key?(topic)
13
15
  puts Fp::CLI::COMMANDS[topic].help_text(topic)
14
16
  return
@@ -26,6 +28,17 @@ module Fp
26
28
 
27
29
  private
28
30
 
31
+ # `fp help --json`: every command with its summary and usage, from the same
32
+ # metadata `fp <cmd> --help --json` reads. A command with no declared summary
33
+ # still appears by name (summary nil, usage the generic line).
34
+ def print_index
35
+ commands = Fp::CLI::COMMANDS.map do |name, klass|
36
+ schema = klass.help_schema(name)
37
+ { 'name' => name, 'summary' => schema['summary'], 'usage' => schema['usage'] }
38
+ end
39
+ output.success({ 'version' => Fp::VERSION, 'commands' => commands })
40
+ end
41
+
29
42
  def print_overview
30
43
  puts <<~HELP
31
44
  fp - FeatureParity CLI for agents
@@ -95,6 +108,7 @@ module Fp
95
108
  profile add|list Manage named profiles
96
109
  config set|get|unset|list Manage global settings
97
110
  whoami Show the resolved config (profile, env, API URL, key)
111
+ skill install [--agent X] Install the bundled agent skill (.claude/skills, .agents/skills)
98
112
  repos set|get|list|unset Map surfaces to local repo paths
99
113
  setup Interactive first-time setup
100
114
  version Show version (also: fp --version, fp -v)
@@ -222,13 +236,13 @@ module Fp
222
236
  # Onboard a repo onto FeatureParity: writes .featureparity.yml, a CI gate
223
237
  # workflow, and a FeatureParity section in AGENTS.md telling agents to mark
224
238
  # and report their tests. Needs no API key.
225
- fp init --project stowzilla --surface api
226
- fp init --project stowzilla --no-workflow # skip the CI workflow
227
- fp init --project stowzilla --force # refresh previously written files
239
+ fp init --project acme --surface api
240
+ fp init --project acme --no-workflow # skip the CI workflow
241
+ fp init --project acme --force # refresh previously written files
228
242
 
229
243
  # Enforce parity. Exits 1 on violations, so CI blocks the merge.
230
244
  fp check # project from .featureparity.yml
231
- fp check --project stowzilla --surface api # gate one surface only
245
+ fp check --project acme --surface api # gate one surface only
232
246
  fp check --level covered # demand coverage, not just no regressions
233
247
  fp check --warn-only # report violations but exit 0
234
248
  fp check --json # machine-readable violations
@@ -242,6 +256,10 @@ module Fp
242
256
  fp whoami --json
243
257
  fp --profile staging whoami
244
258
 
259
+ # Install the agent skill that ships with this gem (.claude/skills/fp, .agents/skills/fp)
260
+ fp skill install
261
+ fp skill install --agent claude --global
262
+
245
263
  # Non-interactive setup for CI/automation
246
264
  fp setup --api-key fp_... --profile ci-agent --non-interactive
247
265
 
@@ -260,38 +278,38 @@ module Fp
260
278
  fp projects delete calib-rate --yes
261
279
 
262
280
  # List the surfaces a project tracks (requirements may only name these)
263
- fp surfaces --project stowzilla
281
+ fp surfaces --project acme
264
282
 
265
283
  # View a single surface's details (owner, repo, kind, test globs)
266
- fp surfaces show customer_android --project stowzilla
284
+ fp surfaces show customer_android --project acme
267
285
 
268
286
  # Create a surface (agents can do this — no need to wait on the web app)
269
- fp surfaces add customer_android --project stowzilla \\
287
+ fp surfaces add customer_android --project acme \\
270
288
  --name "Customer Android App" \\
271
289
  --kind android \\
272
- --repo stowzilla/customer-android
290
+ --repo acme/customer-android
273
291
 
274
292
  # Fix up an existing surface (add refuses a key that already exists)
275
- fp surfaces edit web --project stowzilla --kind web --repo stowzilla/web
293
+ fp surfaces edit web --project acme --kind web --repo acme/web
276
294
 
277
295
  # Delete a surface (type the key back, or --yes non-interactively)
278
- fp surfaces delete web --project stowzilla --yes
296
+ fp surfaces delete web --project acme --yes
279
297
 
280
298
  # List requirements for a project
281
- fp list --project stowzilla
299
+ fp list --project acme
282
300
 
283
301
  # List requirements filtered by category
284
- fp list --project stowzilla --category security
302
+ fp list --project acme --category security
285
303
 
286
304
  # List requirements filtered by tag (free-form label)
287
- fp list --project stowzilla --tag mobile
305
+ fp list --project acme --tag mobile
288
306
 
289
307
  # Show gaps: requirements with a required surface that has no real evidence
290
308
  # (missing, stubbed, or failing). Unlike `fp list`, this reads evidence.
291
- fp list --project stowzilla --gaps --surface customer_android
309
+ fp list --project acme --gaps --surface customer_android
292
310
 
293
311
  # Show a specific requirement
294
- fp show print_container_qr --project stowzilla
312
+ fp show print_container_qr --project acme
295
313
 
296
314
  # Propose a new requirement (creates as draft).
297
315
  # A requirement records the current shared understanding, not a decree handed from
@@ -352,7 +370,7 @@ module Fp
352
370
  # vague, revise or ask. Then read it as a manager deciding scope: is the value clear,
353
371
  # is the result observable, are decisions separated from guesses, and does every
354
372
  # sentence earn its place? Do not save until the draft passes this review.
355
- fp propose --project stowzilla \\
373
+ fp propose --project acme \\
356
374
  --slug print_container_qr \\
357
375
  --name "Print QR code on container label" \\
358
376
  --why "Staff scan the label to find a container; without a QR they key the ID by hand and mis-type it" \\
@@ -363,7 +381,7 @@ module Fp
363
381
 
364
382
  # Nest a requirement under a parent (--parent takes the parent's SLUG).
365
383
  # A child's --required surfaces must be a subset of its parent's.
366
- fp propose --project stowzilla \\
384
+ fp propose --project acme \\
367
385
  --slug print_container_qr_ios \\
368
386
  --name "Print QR on iOS" \\
369
387
  --parent print_container_qr \\
@@ -372,7 +390,7 @@ module Fp
372
390
  # Propose a change to a requirement that already exists. Say what prompted it
373
391
  # — the card, the thread, the issue. The requirement drops back to DRAFT and a
374
392
  # human reviews the old-vs-new diff before it counts again.
375
- fp propose-change print_container_qr --project stowzilla \\
393
+ fp propose-change print_container_qr --project acme \\
376
394
  --name "Print a scannable container QR" \\
377
395
  --slug print_scannable_container_qr \\
378
396
  --why "Labels must survive a freezer" \\
@@ -382,27 +400,27 @@ module Fp
382
400
  --source-url https://app.fizzy.do/6098707/cards/1377
383
401
 
384
402
  # Propose deleting a requirement (nothing is destroyed — a human decides)
385
- fp propose-change print_container_qr --project stowzilla \\
403
+ fp propose-change print_container_qr --project acme \\
386
404
  --removal \\
387
405
  --reason "Superseded by print_container_label"
388
406
 
389
407
  # Un-nest a child back to the top level (clears its parent)
390
- fp propose-change print_container_qr_ios --project stowzilla --no-parent \\
408
+ fp propose-change print_container_qr_ios --project acme --no-parent \\
391
409
  --reason "Promoted to a top-level promise"
392
410
 
393
411
  # Amend a proposal you already opened: the single-open-proposal rule won't let
394
412
  # you open a second, so withdraw yours (restoring the requirement) and propose
395
413
  # again. Only the author can withdraw; someone else's proposal goes to review.
396
- fp propose-change print_container_qr --project stowzilla --withdraw
414
+ fp propose-change print_container_qr --project acme --withdraw
397
415
 
398
416
  # See what changed, why, and who asked for it
399
- fp history print_container_qr --project stowzilla
400
- fp history print_container_qr --project stowzilla --pending
417
+ fp history print_container_qr --project acme
418
+ fp history print_container_qr --project acme --pending
401
419
 
402
420
  # Triage the catalog's quality: duplicates, fragments, vague wording, conflicts.
403
421
  # One model call per uncached requirement; unchanged ones are read back free.
404
- fp analyze --project stowzilla
405
- fp analyze print_container_qr --project stowzilla --conflicts
422
+ fp analyze --project acme
423
+ fp analyze print_container_qr --project acme --conflicts
406
424
 
407
425
  # Upload visual test evidence to a requirement. Images and videos require
408
426
  # --surface; deployment fields let reviewers verify exactly what build the
@@ -416,28 +434,28 @@ module Fp
416
434
  # Text formats: txt, md, json (render inline as code blocks for API evidence)
417
435
  # Documents: svg, pdf (downloadable)
418
436
  # Max 100 MB.
419
- fp attach print_container_qr e2e-run.webm --project stowzilla \\
437
+ fp attach print_container_qr e2e-run.webm --project acme \\
420
438
  --surface customer_web \\
421
439
  --example-title "prints a QR code onto the container label" \\
422
440
  --captured-at 2026-10-15T01:42:00Z \\
423
441
  --deployed-at 2026-10-15T01:30:00Z \\
424
442
  --sha abc1234 \\
425
443
  --deployment-url https://preview.example.test \\
426
- --test-run-url https://github.com/stowzilla/app/actions/runs/123
444
+ --test-run-url https://github.com/acme/app/actions/runs/123
427
445
 
428
446
  # For API tests, attach the JSON response as inline evidence
429
- fp attach api_returns_order_details response.json --project stowzilla \\
447
+ fp attach api_returns_order_details response.json --project acme \\
430
448
  --surface api \\
431
- --evidence-key "api:stowzilla/api:e2e"
449
+ --evidence-key "api:acme/api:e2e"
432
450
 
433
451
  # List attachments and their capture/deployment context
434
- fp attachments print_container_qr --project stowzilla
452
+ fp attachments print_container_qr --project acme
435
453
 
436
454
  # Get a download URL for a specific attachment
437
- fp attachments print_container_qr <attachment-id> --project stowzilla
455
+ fp attachments print_container_qr <attachment-id> --project acme
438
456
 
439
457
  # Delete an attachment
440
- fp attach rm print_container_qr <attachment-id> --project stowzilla
458
+ fp attach rm print_container_qr <attachment-id> --project acme
441
459
 
442
460
  # Read a Pari conversation so an agent can review AI suggestions.
443
461
  # A conversation is just a record identified by its id — no --project
@@ -446,12 +464,12 @@ module Fp
446
464
  fp conversation 03h0abc123xyz
447
465
 
448
466
  # Report evidence for a requirement
449
- fp report print_container_qr --project stowzilla \\
467
+ fp report print_container_qr --project acme \\
450
468
  --surface customer_android \\
451
469
  --file app/src/test/java/PrintQrTest.kt \\
452
470
  --line 42 \\
453
- --repo stowzilla/customer-android \\
454
- --pr https://github.com/stowzilla/customer-android/pull/123 \\
471
+ --repo acme/customer-android \\
472
+ --pr https://github.com/acme/customer-android/pull/123 \\
455
473
  --work-item https://app.fizzy.do/123/cards/456 \\
456
474
  --title "prints a QR code onto the container label"
457
475
 
@@ -461,10 +479,10 @@ module Fp
461
479
  # rspec --format RspecJunitFormatter --out junit.xml # (or your runner's equivalent)
462
480
  # RSpec's own `--format json --out rspec.json` works as --junit too, with no extra gem.
463
481
  # Or let fp add the formatter and report in one step (rspec, pytest, vitest, playwright):
464
- # fp run --surface api --repo stowzilla/marketplace -- bundle exec rspec
465
- fp report --junit junit.xml --project stowzilla \\
482
+ # fp run --surface api --repo acme/marketplace -- bundle exec rspec
483
+ fp report --junit junit.xml --project acme \\
466
484
  --surface api \\
467
- --repo stowzilla/marketplace \\
485
+ --repo acme/marketplace \\
468
486
  --work-item https://app.fizzy.do/123/cards/456
469
487
  # --base-dir sets where relative test file paths in the report resolve from
470
488
  # Skipped tests are reported as 'stub'; everything else as 'present'.
@@ -478,15 +496,15 @@ module Fp
478
496
  # runner's testDir is searched for under base-dir, and --attach-media uploads
479
497
  # the videos/screenshots the run recorded ([[ATTACHMENT|…]]) as visual
480
498
  # evidence, each nested under the test it proves.
481
- fp report --junit junit.xml --project stowzilla \\
482
- --surface web --repo stowzilla/app --base-dir frontend --attach-media
499
+ fp report --junit junit.xml --project acme \\
500
+ --surface web --repo acme/app --base-dir frontend --attach-media
483
501
 
484
502
  # CI ONLY: ingest real pass/fail results. Run in your CI pipeline after
485
503
  # the suite (on green AND red builds). Unlike `fp report`, this writes
486
504
  # passing/failing evidence and marks vanished-but-previously-passing
487
505
  # slugs as failing. This is the half of the loop that turns the matrix
488
506
  # circles into ✓ / ✗.
489
- fp ci-report --junit junit.xml --project stowzilla \\
507
+ fp ci-report --junit junit.xml --project acme \\
490
508
  --surface api \\
491
509
  --ci-url "$CI_RUN_URL"
492
510
  # Pass --junit more than once to ingest several reports for one surface.
@@ -497,25 +515,25 @@ module Fp
497
515
  # --allow-empty when a suite genuinely has none.
498
516
 
499
517
  # Show the parity matrix
500
- fp matrix --project stowzilla
518
+ fp matrix --project acme
501
519
 
502
520
  # Export matrix as CSV
503
- fp matrix --project stowzilla --csv > matrix.csv
521
+ fp matrix --project acme --csv > matrix.csv
504
522
 
505
523
  # Export the full requirements document as Markdown
506
- fp export --project stowzilla > requirements.md
524
+ fp export --project acme > requirements.md
507
525
 
508
526
  # Export only active requirements for one surface, written to a file
509
- fp export --project stowzilla --status active \\
527
+ fp export --project acme --status active \\
510
528
  --surface customer_android --output requirements.md
511
529
 
512
530
  # Map a surface to a local repo on this machine
513
531
  fp repos set customer_android ~/code/customer-android \\
514
- --project stowzilla --repo stowzilla/customer-android
532
+ --project acme --repo acme/customer-android
515
533
 
516
534
  # Find where a surface's code lives locally (for agents)
517
- fp repos get customer_android --project stowzilla
518
- cd "$(fp repos get customer_android --project stowzilla)"
535
+ fp repos get customer_android --project acme
536
+ cd "$(fp repos get customer_android --project acme)"
519
537
 
520
538
  MARKER CONVENTION
521
539
  Tests are bound to requirements using the fp:<slug> marker in the test file.
@@ -14,8 +14,8 @@ module Fp
14
14
  help_flag :project, 'Project slug (falls back to .featureparity.yml)'
15
15
  help_flag :pending, 'Show only the open proposal, if any'
16
16
  help_flag :limit, 'Cap the number of events shown'
17
- help_example 'fp history print_container_qr --project stowzilla'
18
- help_example 'fp history print_container_qr --project stowzilla --pending'
17
+ help_example 'fp history print_container_qr --project acme'
18
+ help_example 'fp history print_container_qr --project acme --pending'
19
19
 
20
20
  KNOWN_FLAGS = { project: :string, pending: :boolean, limit: :string }.freeze
21
21
 
@@ -34,8 +34,8 @@ module Fp
34
34
  help_flag :force, 'Refresh files fp previously wrote'
35
35
  help_flag :no_workflow, 'Skip writing the CI workflow'
36
36
  help_flag :no_agents, 'Skip appending the AGENTS.md section'
37
- help_example 'fp init --project stowzilla --surface api'
38
- help_example 'fp init --project stowzilla --no-workflow'
37
+ help_example 'fp init --project acme --surface api'
38
+ help_example 'fp init --project acme --no-workflow'
39
39
  help_example 'fp init --detect', 'See what fp makes of this repo before choosing a slug and surfaces'
40
40
  help_note "Makes no API calls, so a repo can be onboarded before anyone has a key.\n" \
41
41
  'Committing the workflow before the FP_API_KEY secret exists is fine: the gate skips with an explanation.'
@@ -183,10 +183,11 @@ module Fp
183
183
  next
184
184
  end
185
185
 
186
- content = strip_existing_section(content) if content.include?(AGENTS_MARKER)
186
+ refreshed = content.include?(AGENTS_MARKER)
187
+ content = strip_existing_section(content) if refreshed
187
188
  separator = content.end_with?("\n") ? "\n" : "\n\n"
188
189
  File.write(path, "#{content}#{separator}#{section}")
189
- written << [relative(root, path), 'appended FeatureParity section']
190
+ written << [relative(root, path), refreshed ? 'refreshed FeatureParity section' : 'appended FeatureParity section']
190
191
  else
191
192
  File.write(path, section)
192
193
  written << [relative(root, path), 'created']
@@ -514,6 +515,39 @@ module Fp
514
515
  # The agent-facing brief. Written as instructions rather than description, because
515
516
  # this text is read by something that is about to write a test and needs to know
516
517
  # exactly what to do.
518
+ # The first marker example in the section, in the language of the repo's first
519
+ # detected test runner (nothing detected, or a runner we have no example for, keeps
520
+ # the Ruby/RSpec one). A pytest repo reading `it '...' do` first was misled.
521
+ def marker_example
522
+ name = ((@detection || {})['test_runners'] || []).first&.fetch('name', nil)
523
+ case name
524
+ when 'pytest'
525
+ { lang: 'python', comment: '#',
526
+ code: "# fp:print_container_qr\ndef test_prints_a_qr_code_onto_the_container_label():" }
527
+ when 'jest', 'vitest', 'playwright'
528
+ { lang: 'javascript', comment: '//',
529
+ code: "// fp:print_container_qr\nit('prints a QR code onto the container label', () => {" }
530
+ else
531
+ { lang: 'ruby', comment: '#',
532
+ code: "# fp:print_container_qr\nit 'prints a QR code onto the container label' do" }
533
+ end
534
+ end
535
+
536
+ # How to get a report out of the suite, said for the repo's first detected test
537
+ # runner (Fizzy #1991). A pytest repo was told about RSpec's JSON report first.
538
+ def report_shortcut
539
+ runner = ((@detection || {})['test_runners'] || []).first
540
+ if runner && runner['fp_run'] && runner['name'] != 'rspec'
541
+ "To run the suite and report in one step, with no formatter added to the project:\n" \
542
+ "`#{runner['fp_run']}`. Or write the report yourself with\n" \
543
+ "`#{runner['report_command']}` and pass it to `--junit`."
544
+ else
545
+ "`--junit` also takes RSpec's own `--format json` report. To run the suite and report in\n" \
546
+ "one step with no formatter added to the project (rspec, pytest, vitest, playwright):\n" \
547
+ '`fp run --surface <surface> --repo <org/repo> -- <test command>`.'
548
+ end
549
+ end
550
+
517
551
  def agents_section(project_slug)
518
552
  <<~MARKDOWN
519
553
  #{AGENTS_MARKER}
@@ -602,13 +636,12 @@ module Fp
602
636
  Add an `fp:<slug>` comment directly above the test. Keep the test's own name
603
637
  readable — the marker is the join, not the name.
604
638
 
605
- ```ruby
606
- # fp:print_container_qr
607
- it 'prints a QR code onto the container label' do
639
+ ```#{marker_example[:lang]}
640
+ #{marker_example[:code]}
608
641
  ```
609
642
 
610
643
  Pin surfaces in the marker when one test satisfies more than one:
611
- `# fp:print_container_qr@api,web`.
644
+ `#{marker_example[:comment]} fp:print_container_qr@api,web`.
612
645
 
613
646
  Every feature needs one. A requirement with no marked test is a gap, and gaps are
614
647
  what the gate is eventually going to fail on.
@@ -620,9 +653,7 @@ module Fp
620
653
  --work-item <card-or-issue-url>
621
654
  ```
622
655
 
623
- `--junit` also takes RSpec's own `--format json` report. To run the suite and report in
624
- one step with no formatter added to the project (rspec, pytest, vitest, playwright):
625
- `fp run --surface <surface> --repo <org/repo> -- <test command>`.
656
+ #{report_shortcut}
626
657
 
627
658
  Report `present` or `stub` only — **never** claim `passing`/`failing`. Those are CI's
628
659
  to write, via `fp ci-report`, and the gate trusts them precisely because agents can't
@@ -13,9 +13,9 @@ module Fp
13
13
  help_flag :tag, 'Filter by a free-form tag'
14
14
  help_flag :status, 'Filter by status: active (default), draft, archived'
15
15
  help_flag :gaps, 'Show only requirements with an uncovered required surface (reads evidence)'
16
- help_example 'fp list --project stowzilla'
17
- help_example 'fp list --project stowzilla --status draft', 'Drafts are hidden by default'
18
- help_example 'fp list --project stowzilla --gaps --surface customer_android'
16
+ help_example 'fp list --project acme'
17
+ help_example 'fp list --project acme --status draft', 'Drafts are hidden by default'
18
+ help_example 'fp list --project acme --gaps --surface customer_android'
19
19
  help_example 'fp list --status draft --gaps', 'Drafts lacking evidence on a required surface'
20
20
 
21
21
  KNOWN_FLAGS = {