Repository navigation
Commit cc1b3ad
authored
Say how to recover a broken connect.json, and keep reporting around it (#1053)
* Say how to recover a broken connect.json, and keep reporting around it
A typo in connect.json used to stop connect doctor, status, show and setup
at one line with no position, and nothing said how to get out of it: setup
said to fix or remove the file, the skill said never to edit it.
- Parse errors name the line and column, and an unknown key names the key
it was probably meant to be ("did you mean watch_completions?").
- connect doctor fails its connect.json row with the recovery command, and
still runs the token, identity, ticket, feed, Pings and ledger checks,
finding the profile's connector state from its state directory or its
credential.
- connect status still shows the ledger, leads with the problem, and counts
requests held as config_unreadable.
- connect setup --reset sets the profile up from the run's flags alone; the
old file is moved aside as connect.json.broken-<time> only when the new
one is written, and put back if that write fails.
- basecamp doctor has a line per connector profile.
- Hints that said to remove the file point at --reset, and the skill says
what a person or agent does when the file no longer reads.
* Place every key refusal where it is, and keep reset's hints runnable
From the second adversarial pass and Copilot's review of 7381f55:
- A ledger that opens and then can't be read no longer hides a broken
connect.json from status.
- Unknown keys are placed in the object that refused them, found by the
schema's own types at each path, and only a key valid in that object is
suggested. A key not spelled canonically and a duplicated key are placed
too.
- The recovery hint names --serve, since a reset serves nothing unless told
to, and a reset refused for serving nothing says to reset again with one.
- Status says requests are held because the file couldn't be read, without
claiming a connector is retrying them.
- --reset alone at a terminal runs scripted setup, not guided: pinned.
* Place keys by object, and make reset's hint the command that works
From the third adversarial pass and Copilot's review of 8014d38:
- A duplicate key is placed in the object that has it: objects are told
apart by instance, so sibling objects in an array are two.
- An unknown key is never placed on a map's id: only a struct refuses a
key.
- A reset refused for serving nothing hints with this run again, every
flag it had, and --serve: following it works, and a test follows it.
- basecamp doctor's line for a broken profile says whether its connector
is still running, from the profile's state directory.
* Replay setup's own flags alone in reset's hint, and name the agent that runs
From the fourth adversarial pass over ec04243:
- The hint for a reset that serves nothing repeats setup's own flags and
leaves inherited ones out: a count such as -v came back as "--verbose 1",
which the CLI reads as a stray argument. A test runs it under a root with
those flags and has a shell parse the hint back into its words.
- basecamp doctor's line for a broken profile names the agent whose
connector state it read, since the credential may since be another's.
* Treat a connect.json copied from another profile as one that can't be used
Copilot, in the body of its review of ec04243: basecamp doctor called a
valid file naming another profile "set up", though connect show and setup
refuse it. One loader for doctor, status and the doctor line now refuses it,
so each reports it with the recovery hint.
* Refuse another profile's connect.json in reports only, not in the commands that stop a connector
The fifth adversarial pass over 2760c22: the connector itself takes a file
naming another profile, so refusing it in every operator command left a
running connector that connect stop and the worker commands could no longer
reach. Only doctor, status and the doctor line call it a problem now. The
doctor line no longer claims a running connector holds requests, which it
doesn't for a mismatch.
* Read this profile's own state when its connect.json was copied from another
Copilot on 90c36a7: a copied file names another profile's agent, and
following it, status found no ledger and doctor skipped the one that is
there. The profile's one state directory is preferred, as for a file that
can't be read; the copy's agent is the fallback.
* Refuse a copied connect.json from the read already made
Copilot's review body on 9c431fe: the report read the file a second time
to build the refusal, and a repair in between left a profile with no
refusal and no policy, which doctor would have passed and then failed to
verify. The refusal is now made from the first read.1 parent 40249ab commit cc1b3ad
15 files changed
Lines changed: 1633 additions & 52 deletions
File tree
- internal
- commands
- connector/setup
- skills/basecamp-connect
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
231 | 232 | | |
232 | 233 | | |
233 | 234 | | |
234 | | - | |
| 235 | + | |
235 | 236 | | |
236 | 237 | | |
237 | 238 | | |
238 | 239 | | |
239 | 240 | | |
240 | | - | |
| 241 | + | |
241 | 242 | | |
242 | 243 | | |
243 | 244 | | |
| |||
405 | 406 | | |
406 | 407 | | |
407 | 408 | | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
408 | 414 | | |
409 | 415 | | |
410 | 416 | | |
| |||
596 | 602 | | |
597 | 603 | | |
598 | 604 | | |
| 605 | + | |
599 | 606 | | |
600 | 607 | | |
601 | 608 | | |
| |||
643 | 650 | | |
644 | 651 | | |
645 | 652 | | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
646 | 656 | | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
647 | 664 | | |
648 | 665 | | |
649 | 666 | | |
650 | | - | |
651 | | - | |
| 667 | + | |
| 668 | + | |
652 | 669 | | |
653 | 670 | | |
654 | 671 | | |
| |||
686 | 703 | | |
687 | 704 | | |
688 | 705 | | |
689 | | - | |
| 706 | + | |
690 | 707 | | |
691 | 708 | | |
692 | 709 | | |
| |||
695 | 712 | | |
696 | 713 | | |
697 | 714 | | |
698 | | - | |
699 | | - | |
| 715 | + | |
| 716 | + | |
700 | 717 | | |
701 | | - | |
| 718 | + | |
702 | 719 | | |
703 | 720 | | |
704 | 721 | | |
| |||
709 | 726 | | |
710 | 727 | | |
711 | 728 | | |
712 | | - | |
713 | | - | |
| 729 | + | |
| 730 | + | |
714 | 731 | | |
715 | 732 | | |
716 | 733 | | |
| |||
754 | 771 | | |
755 | 772 | | |
756 | 773 | | |
757 | | - | |
758 | | - | |
| 774 | + | |
| 775 | + | |
759 | 776 | | |
760 | 777 | | |
761 | 778 | | |
| |||
837 | 854 | | |
838 | 855 | | |
839 | 856 | | |
840 | | - | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
841 | 869 | | |
842 | 870 | | |
843 | 871 | | |
| |||
869 | 897 | | |
870 | 898 | | |
871 | 899 | | |
872 | | - | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
873 | 916 | | |
874 | 917 | | |
875 | 918 | | |
| |||
886 | 929 | | |
887 | 930 | | |
888 | 931 | | |
889 | | - | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
890 | 937 | | |
891 | 938 | | |
892 | 939 | | |
893 | 940 | | |
894 | 941 | | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
895 | 976 | | |
896 | 977 | | |
897 | 978 | | |
| |||
1191 | 1272 | | |
1192 | 1273 | | |
1193 | 1274 | | |
1194 | | - | |
| 1275 | + | |
1195 | 1276 | | |
1196 | 1277 | | |
1197 | 1278 | | |
1198 | 1279 | | |
1199 | 1280 | | |
1200 | 1281 | | |
1201 | | - | |
1202 | | - | |
| 1282 | + | |
| 1283 | + | |
1203 | 1284 | | |
1204 | 1285 | | |
1205 | 1286 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
| 121 | + | |
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| |||
0 commit comments